/* ── Right column ────────────────────────────────────────────── */
.right-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

/* ── Results panel ───────────────────────────────────────────── */
.results-header {
  position: relative;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
/* gold hairline fading out along the header's bottom edge */
.results-header::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, rgba(238,198,127,.4), transparent 55%);
  pointer-events: none;
}
.results-header h2 { font-size: 16px; font-weight: 400; margin: 0; letter-spacing: .02em; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.actions button:hover:not(:disabled) {
  background: var(--gold);
  border-color: var(--gold);
  color: #050c18;
  font-weight: 600;
}

.empty-state {
  min-height: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  text-align: center;
  padding: 40px 24px;
  gap: 14px;
}
/* fanned stack of documents, the front one floating with a gold seal */
.empty-doc-stack {
  position: relative;
  width: 92px; height: 112px;
  margin-bottom: 8px;
}
.ed-doc {
  position: absolute; inset: 0;
  border-radius: 8px;
  background: linear-gradient(165deg, #101e33, #0b1624);
  border: 1px solid var(--line);
}
.ed-back { transform: rotate(-8deg) translate(-9px, 5px); opacity: .45; }
.ed-mid  { transform: rotate(5deg)  translate(8px, 2px);  opacity: .7; }
.ed-front {
  border-color: var(--gold-border);
  box-shadow: 0 12px 28px rgba(0,0,0,.5), 0 0 18px rgba(238,198,127,.06);
  animation: ed-float 4.4s ease-in-out infinite;
}
.ed-front::before {
  content: '';
  position: absolute; left: 14px; right: 14px; top: 16px; height: 48px;
  background: repeating-linear-gradient(
    to bottom,
    rgba(237,232,218,.2) 0 2px,
    transparent 2px 11px
  );
}
.ed-seal {
  position: absolute; right: 10px; bottom: 9px;
  color: var(--gold); font-size: 14px;
  text-shadow: 0 0 9px rgba(238,198,127,.55);
}
@keyframes ed-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
.empty-state h3 {
  margin: 0; font-size: 18px; font-weight: 400;
  font-family: var(--font-display);
  color: var(--ink-2); letter-spacing: .02em;
}
.empty-state p  { margin: 0; font-size: 13px; max-width: 280px; }
/* drifting script glyphs — the languages waiting to be translated */
.empty-scripts {
  display: flex; gap: 16px;
  font-family: var(--font-display); font-size: 15px;
  color: var(--gold);
  margin-top: 2px;
}
.empty-scripts span { animation: glyph-bob 3.8s ease-in-out infinite; }
.empty-scripts span:nth-child(2) { animation-delay: -.6s; }
.empty-scripts span:nth-child(3) { animation-delay: -1.2s; }
.empty-scripts span:nth-child(4) { animation-delay: -1.9s; }
.empty-scripts span:nth-child(5) { animation-delay: -2.5s; }
.empty-scripts span:nth-child(6) { animation-delay: -3.1s; }
@keyframes glyph-bob {
  0%, 100% { transform: translateY(0);    opacity: .4; }
  50%      { transform: translateY(-4px); opacity: .95; }
}
/* three-step mini guide */
.empty-steps {
  display: flex; gap: 12px; align-items: center; justify-content: center;
  flex-wrap: wrap;
  font-size: 12px; color: var(--muted);
  margin-top: 6px;
}
.empty-steps > span:not(.es-arrow) { display: inline-flex; align-items: center; }
.empty-steps em {
  font-style: normal; color: var(--gold);
  width: 19px; height: 19px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--gold-border); border-radius: 50%;
  background: var(--gold-light);
  font-size: 10px; font-weight: 600;
  margin-right: 7px;
}
.es-arrow { color: rgba(238,198,127,.35); }

/* ── Assessment panel ────────────────────────────────────────── */
.assessment-header {
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.assessment-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--ink);
  letter-spacing: .02em;
}
.assessment-title svg { color: var(--gold); flex-shrink: 0; }
.assessment-body { padding: 22px 28px; }
.assessment-body p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--ink-2);
}

/* ── Modal ───────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(5,12,24,.8);
  z-index: 200;
  align-items: center; justify-content: center;
  backdrop-filter: blur(6px);
}
.modal-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 36px 32px;
  max-width: 440px; width: 90%;
  box-shadow: var(--shadow-lg);
}
.login-logo-wrap { display: flex; flex-direction: column; align-items: center; margin-bottom: 20px; }
.login-logo { width: 240px; height: auto; }
.login-brand-tag { align-self: center; text-align: center; width: fit-content; }
.modal-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--gold-light);
  border: 1px solid var(--gold-border);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.modal-icon svg { width: 24px; height: 24px; color: var(--gold); }
.modal-box h2 { margin: 0 0 6px; font-size: 22px; font-weight: 400; color: var(--ink); letter-spacing: .02em; }
.modal-box p  { margin: 0 0 22px; font-size: 14px; color: var(--muted); line-height: 1.55; }
.modal-action { margin-top: 14px; }
.modal-error   { font-size: 13px; color: #ef4444; margin: 12px 0 0; display: none; font-weight: 600; }
.modal-success { font-size: 13px; color: var(--ok);  margin: 12px 0 0; display: none; font-weight: 500; }

/* ── Assessment modal ────────────────────────────────────────── */
.assess-box {
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}
.modal-close-btn {
  position: absolute;
  top: 14px; right: 16px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 7px;
  line-height: 1;
  border-radius: 4px;
  transition: color .15s, background .15s;
}
.modal-close-btn:hover:not(:disabled) {
  color: var(--ink);
  background: rgba(255,255,255,0.07);
}
.assess-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--ink);
  letter-spacing: .02em;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.assess-title svg { color: var(--gold); flex-shrink: 0; }
.assess-body {
  max-height: 26vh;
  overflow-y: auto;
  margin-bottom: 20px;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.12) transparent;
}
.assess-body::-webkit-scrollbar { width: 5px; }
.assess-body::-webkit-scrollbar-track { background: transparent; }
.assess-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 999px; }
.assess-body p {
  margin: 0;
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink-2);
}
.assess-ok {
  font-size: 13px;
  color: var(--ok);
  margin: 0 0 18px;
  font-weight: 500;
}

/* ── Cancel translation button ───────────────────────────────── */
.cancel-btn {
  width: 100%;
  justify-content: center;
  border-color: var(--bad-border);
  color: var(--bad);
  background: var(--bad-bg);
  margin-top: 4px;
}
.cancel-btn:hover:not(:disabled) {
  background: rgba(252,165,165,0.13);
  border-color: var(--bad);
  color: var(--bad);
}

/* ── Full-page processing overlay ────────────────────────── */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(5, 12, 24, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.page-loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  text-align: center;
  padding: 0 24px;
}
/* a floating document swept by a gold scan beam */
.loader-doc {
  position: relative;
  width: 64px; height: 84px;
  background: linear-gradient(165deg, #101e33, #0b1624);
  border: 1px solid var(--gold-border);
  border-radius: 7px;
  box-shadow: 0 12px 32px rgba(0,0,0,.55), 0 0 26px rgba(238,198,127,.08);
  animation: ld-float 3.4s ease-in-out infinite;
}
/* faint text lines on the page */
.loader-doc::before {
  content: '';
  position: absolute; left: 12px; right: 12px; top: 15px; bottom: 15px;
  background: repeating-linear-gradient(
    to bottom,
    rgba(237,232,218,.22) 0 2px,
    transparent 2px 11px
  );
}
/* the scan beam */
.loader-doc::after {
  content: '';
  position: absolute; left: 4px; right: 4px; top: 0; height: 26px;
  background: linear-gradient(to bottom, transparent, rgba(238,198,127,.32) 80%, rgba(249,236,210,.85) 100%);
  border-bottom: 2px solid var(--gold);
  border-radius: 1px;
  filter: drop-shadow(0 3px 9px rgba(238,198,127,.5));
  animation: ld-scan 2.1s cubic-bezier(.45,.05,.55,.95) infinite alternate;
}
@keyframes ld-scan {
  from { transform: translateY(2px); }
  to   { transform: translateY(54px); }
}
@keyframes ld-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
/* twinkling sparks around the document */
.ld-spark {
  position: absolute;
  color: var(--gold);
  text-shadow: 0 0 9px rgba(238,198,127,.7);
  animation: ld-twinkle 2.8s ease-in-out infinite;
  pointer-events: none;
}
.ld-spark.s1 { right: -17px; top: -11px;  font-size: 13px; }
.ld-spark.s2 { left:  -19px; top: 38%;    font-size: 9px;  animation-delay: -.9s; }
.ld-spark.s3 { right: -14px; bottom: -7px; font-size: 11px; animation-delay: -1.8s; }
@keyframes ld-twinkle {
  0%, 100% { opacity: .15; transform: scale(.7) rotate(0deg); }
  50%      { opacity: 1;   transform: scale(1.15) rotate(40deg); }
}
.loader-title {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.02em;
  /* slow gold shimmer sweeping through the text */
  color: var(--ink);
  background: linear-gradient(110deg, var(--ink) 38%, var(--gold) 50%, var(--ink) 62%);
  background-size: 230% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: ld-shimmer 2.8s linear infinite;
}
@keyframes ld-shimmer {
  from { background-position: 140% 0; }
  to   { background-position: -100% 0; }
}
.loader-sub {
  font-size: 13px;
  color: var(--muted);
  min-height: 18px;
  line-height: 1.5;
}

/* ── Toast notification ──────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel-2);
  border: 1px solid var(--ok-border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,.55);
  padding: 14px 18px;
  min-width: 260px;
  max-width: 360px;
  transform: translateY(20px);
  opacity: 0;
  transition: opacity .3s ease, transform .3s ease;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.toast-icon {
  flex-shrink: 0;
  width: 32px; height: 32px;
  background: var(--ok-bg);
  border: 1px solid var(--ok-border);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ok);
}
.toast-icon svg { width: 16px; height: 16px; }
.toast-body { flex: 1; min-width: 0; }
.toast-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
}
.toast-sub {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  font-size: 16px;
  line-height: 1;
  display: flex; align-items: center;
}
.toast-close:hover { color: var(--ink); }

/* ── Login modal overrides ───────────────────────────────────── */
.login-modal-box { max-width: 520px; max-height: 92vh; overflow-y: auto; }

/* Login step tabs */
.login-tabs        { display:flex; gap:4px; margin-bottom:16px; }
.login-tab         { flex:1; padding:7px; border:1px solid var(--line); border-radius:var(--radius-sm);
                     background:transparent; color:var(--muted); font-size:12px; font-weight:500;
                     cursor:pointer; transition:all .15s; font-family:inherit; }
.login-tab.active  { background:var(--gold-light); border-color:var(--gold-border); color:var(--gold); font-weight:600; }
.login-tab:hover:not(.active) { color:var(--ink); background:rgba(255,255,255,0.04); }

/* OTP channel buttons */
.channel-row           { display:flex; gap:6px; margin:10px 0; }
.channel-btn           { flex:1; padding:6px 10px; border:1px solid var(--line); border-radius:var(--radius-sm);
                         background:transparent; color:var(--muted); font-size:12px; font-weight:500;
                         cursor:pointer; transition:all .15s; font-family:inherit; }
.channel-btn.active    { border-color:var(--gold-border); color:var(--gold); background:var(--gold-light); }
.channel-btn:hover:not(.active) { color:var(--ink); background:rgba(255,255,255,0.04); }

/* Email hint / "change email" link */
.login-email-hint  { font-size:12px; color:var(--muted); margin:0 0 14px; line-height:1.5; }
.link-muted        { color:var(--muted); text-decoration:underline; }
.link-muted:hover  { color:var(--ink); }

/* ── Registration / profile form grids ──────────────────────── */
.reg-row-2 { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:0; align-items:start; }
.reg-row-3 { display:grid; grid-template-columns:1fr 1.3fr 0.9fr; gap:10px; margin-bottom:0; align-items:start; }
/* Override the adjacent-sibling margin rule which outranks .reg-row-* .field */
.modal-box .reg-row-2 .field,
.modal-box .reg-row-3 .field { margin-top:0; }
.modal-box .reg-row-2 + .field,
.modal-box .reg-row-3 + .field,
.modal-box .field + .reg-row-2,
.modal-box .field + .reg-row-3,
.modal-box .reg-row-2 + .reg-row-2,
.modal-box .reg-row-2 + .reg-row-3,
.modal-box .reg-row-3 + .reg-row-2 { margin-top:14px; }
.field-opt { font-weight:400; color:var(--muted); font-size:10px; }

/* Profile modal wider box */
.profile-modal-box { max-width:600px; max-height:92vh; overflow-y:auto; }
.modal-divider     { border:none; border-top:1px solid var(--line); margin:24px 0 16px; }
.modal-section-title { font-size:14px; font-weight:600; color:var(--ink-2); margin:0 0 14px; letter-spacing:.02em; }
