/* ============================================================
   GAP Nexus Journal - Portal stylesheet
   Palette : #520051 main / #920090 / #D400D1 / #FFFFFF
   Type    : Spectral (display) - IBM Plex Sans (UI) - IBM Plex Mono (data)
   ============================================================ */

:root {
  --plum:        #520051;
  --plum-deep:   #2C002B;
  --plum-ink:    #1A0019;
  --orchid:      #920090;
  --magenta:     #D400D1;
  --paper:       #FFFFFF;

  --wash:        #FBF7FB;
  --ink:         #241024;
  --muted:       #6E5A6E;
  --rule:        rgba(82, 0, 81, .13);
  --rule-strong: rgba(82, 0, 81, .28);

  --ff-display: "Spectral", Georgia, "Times New Roman", serif;
  --ff-body:    "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ff-mono:    "IBM Plex Mono", ui-monospace, "SF Mono", Consolas, monospace;

  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 14px;

  --shadow-card: 0 1px 2px rgba(44, 0, 43, .06), 0 18px 46px -22px rgba(44, 0, 43, .35);

  --bs-primary: #520051;
}

/* ---------- Base ---------- */
* { -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  font-family: var(--ff-body);
  color: var(--ink);
  background: var(--wash);
  font-size: 15.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--orchid); text-decoration: none; }
a:hover { color: var(--magenta); }

::selection { background: var(--magenta); color: #fff; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 999;
  background: var(--plum); color: #fff; padding: .6rem 1rem; border-radius: 0 0 var(--r-md) 0;
}
.skip-link:focus { left: 0; color: #fff; }

:focus-visible {
  outline: 2px solid var(--magenta);
  outline-offset: 2px;
}

/* ---------- Masthead lockup ---------- */
.masthead { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; }

.masthead-mark {
  width: 40px; height: 40px; flex: 0 0 40px;
  display: grid; place-items: center;
  font-family: var(--ff-display);
  font-size: 1.05rem; font-weight: 600; letter-spacing: .02em;
  color: #fff;
  background: linear-gradient(145deg, var(--orchid), var(--plum) 65%);
  border-radius: var(--r-sm);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.22);
}

.masthead-text { display: flex; flex-direction: column; line-height: 1.05; }
.masthead-text strong {
  font-family: var(--ff-display);
  font-weight: 600; font-size: 1.06rem; letter-spacing: .005em;
}
.masthead-text em {
  font-style: normal;
  font-family: var(--ff-mono);
  font-size: .62rem; letter-spacing: .26em; text-transform: uppercase;
  opacity: .72; margin-top: 3px;
}

/* ============================================================
   AUTH LAYOUT  (split screen)
   ============================================================ */
.auth-shell { display: flex; min-height: 100vh; min-height: 100dvh; }

/* ----- Left: brand panel ----- */
.auth-brand {
  flex: 0 0 44%;
  position: relative;
  background:
    radial-gradient(120% 90% at 8% 8%, rgba(212, 0, 209, .38) 0%, rgba(212, 0, 209, 0) 55%),
    radial-gradient(90% 70% at 100% 100%, rgba(146, 0, 144, .5) 0%, rgba(146, 0, 144, 0) 60%),
    linear-gradient(168deg, var(--plum) 0%, var(--plum-deep) 100%);
  color: #fff;
  overflow: hidden;
}

/* faint ruled-paper texture: a journal's own grid */
.auth-brand::before {
  content: "";
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(
    to bottom, rgba(255,255,255,.055) 0 1px, transparent 1px 34px);
  pointer-events: none;
}

.auth-brand-inner {
  position: relative;
  display: flex; flex-direction: column;
  min-height: 100%;
  padding: clamp(2rem, 4vw, 3.5rem);
}

.auth-brand .masthead { color: #fff; margin-bottom: 2.25rem; }
.auth-brand .masthead-mark {
  background: rgba(255,255,255,.1);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.35);
  color: #fff;
}

.issn {
  font-family: var(--ff-mono);
  font-size: .68rem; letter-spacing: .18em; text-transform: uppercase;
  color: rgba(255,255,255,.6);
  padding-bottom: .9rem;
  border-bottom: 1px solid rgba(255,255,255,.18);
  margin-bottom: 1.75rem;
}

.brand-display {
  font-family: var(--ff-display);
  font-weight: 300;
  font-size: clamp(2rem, 3.1vw, 3rem);
  line-height: 1.13;
  letter-spacing: -.015em;
  margin: 0 0 1rem;
}
.brand-display span {
  font-style: italic;
  color: var(--magenta);
  text-shadow: 0 0 26px rgba(212, 0, 209, .45);
}

.brand-lede {
  max-width: 34ch;
  color: rgba(255,255,255,.74);
  font-size: .95rem;
  margin-bottom: 2.4rem;
}

/* ----- Signature device: table of contents ----- */
.contents { list-style: none; margin: 0 0 auto; padding: 0; }

.contents li {
  display: flex; align-items: baseline; gap: .7rem;
  padding: .62rem 0;
  border-top: 1px solid rgba(255,255,255,.14);
  font-size: .9rem;
}
.contents li:last-child { border-bottom: 1px solid rgba(255,255,255,.14); }

.c-num {
  font-family: var(--ff-mono);
  font-size: .68rem;
  width: 2.1ch; flex: 0 0 2.1ch;
  color: var(--magenta);
  text-transform: lowercase;
}
.c-title { color: rgba(255,255,255,.9); }
.c-leader {
  flex: 1 1 auto;
  height: 1px;
  min-width: 1.5rem;
  background-image: radial-gradient(circle, rgba(255,255,255,.45) 1px, transparent 1px);
  background-size: 6px 1px;
  background-repeat: repeat-x;
  transform: translateY(-3px);
}
.c-pg {
  font-family: var(--ff-mono);
  font-size: .72rem;
  color: rgba(255,255,255,.55);
}

.brand-foot {
  display: flex; flex-wrap: wrap; gap: .35rem 1.25rem;
  margin-top: 2.5rem; padding-top: 1.1rem;
  border-top: 1px solid rgba(255,255,255,.18);
  font-family: var(--ff-mono);
  font-size: .66rem; letter-spacing: .12em; text-transform: uppercase;
  color: rgba(255,255,255,.5);
}

/* ----- Right: form panel ----- */
.auth-panel {
  flex: 1 1 auto;
  background: var(--paper);
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(1.75rem, 4vw, 3.5rem);
}

.auth-panel-inner {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}

.eyebrow {
  font-family: var(--ff-mono);
  font-size: .68rem; letter-spacing: .24em; text-transform: uppercase;
  color: var(--orchid);
  margin-bottom: .6rem;
}

.page-title {
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: clamp(1.7rem, 2.6vw, 2.15rem);
  letter-spacing: -.015em;
  line-height: 1.15;
  margin: 0 0 .45rem;
  color: var(--plum);
}

.page-sub { color: var(--muted); margin-bottom: 1.9rem; font-size: .94rem; }

.panel-foot {
  margin-top: 2.6rem; padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
  display: flex; flex-wrap: wrap; gap: .4rem 1.4rem;
  align-items: center; justify-content: space-between;
}
.panel-foot p { margin: 0; font-size: .78rem; color: var(--muted); }
.panel-foot ul { list-style: none; display: flex; gap: 1.1rem; margin: 0; padding: 0; }
.panel-foot a { font-size: .78rem; color: var(--muted); }
.panel-foot a:hover { color: var(--magenta); }

/* ============================================================
   FORMS
   ============================================================ */
.form-label {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--plum);
  margin-bottom: .38rem;
}
.form-label .req { color: var(--magenta); }

.form-control,
.form-select {
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-md);
  padding: .68rem .85rem;
  font-size: .95rem;
  color: var(--ink);
  background-color: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control::placeholder { color: #B39FB3; }

.form-control:focus,
.form-select:focus {
  border-color: var(--orchid);
  box-shadow: 0 0 0 3px rgba(212, 0, 209, .16);
}

.form-control:disabled,
.form-control[readonly] {
  background-color: #F6F1F6;
  color: var(--muted);
  border-style: dashed;
}

.input-group-text {
  background: #F8F3F8;
  border: 1px solid var(--rule-strong);
  color: var(--orchid);
  border-radius: var(--r-md);
}

.btn-reveal {
  border: 1px solid var(--rule-strong);
  border-left: 0;
  background: #fff;
  color: var(--muted);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 0 .85rem;
}
.btn-reveal:hover { color: var(--magenta); }

.form-text { font-size: .78rem; color: var(--muted); }

.invalid-feedback { font-size: .78rem; }
.was-validated .form-control:invalid,
.form-control.is-invalid,
.was-validated .form-select:invalid,
.form-select.is-invalid { border-color: #C21857; }
.was-validated .form-control:valid,
.form-control.is-valid { border-color: #2F8F5B; background-image: none; }

/* password strength */
.pw-meter { display: flex; gap: 4px; margin-top: .5rem; }
.pw-meter span {
  height: 3px; flex: 1;
  background: var(--rule);
  border-radius: 2px;
  transition: background .2s ease;
}
.pw-meter[data-score="1"] span:nth-child(1) { background: #C21857; }
.pw-meter[data-score="2"] span:nth-child(-n+2) { background: #D98324; }
.pw-meter[data-score="3"] span:nth-child(-n+3) { background: var(--orchid); }
.pw-meter[data-score="4"] span { background: #2F8F5B; }
.pw-hint { font-size: .75rem; color: var(--muted); margin-top: .3rem; display: block; }

/* ---------- Number capture: set like a footnote equation ---------- */
.capture {
  margin: 1.6rem 0 1.35rem;
  padding: 1.05rem 1.15rem;
  background: linear-gradient(180deg, #FCF8FC, #F8F1F8);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--magenta);
  border-radius: var(--r-md);
}

.capture-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  font-family: var(--ff-mono);
  font-size: .66rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--orchid);
  margin-bottom: .7rem;
}

.capture-refresh {
  border: 0; background: none; padding: 0;
  color: var(--muted);
  font-family: var(--ff-mono);
  font-size: .66rem; letter-spacing: .14em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: .35rem;
  cursor: pointer;
}
.capture-refresh:hover { color: var(--magenta); }
.capture-refresh i { transition: transform .45s ease; }
.capture-refresh:hover i { transform: rotate(180deg); }

.capture-row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }

.capture-sum {
  font-family: var(--ff-display);
  font-size: 1.85rem;
  font-weight: 300;
  color: var(--plum);
  letter-spacing: .02em;
  user-select: none;
  white-space: nowrap;
}
.capture-sum .op { color: var(--magenta); padding: 0 .12em; }

.capture-input {
  width: 116px;
  text-align: center;
  font-family: var(--ff-mono);
  font-size: 1.05rem;
  letter-spacing: .06em;
}

.capture-note { font-size: .76rem; color: var(--muted); margin: .6rem 0 0; }

/* ---------- Buttons ---------- */
.btn {
  border-radius: var(--r-md);
  font-weight: 600;
  letter-spacing: .01em;
  padding: .72rem 1.35rem;
}

.btn-brand {
  background: linear-gradient(135deg, var(--orchid), var(--plum) 78%);
  border: 0;
  color: #fff;
  box-shadow: 0 10px 22px -12px rgba(82, 0, 81, .85);
}
.btn-brand:hover,
.btn-brand:focus {
  color: #fff;
  background: linear-gradient(135deg, var(--magenta), var(--orchid) 82%);
  box-shadow: 0 14px 26px -12px rgba(212, 0, 209, .7);
}
.btn-brand:active { transform: translateY(1px); }

.btn-outline-brand {
  border: 1px solid var(--rule-strong);
  color: var(--plum);
  background: #fff;
}
.btn-outline-brand:hover { border-color: var(--orchid); color: var(--orchid); background: #FCF6FC; }

.btn-lg { padding: .85rem 1.5rem; font-size: 1rem; }

/* ---------- Divider with label ---------- */
.rule-label {
  display: flex; align-items: center; gap: 1rem;
  margin: 1.75rem 0;
  font-family: var(--ff-mono);
  font-size: .66rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--muted);
}
.rule-label::before,
.rule-label::after { content: ""; height: 1px; background: var(--rule); flex: 1; }

/* ---------- Alerts ---------- */
.alert {
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  font-size: .9rem;
  padding: .85rem 1rem;
}
.alert-success { background: #F1FAF4; border-color: #BFE3CD; color: #1D6A41; }
.alert-danger  { background: #FDF2F6; border-color: #F3C9DA; color: #A5164A; }
.alert-warning { background: #FEF8EE; border-color: #F3DCBB; color: #8A5A16; }
.alert-info    { background: #FAF2FA; border-color: #E6CDE6; color: var(--plum); }

.alert ul { margin: .4rem 0 0; padding-left: 1.1rem; }

/* ============================================================
   APP LAYOUT  (dashboard)
   ============================================================ */
.layout-app { background: var(--wash); }

.app-nav {
  background: var(--plum);
  padding: .55rem 0;
  box-shadow: 0 1px 0 rgba(255,255,255,.08), 0 10px 30px -22px rgba(44,0,43,.9);
}
.app-nav .masthead { color: #fff; }
.app-nav .masthead-mark { background: rgba(255,255,255,.12); box-shadow: inset 0 0 0 1px rgba(255,255,255,.3); }
.app-nav .navbar-toggler { border: 1px solid rgba(255,255,255,.3); color: #fff; padding: .25rem .55rem; }
.app-nav .navbar-toggler:focus { box-shadow: none; }

.app-nav .nav-link {
  color: rgba(255,255,255,.78);
  font-size: .9rem;
  font-weight: 500;
  padding: .45rem .9rem;
  border-radius: var(--r-sm);
}
.app-nav .nav-link:hover { color: #fff; background: rgba(255,255,255,.08); }
.app-nav .nav-link.active { color: #fff; box-shadow: inset 0 -2px 0 var(--magenta); border-radius: 0; }

.account-chip { display: inline-flex; align-items: center; gap: .55rem; }
.avatar {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--magenta);
  color: #fff;
  font-size: .74rem; font-weight: 700; letter-spacing: .02em;
}
.account-name { font-size: .9rem; }

.dropdown-menu {
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
  font-size: .9rem;
}
.dropdown-header small { font-family: var(--ff-mono); font-size: .68rem; color: var(--muted); }
.dropdown-item:active { background: var(--plum); }

.app-main { padding: 2.25rem 0 3rem; }

/* ---------- Page head ---------- */
.page-head {
  display: flex; flex-wrap: wrap; gap: 1rem;
  align-items: flex-end; justify-content: space-between;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 1.75rem;
}
.page-head .page-title { margin-bottom: .2rem; }
.page-head .page-sub { margin-bottom: 0; }

.ref-tag {
  font-family: var(--ff-mono);
  font-size: .72rem; letter-spacing: .1em;
  color: var(--orchid);
  background: #FAF2FA;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: .3rem .8rem;
  white-space: nowrap;
}

/* ---------- Cards ---------- */
.card-j {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  height: 100%;
}

.card-j-head {
  padding: 1.05rem 1.35rem;
  border-bottom: 1px solid var(--rule);
  background: linear-gradient(180deg, #FCF9FC, #fff);
}
.card-j-head h2 {
  font-family: var(--ff-display);
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--plum);
  margin: 0;
}
.card-j-head p { margin: .2rem 0 0; font-size: .82rem; color: var(--muted); }

.card-j-body { padding: 1.35rem; }

/* profile summary */
.identity { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.identity .avatar-lg {
  width: 62px; height: 62px; flex: 0 0 62px;
  display: grid; place-items: center;
  border-radius: var(--r-md);
  background: linear-gradient(145deg, var(--magenta), var(--plum));
  color: #fff;
  font-family: var(--ff-display);
  font-size: 1.4rem; font-weight: 600;
}
.identity h3 {
  font-family: var(--ff-display);
  font-size: 1.22rem; margin: 0; color: var(--ink);
}
.identity p { margin: .1rem 0 0; font-size: .84rem; color: var(--muted); }

.meta-list { list-style: none; margin: 0; padding: 0; }
.meta-list li {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: .6rem 0;
  border-top: 1px solid var(--rule);
  font-size: .88rem;
}
.meta-list li:first-child { border-top: 0; }
.meta-list .k {
  font-family: var(--ff-mono);
  font-size: .68rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
  padding-top: .18rem;
}
.meta-list .v { text-align: right; word-break: break-word; }

.locked-note {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .74rem; color: var(--muted);
}

/* ---------- App footer ---------- */
.app-foot {
  background: var(--plum-deep);
  color: rgba(255,255,255,.65);
  padding: 1.6rem 0;
  margin-top: auto;
}
.foot-brand {
  font-family: var(--ff-display);
  color: #fff; font-size: 1rem; margin: 0;
}
.foot-meta {
  font-family: var(--ff-mono);
  font-size: .68rem; letter-spacing: .1em;
  margin: .2rem 0 0;
}

/* ============================================================
   MOTION  (one restrained load sequence)
   ============================================================ */
@keyframes riseIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.auth-panel-inner > *,
.app-main > .container > * { animation: riseIn .5s ease both; }
.auth-panel-inner > *:nth-child(2) { animation-delay: .05s; }
.auth-panel-inner > *:nth-child(3) { animation-delay: .1s; }
.auth-panel-inner > *:nth-child(4) { animation-delay: .15s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (min-width: 992px) {
  /* Long forms scroll; the masthead stays with the reader. */
  .auth-brand {
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    height: 100dvh;
  }
  .auth-brand-inner { height: 100%; }
}

@media (max-width: 1199.98px) {
  .auth-brand { flex-basis: 40%; }
}

@media (max-width: 991.98px) {
  .auth-shell { flex-direction: column; }
  .auth-brand { flex: 0 0 auto; }
  .auth-brand-inner { padding: 1.75rem 1.5rem 1.9rem; }
  .brand-display { font-size: 1.85rem; }
  .brand-lede { margin-bottom: 1.5rem; max-width: none; }
  .contents { display: none; }             /* keep the mobile header compact */
  .brand-foot { margin-top: 1.4rem; }
  .auth-panel { padding: 2rem 1.5rem 2.5rem; }

  .app-nav .navbar-nav { padding: .5rem 0; gap: .15rem; }
  .app-nav .nav-link.active { box-shadow: inset 2px 0 0 var(--magenta); border-radius: var(--r-sm); }
}

@media (max-width: 575.98px) {
  body { font-size: 15px; }
  .auth-brand-inner { padding: 1.4rem 1.15rem 1.6rem; }
  .brand-display { font-size: 1.6rem; }
  .brand-foot { font-size: .6rem; }
  .auth-panel { padding: 1.75rem 1.15rem 2.25rem; }
  .capture-row { gap: .6rem; }
  .capture-sum { font-size: 1.6rem; }
  .capture-input { width: 100px; }
  .panel-foot { flex-direction: column; align-items: flex-start; }
  .page-head { align-items: flex-start; }
  .card-j-body { padding: 1.15rem; }
  .meta-list li { flex-direction: column; gap: .1rem; }
  .meta-list .v { text-align: left; }
}

/* Long-form print courtesy */
@media print {
  .app-nav, .app-foot, .panel-foot, .auth-brand { display: none !important; }
}
