/* ═══════════════════════════════════════════════════════════════
   SCRIPTORIUM — AUTH PAGES CSS (auth.css)
   Used by: login.ejs, signup.ejs
   v2 — Fixed: cursor, eye toggle, message UI, removed auth-nav dep.
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. TOKENS ───────────────────────────────────────────────── */
:root {
  --cream:      #faf7f2;
  --cream-2:    #f2ece2;
  --cream-3:    #e4dbd0;
  --ink:        #1c1814;
  --ink-2:      #3a3228;
  --ink-3:      #7a6e62;
  --ink-4:      #b0a494;

  --teal:       #3d8c80;
  --teal-l:     #c2e0db;
  --teal-p:     #eaf5f3;
  --amber:      #bf7a30;
  --amber-p:    #fdf3e4;
  --lavender:   #7a68c0;
  --lavender-p: #f0eefa;
  --rose:       #c05868;
  --rose-p:     #fdf0f2;

  --font-clash:  'Clash Display', 'Helvetica Neue', Arial, sans-serif;
  --font-caveat: 'Caveat', cursive;
  --font-body:   'DM Sans', system-ui, sans-serif;

  --expo:   cubic-bezier(0.16, 1, 0.3, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --sh-card:  0 2px 4px rgba(28,24,20,0.06), 0 8px 24px rgba(28,24,20,0.07);
  --sh-hover: 0 4px 8px rgba(28,24,20,0.10), 0 20px 56px rgba(28,24,20,0.12);
}

/* ── 2. RESET & BASE ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

body.auth-body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  min-height: 100svh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; background: none; border: none; font: inherit; }
input { font: inherit; }

/* ── 3. GRAIN OVERLAY ────────────────────────────────────────── */
.grain {
  position: fixed;
  inset: -60%;
  width: 220%; height: 220%;
  z-index: 1000;
  pointer-events: none;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 7s steps(8) infinite;
}
@keyframes grain {
  0%,100%{transform:translate(0,0)}
  12%{transform:translate(-2%,-2%)}
  25%{transform:translate(2%,-1%)}
  37%{transform:translate(-1%,2%)}
  50%{transform:translate(1%,-2%)}
  62%{transform:translate(-2%,1%)}
  75%{transform:translate(2%,2%)}
  87%{transform:translate(-1%,-1%)}
}

/* ── 4. CURSOR ─────────────────────────────────────────────────

  FIX: Cursor element at top:0 left:0. JS moves it via translate3d(x,y,0).
  pointer-events:none ensures it never blocks input or the design panel.
  We do NOT set transform here — JS owns it entirely.
  cursor:none on the body hides the OS cursor everywhere, including panels.

@media (hover: hover) and (pointer: fine) {
  body.auth-body { cursor: none; }

   Also hide cursor on anything that would normally show a special cursor 
  body.auth-body * { cursor: none !important; }

  .cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--ink);
    pointer-events: none;
    z-index: 99999;
     transform is set exclusively by JS via translate3d 
    transition:
      width  0.28s var(--spring),
      height 0.28s var(--spring),
      background 0.22s,
      opacity 0.18s;
    mix-blend-mode: multiply;
    will-change: transform;
  }

  .cursor.hov {
    width: 44px;
    height: 44px;
    background: var(--teal);
    opacity: 0.22;
  }

  .cursor.clicking {
    width: 8px;
    height: 8px;
    opacity: 0.9;
  }
} */

/* ── 5. BACK BUTTON ──────────────────────────────────────────── */
.auth-back {
  position: fixed;
  top: 1.5rem;
  left: clamp(1.5rem, 4vw, 3rem);
  z-index: 800;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--ink);
  transition: color 0.2s;
}

.auth-back-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid var(--cream-3);
  box-shadow: 0 2px 8px rgba(28,24,20,0.08);
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.3s var(--spring);
  flex-shrink: 0;
}

.auth-back-arrow svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s var(--spring);
}

.auth-back-label {
  display: flex;
  flex-direction: column;
  line-height: 1;
  gap: 2px;
}

.auth-back-label-text {
  font-family: var(--font-clash);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  transition: color 0.2s;
}

.auth-back-squiggle {
  width: 0;
  height: 5px;
  overflow: visible;
  transition: width 0.35s var(--expo);
}

.auth-back-squiggle path { stroke: var(--teal); }

.auth-back:hover .auth-back-arrow {
  border-color: var(--teal-l);
  box-shadow: 0 4px 16px rgba(61,140,128,0.18);
  transform: scale(1.08);
}
.auth-back:hover .auth-back-arrow svg { transform: translateX(-3px); }
.auth-back:hover .auth-back-label-text { color: var(--teal); }
.auth-back:hover .auth-back-squiggle { width: 60px; }

/* ── 6. PAGE LAYOUT ──────────────────────────────────────────── */
.auth-page {
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

/* ── 7. LEFT PANEL — illustrated/decorative ──────────────────── */
.auth-panel-left {
  position: relative;
  background: linear-gradient(155deg, #dde8e4 0%, #b8d0ca 45%, #98bfb6 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5rem 3rem;
  overflow: hidden;
  min-height: 100svh;
}

.auth-panel-left--login {
  background: linear-gradient(155deg, #e4ddf5 0%, #c4b8ec 45%, #a898de 100%);
}

.auth-panel-noise {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.auth-bleed-word {
  position: absolute;
  font-family: var(--font-clash);
  font-size: clamp(5rem, 14vw, 16rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  color: transparent;
  -webkit-text-stroke: 2px rgba(255,255,255,0.22);
  text-stroke: 2px rgba(255,255,255,0.22);
  user-select: none;
  pointer-events: none;
  line-height: 0.9;
  bottom: -1.5rem;
  left: -0.5rem;
  white-space: nowrap;
}

.auth-floater {
  position: absolute;
  pointer-events: none;
  filter: drop-shadow(0 8px 24px rgba(28,24,20,0.12));
}

.auth-floater--books     { width: 120px; top: 8%;    right: 10%; animation: afloat-a 8s  ease-in-out infinite; }
.auth-floater--note      { width: 80px;  bottom: 20%; left: 8%;  animation: afloat-b 11s ease-in-out infinite 1.5s; }
.auth-floater--star      { width: 48px;  top: 25%;   left: 10%;  animation: aspin 18s   linear infinite; }
.auth-floater--star2     { width: 32px;  bottom: 32%; right: 8%; animation: aspin 12s   linear infinite reverse; }
.auth-floater--arc       { width: 150px; top: 58%;   right: 4%;  animation: afloat-c 13s ease-in-out infinite 0.5s; }
.auth-floater--headphones{ width: 88px;  top: 10%;   left: 10%;  animation: afloat-b 9s  ease-in-out infinite; }
.auth-floater--reel      { width: 72px;  bottom: 18%; right: 8%; animation: afloat-a 10s ease-in-out infinite 1s; }

@keyframes afloat-a { 0%,100%{transform:translateY(0) rotate(0deg)}   50%{transform:translateY(-18px) rotate(3deg)} }
@keyframes afloat-b { 0%,100%{transform:translateY(0) rotate(0deg)}   50%{transform:translateY(-14px) rotate(-2.5deg)} }
@keyframes afloat-c { 0%,100%{transform:translateY(0)}                 40%{transform:translateY(-10px)} 80%{transform:translateY(6px)} }
@keyframes aspin    { from{transform:rotate(0deg)} to{transform:rotate(360deg)} }

.auth-panel-tagline {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 320px;
}

.auth-panel-eyebrow {
  font-family: var(--font-clash);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(28,24,20,0.45);
  margin-bottom: 0.9rem;
}

.auth-panel-tagline h2 {
  font-family: var(--font-clash);
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--ink);
  margin-bottom: 0.75rem;
}

.auth-panel-tagline h2 .caveat-word {
  font-family: var(--font-caveat);
  font-size: 1.25em;
  font-weight: 700;
  color: var(--teal);
  display: inline-block;
  transform: rotate(-2deg);
  transform-origin: left center;
}

.auth-panel-left--login .auth-panel-tagline h2 .caveat-word { color: var(--lavender); }

.auth-panel-tagline p {
  font-size: 0.88rem;
  color: var(--ink-3);
  line-height: 1.65;
}

.auth-preview-cards {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 2rem;
  width: 100%;
  max-width: 288px;
}

.auth-preview-card {
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(255,255,255,0.6);
  border-radius: 14px;
  padding: 0.8rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  box-shadow: 0 2px 12px rgba(28,24,20,0.07);
  transition: transform 0.3s var(--spring);
}
.auth-preview-card:hover { transform: translateX(5px); }

.apc-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.apc-dot--teal     { background: var(--teal); }
.apc-dot--amber    { background: var(--amber); }
.apc-dot--lavender { background: var(--lavender); }

.apc-text { flex: 1; min-width: 0; }
.apc-text strong { display: block; font-size: 0.8rem; font-weight: 600; color: var(--ink); margin-bottom: 0.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.apc-text span   { font-size: 0.7rem; color: var(--ink-3); }

.apc-badge {
  font-family: var(--font-clash);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-4);
  flex-shrink: 0;
}

/* ── 8. RIGHT PANEL — form ───────────────────────────────────── */
.auth-panel-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5rem clamp(2rem, 6vw, 5rem);
  background: var(--cream);
  min-height: 100svh;
}

.auth-form-wrap { width: 100%; max-width: 400px; }

.auth-heading { margin-bottom: 2rem; }

.auth-eyebrow {
  font-family: var(--font-clash);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}
.auth-eyebrow::before {
  content: '';
  display: block;
  width: 18px; height: 1.5px;
  background: var(--teal);
  border-radius: 2px;
}

.auth-heading h1 {
  font-family: var(--font-clash);
  font-size: clamp(1.9rem, 3.8vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.auth-heading h1 .caveat-word {
  font-family: var(--font-caveat);
  font-size: 1.2em;
  font-weight: 700;
  color: var(--teal);
  display: inline-block;
  transform: rotate(-1.5deg);
  transform-origin: left;
}

.auth-heading-sub {
  font-size: 0.88rem;
  color: var(--ink-3);
  line-height: 1.6;
}
.auth-heading-sub a {
  color: var(--teal);
  font-weight: 500;
  border-bottom: 1.5px solid var(--teal-l);
  transition: border-color 0.2s;
}
.auth-heading-sub a:hover { border-color: var(--teal); }

/* ── FORM FIELDS ─────────────────────────────────────────────── */
.auth-form { display: flex; flex-direction: column; gap: 1.1rem; }
.auth-field { display: flex; flex-direction: column; gap: 0.4rem; }

.auth-label {
  font-family: var(--font-clash);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.auth-input-wrap { position: relative; }

.auth-input {
  width: 100%;
  height: 50px;
  padding: 0 1.2rem;
  background: #fff;
  border: 1.5px solid var(--cream-3);
  border-radius: 100px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.22s, box-shadow 0.22s;
  -webkit-appearance: none;
  appearance: none;
}
.auth-input::placeholder { color: var(--ink-4); }
.auth-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(61,140,128,0.13);
}

/* Extra right padding for inputs that have the eye toggle */
.auth-input-wrap .auth-input { padding-right: 3.2rem; }

/* ── EYE TOGGLE BUTTON — FIX ─────────────────────────────────── */
/*
  The button is empty in EJS. We render the SVG eye icon via CSS
  using background-image so it always shows regardless of JS state.
  JS swaps between two data attributes: [data-visible="false"] (eye)
  and [data-visible="true"] (eye-off). We use those to swap the icon.
*/
.auth-toggle-btn {
  position: absolute;
  right: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--ink-4);
  transition: color 0.2s, background 0.2s;
  padding: 0;
  flex-shrink: 0;
  /* Default: show eye icon (password hidden) */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23b0a494' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
}
.auth-toggle-btn:hover {
  color: var(--ink-2);
  background-color: var(--cream-2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%233a3228' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
}

/* When password is visible (text): show eye-off / strikethrough icon */
.auth-toggle-btn[data-visible="true"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23b0a494' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24'/%3E%3Cline x1='1' y1='1' x2='23' y2='23'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
}
.auth-toggle-btn[data-visible="true"]:hover {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%233a3228' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24'/%3E%3Cline x1='1' y1='1' x2='23' y2='23'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
  background-color: var(--cream-2);
}

/* ── FORGOT LINK ─────────────────────────────────────────────── */
.auth-forgot {
  font-size: 0.78rem;
  color: var(--teal);
  align-self: flex-end;
  margin-top: -0.5rem;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.auth-forgot:hover { border-color: var(--teal); }

/* ── FEEDBACK MESSAGES — Creative redesign ───────────────────── */
/*
  Both login.js and signup.js use className strings to show/hide messages.
  login.js  → creates a div#loginMessage and uses raw className assignment
  signup.js → uses div#formMessage with className assignment

  We target BOTH IDs and support the exact class strings the JS sets.
  The JS sets className to a long Tailwind-like string; we need to detect
  the presence of specific classes. Since we can't rely on Tailwind being
  loaded, we target via attribute substring selectors as a robust fallback,
  AND provide our own class-based system.

  login.js sets className to strings containing "bg-red-500/10" (error)
  or "bg-green-500/10" (success). We detect those via [class*=].

  signup.js sets className to similar strings.

  Additionally we support .hidden to hide elements when JS adds that class.
*/

/* Base shared style for both message containers */
#loginMessage,
#formMessage {
  display: none;
  padding: 0.85rem 1.1rem 0.85rem 1rem;
  border-radius: 16px;
  font-size: 0.84rem;
  line-height: 1.5;
  border: 1.5px solid transparent;
  position: relative;
  overflow: hidden;
}

/* Icon bar accent — left edge */
#loginMessage::before,
#formMessage::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  border-radius: 4px 0 0 4px;
}

/* Error state — detected by the class string JS sets */
#loginMessage[class*="bg-red"],
#formMessage[class*="bg-red"] {
  display: flex !important;
  align-items: flex-start;
  gap: 0.6rem;
  background: var(--rose-p) !important;
  border-color: rgba(192,88,104,0.35) !important;
  color: var(--rose) !important;
  animation: msg-in 0.3s var(--expo) both;
}
#loginMessage[class*="bg-red"]::before,
#formMessage[class*="bg-red"]::before {
  background: var(--rose);
}

/* Success state */
#loginMessage[class*="bg-green"],
#formMessage[class*="bg-green"] {
  display: flex !important;
  align-items: flex-start;
  gap: 0.6rem;
  background: var(--teal-p) !important;
  border-color: rgba(61,140,128,0.35) !important;
  color: var(--teal) !important;
  animation: msg-in 0.3s var(--expo) both;
}
#loginMessage[class*="bg-green"]::before,
#formMessage[class*="bg-green"]::before {
  background: var(--teal);
}

/* HIDDEN — JS adds this class to hide the element */
#loginMessage.hidden,
#formMessage.hidden {
  display: none !important;
}

/* Message entrance animation */
@keyframes msg-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── SUBMIT BUTTON ───────────────────────────────────────────── */
#submitBtn {
  width: 100%;
  height: 52px;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-clash);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  transition: background 0.22s, transform 0.25s var(--spring), box-shadow 0.25s;
  margin-top: 0.3rem;
  position: relative;
  overflow: hidden;
}

/* Shimmer sweep on hover */
#submitBtn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,0.08) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}
#submitBtn:hover::after { transform: translateX(100%); }

#submitBtn svg { width: 16px; height: 16px; transition: transform 0.2s var(--spring); }
#submitBtn:hover { background: var(--teal); transform: translateY(-2px); box-shadow: 0 8px 28px rgba(61,140,128,0.3); }
#submitBtn:hover svg { transform: translateX(4px); }
#submitBtn:disabled { opacity: 0.55; pointer-events: none; }

/* Loading state pulse */
#submitBtn:disabled {
  animation: btn-pulse 1.4s ease-in-out infinite;
}
@keyframes btn-pulse {
  0%,100% { opacity: 0.55; }
  50%      { opacity: 0.38; }
}

/* ── DIVIDER ─────────────────────────────────────────────────── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-family: var(--font-clash);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin: 0.4rem 0;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--cream-3);
}

/* ── SOCIAL BUTTONS ──────────────────────────────────────────── */
.auth-socials { display: flex; flex-direction: column; gap: 0.65rem; }

.auth-social-btn {
  width: 100%;
  height: 50px;
  background: #fff;
  border: 1.5px solid var(--cream-3);
  border-radius: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  font-family: var(--font-clash);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--ink-2);
  transition: border-color 0.22s, box-shadow 0.22s, transform 0.25s var(--spring);
}
.auth-social-btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.auth-social-btn:hover {
  border-color: var(--cream-3);
  box-shadow: var(--sh-hover);
  transform: translateY(-2px);
}

/* ── 9. RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 860px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-panel-left { display: none; }
  .auth-panel-right {
    padding: 5rem 1.5rem 3rem;
    min-height: 100svh;
    align-items: flex-start;
    padding-top: 5rem;
  }
  .auth-page--login .auth-panel-right { order: -1; }
}

/* ── 10. REDUCED MOTION ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .auth-floater { animation: none !important; }
}

/* ── 11. LOGIN — form left, panel right ──────────────────────── */
.auth-page--login .auth-panel-right { order: 1; }
.auth-page--login .auth-panel-left  { order: 2; }
/* ══════════════════════════════════════════════════════════════
   FORGOT PASSWORD & RESET PASSWORD — additions to auth.css
   Panel variants: forgot = warm amber, reset = teal-green
   ══════════════════════════════════════════════════════════════ */

/* ── Forgot password panel — warm amber/rose gradient ────────── */
.auth-panel-left--forgot {
  background: linear-gradient(155deg, #f5ede0 0%, #e8c8a0 45%, #d4a878 100%);
}
.auth-panel-left--forgot .auth-panel-tagline h2 .caveat-word {
  color: var(--amber);
}

/* ── Reset password panel — deep teal gradient ───────────────── */
.auth-panel-left--reset {
  background: linear-gradient(155deg, #d8eee8 0%, #a8d4c8 45%, #78b8a8 100%);
}
.auth-panel-left--reset .auth-panel-tagline h2 .caveat-word {
  color: var(--teal);
}

/* ── Decorative emoji floater ────────────────────────────────── */
/*
  Big illustrated emoji sits centre-stage on the panel.
  Floats independently, separate from the small SVG floaters.
*/
.auth-emoji-hero {
  position: relative;
  z-index: 1;
  font-size: clamp(5rem, 10vw, 8rem);
  line-height: 1;
  margin-bottom: 1.5rem;
  display: block;
  text-align: center;
  animation: emoji-bob 3.5s ease-in-out infinite;
  filter: drop-shadow(0 12px 32px rgba(28,24,20,0.15));
  user-select: none;
}
@keyframes emoji-bob {
  0%,100% { transform: translateY(0) rotate(0deg);   }
  30%      { transform: translateY(-14px) rotate(-4deg); }
  60%      { transform: translateY(-6px)  rotate(2deg);  }
}

/* Forgot page: emoji has a little shake on load */
.auth-emoji-hero--forgot {
  animation: emoji-bob 3.5s ease-in-out infinite,
             emoji-shake 0.7s cubic-bezier(0.36,0.07,0.19,0.97) 0.4s 1;
}
@keyframes emoji-shake {
  0%,100% { transform: rotate(0deg); }
  15%     { transform: rotate(-8deg); }
  30%     { transform: rotate(8deg); }
  45%     { transform: rotate(-6deg); }
  60%     { transform: rotate(6deg); }
  75%     { transform: rotate(-3deg); }
  90%     { transform: rotate(3deg); }
}

/* Reset page: emoji bounces in triumphantly */
.auth-emoji-hero--reset {
  animation: emoji-bob 3.5s ease-in-out infinite,
             emoji-bounce-in 0.7s cubic-bezier(0.34,1.56,0.64,1) 0.4s 1 both;
}
@keyframes emoji-bounce-in {
  from { transform: scale(0.4) translateY(24px); opacity: 0; }
  to   { transform: scale(1)   translateY(0);    opacity: 1; }
}

/* ── Message box — styled consistently (overrides Tailwind classes) ── */
/*
  Backend JS sets message.className = "mt-4 text-center text-green-300 font-medium"
  or "mt-4 text-center text-red-300 font-medium" — we hook into those.
  The #message element is also styled below for when it's visible.
*/
#message {
  padding: 0.8rem 1rem;
  border-radius: 14px;
  font-family: var(--font-body);
  font-size: 0.86rem;
  line-height: 1.55;
  border: 1.5px solid transparent;
  margin-top: 0.75rem;
  transition: all 0.25s;
}
#message.hidden { display: none !important; }

/* Green success state */
#message.text-green-300 {
  background: var(--teal-p);
  border-color: var(--teal);
  color: var(--teal) !important;
}
/* Red error state */
#message.text-red-300 {
  background: var(--rose-p);
  border-color: var(--rose);
  color: var(--rose) !important;
}

/* ── Submit button loading state ─────────────────────────────── */
#submitBtn:disabled,
button[type="submit"]:disabled {
  opacity: 0.55;
  pointer-events: none;
}

/* ── "Back to login" link — styled to match auth design ──────── */
.auth-back-to-login {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-clash);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 1.4rem;
  text-decoration: none;
  border-bottom: 1.5px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.auth-back-to-login:hover {
  color: var(--teal);
  border-color: var(--teal-l);
}

/* ── Success state — full panel replacement after submission ──── */
/*
  Optional progressive enhancement: JS can add .is-success to
  .auth-form-wrap to show a big success message instead of the form.
  Not required for backend to work — purely additive.
*/
.auth-success-state {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
  padding: 2rem 0;
}
.auth-success-state.visible { display: flex; }
.auth-success-emoji {
  font-size: 4rem;
  animation: emoji-bounce-in 0.6s var(--spring) both;
}
.auth-success-state h2 {
  font-family: var(--font-clash);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.auth-success-state p {
  font-size: 0.9rem;
  color: var(--ink-3);
  max-width: 280px;
  line-height: 1.65;
}