/* ============================================================
   ScaleUP — sign in / sign up
   A calm front door. Scaley waves once when it loads.
   ============================================================ */

.auth {
  position: fixed; inset: 0; z-index: 200;
  display: grid; grid-template-columns: 1fr;
  background: var(--page);
  overflow-y: auto;
}
@media (min-width: 940px) { .auth { grid-template-columns: 1fr 1fr; } }

/* ---- left: the form ---- */
.auth-form-side {
  display: grid; place-items: center;
  padding: var(--s-8) var(--s-6);
}
.auth-box { width: 100%; max-width: 372px; animation: cardIn var(--dur-4) var(--ease) both; }

.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: var(--s-10); }

.auth-box h1 { font-size: 1.75rem; letter-spacing: -0.035em; margin-bottom: 7px; }
.auth-box > p { font-size: var(--t-body); color: var(--text-3); margin-bottom: var(--s-6); line-height: 1.55; }

.auth-fields { display: flex; flex-direction: column; gap: var(--s-4); }
.auth-fields .btn { margin-top: var(--s-2); }

.auth-msg {
  display: flex; gap: 9px; align-items: flex-start;
  margin-top: var(--s-4); padding: 11px 13px;
  border-radius: var(--r-sm);
  font-size: var(--t-xs); line-height: 1.55;
  animation: cardIn var(--dur-2) var(--ease) both;
}
.auth-msg svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px; }
.auth-msg.bad  { background: var(--critical-soft); color: var(--critical); }
.auth-msg.good { background: var(--good-soft); color: var(--delta-up); }
.auth-msg.info { background: var(--warning-soft); color: #8A6100; }

/* ---- password field with a reveal control ---- */
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 44px; }
[dir="rtl"] .pw-wrap .input { padding-right: 13px; padding-left: 44px; }

.pw-reveal {
  position: absolute; top: 50%; right: 6px;
  transform: translateY(-50%);
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: var(--r-xs);
  color: var(--text-3);
  transition: color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
[dir="rtl"] .pw-reveal { right: auto; left: 6px; }
.pw-reveal svg { width: 16px; height: 16px; }
.pw-reveal:hover { color: var(--text); background: var(--surface-2); }

/* ---- label row that carries "Forgot password?" ---- */
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); }
.label-row .link-btn {
  font-size: var(--t-xs); font-weight: 550; color: var(--accent);
  transition: opacity var(--dur-1) var(--ease);
}
.label-row .link-btn:hover { text-decoration: underline; }

/* ---- an action offered inside a message (resend, etc.) ---- */
.auth-msg .msg-action {
  margin-top: 9px;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--t-xs); font-weight: 650;
  padding: 6px 11px; border-radius: var(--r-xs);
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line-strong);
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
.auth-msg .msg-action:hover { background: var(--surface-2); border-color: var(--text-3); }
.auth-msg .msg-action svg { width: 13px; height: 13px; }
.auth-msg .msg-action:disabled { opacity: 0.5; pointer-events: none; }
.auth-msg .msg-body { display: flex; flex-direction: column; align-items: flex-start; }

.auth-alt { margin-top: var(--s-6); font-size: var(--t-sm); color: var(--text-3); text-align: center; }
.auth-alt button { font-weight: 600; color: var(--accent); }
.auth-alt button:hover { text-decoration: underline; }

.auth-foot {
  margin-top: var(--s-8); padding-top: var(--s-5);
  border-top: 1px solid var(--line);
  text-align: center;
}
.auth-foot button { font-size: var(--t-xs); color: var(--text-3); }
.auth-foot button:hover { color: var(--text-2); text-decoration: underline; }

/* ---- right: the pitch ---- */
.auth-art-side {
  display: none;
  position: relative;
  padding: var(--s-12);
  background:
    radial-gradient(120% 90% at 78% 12%, var(--accent-soft) 0%, transparent 62%),
    var(--surface-2);
  border-left: 1px solid var(--line);
  overflow: hidden;
}
@media (min-width: 940px) { .auth-art-side { display: grid; align-content: center; } }

/* Scaley is the brand character here, not decoration — give him presence.
   Capped in vh so he never crowds the copy on a short window. */
.auth-art-side .scaley {
  width: clamp(150px, 15vw, 196px);
  max-height: 30vh;
  margin-bottom: var(--s-8);
}
.auth-art-side blockquote {
  font-size: 1.5rem; font-weight: 550; letter-spacing: -0.03em;
  line-height: 1.32; max-width: 15ch; margin-bottom: var(--s-4);
}
.auth-art-side cite { font-style: normal; font-size: var(--t-sm); color: var(--text-3); }

.auth-points { margin-top: var(--s-10); display: flex; flex-direction: column; gap: var(--s-4); }
.auth-point { display: flex; gap: 11px; align-items: flex-start; animation: cardIn var(--dur-4) var(--ease) both; animation-delay: calc(var(--i) * 90ms + 200ms); }
.auth-point .ap-ico { width: 26px; height: 26px; flex-shrink: 0; display: grid; place-items: center; border-radius: var(--r-xs); background: var(--surface); color: var(--accent); box-shadow: var(--shadow-xs); }
.auth-point .ap-ico svg { width: 14px; height: 14px; }
.auth-point b { display: block; font-size: var(--t-sm); font-weight: 600; }
.auth-point span { font-size: var(--t-xs); color: var(--text-3); line-height: 1.5; }

/* Setup warning shown when the backend keys are missing. */
.auth-setup {
  margin-bottom: var(--s-5); padding: 13px 15px;
  border-radius: var(--r-md);
  background: var(--warning-soft);
  border: 1px solid rgba(250, 178, 25, 0.3);
  font-size: var(--t-xs); line-height: 1.6; color: #7A5B12;
}
:root[data-theme="dark"] .auth-setup { color: var(--warning); }
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) .auth-setup { color: var(--warning); }
}
.auth-setup b { display: block; margin-bottom: 3px; }
.auth-setup code {
  font-family: var(--mono); font-size: 0.92em;
  background: rgba(0, 0, 0, 0.06); padding: 1px 5px; border-radius: 4px;
}
