/* ─────────────────────────────────────────────────────────────────
 * /css/login-v2.css — /login/ + /login/verify.php (Phase 11, brand v2)
 * Design: "The Door to the Apothecary" — candle + sealed envelope motifs
 * Date: 2026-05-17
 *
 * Loads AFTER birth-chart-v2.css. Body class `ca-page login-page` so we
 * inherit all the polished .ca-page hero + .ca-wrap + .welcome-panel
 * styles. This file only adds the login-specific decorations:
 *   - .lg-hero-band  (custom medallions: candle + sealed envelope)
 *   - .lg-form-frame (form-frame variant tightened for a single-field form)
 *   - .lg-sealed     (sealed-letter variants for sent / patience / expired)
 *   - .lg-orn        (atmospheric floating ornaments, like /tarot/)
 *   - .lg-celestial  (the night-sky disc illustrations)
 * ───────────────────────────────────────────────────────────────── */

/* ─── ATMOSPHERIC ORNAMENTS (floating ✦ ❋ ⋆ marks on the parchment) ─── */
.login-page .lg-orn-field {
  position: absolute; inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.login-page .lg-orn {
  position: absolute;
  font-family: 'Cinzel Decorative', serif;
  color: var(--gold);
  opacity: 0.45;
  animation: lgOrnFloat 7s ease-in-out infinite;
  text-shadow: 0 0 8px rgba(212, 172, 104, 0.35);
}
@keyframes lgOrnFloat {
  0%, 100% { transform: translateY(0)    rotate(0deg);   opacity: 0.45; }
  50%      { transform: translateY(-5px) rotate(8deg);   opacity: 0.7;  }
}
@media (prefers-reduced-motion: reduce) {
  .login-page .lg-orn { animation: none; }
}

.login-page .ca-wrap { position: relative; z-index: 1; }

/* ─── HERO LAYOUT — mirror /tarot/ exactly.
   /tarot/'s yes-no-tarot.css uses padding:2rem on page-hero + back-link
   top:1.5rem. The 0.5rem offset is what makes the smaller back-link
   text visually share a row with the larger dept tag (different font
   sizes → different visual centers).
   Override .ca-page's padding:0 (birth-chart-v2.css line 2338) which
   was flushing ACCOUNT against the top edge while back-link sat 1.5rem
   below it — that was the misalignment. */
.login-page .ca-wrap {
  max-width: 920px !important;
  padding-top: 0 !important;          /* kill .ca-page's 2.6rem top padding — matches /tarot/'s zero-wrap layout */
  padding-left: 2rem !important;
  padding-right: 2rem !important;
}
.login-page .page-hero { padding: 2rem 2rem 2.5rem !important; }
.login-page .page-hero-back { top: 1.5rem !important; }
@media (max-width: 640px) {
  .login-page .ca-wrap { padding-left: 1rem !important; padding-right: 1rem !important; }
  .login-page .page-hero-back { position: static !important; display: inline-flex; margin: 0 auto 1.5rem; }
  .login-page .page-hero { padding: 0.5rem 0 2rem !important; }
}

/* ─── HERO BAND ─── */
.login-page .lg-hero-band {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.6rem;
  margin: 1.4rem auto 0;
  max-width: 620px;
}
.login-page .lg-subtitle {
  text-align: center;
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: clamp(1.05rem, 1.7vw, 1.18rem);
  line-height: 1.55;
  color: var(--ink-soft, #4A3B52);
  max-width: 360px;
  margin: 0 auto;
}
.login-page .lg-subtitle em {
  color: var(--burgundy);
  font-weight: 600;
  font-style: italic;
}
.login-page .lg-medallion {
  width: 96px; height: 96px;
  flex-shrink: 0;
  position: relative;
}
.login-page .lg-medallion svg { width: 100%; height: 100%; display: block; }

/* Flame animation — gentle flicker */
@keyframes lgFlameFlicker {
  0%, 100% { transform: scaleY(1)    translateY(0);   filter: brightness(1);   }
  25%      { transform: scaleY(1.06) translateY(-0.4px); filter: brightness(1.08); }
  50%      { transform: scaleY(0.96) translateY(0.3px);  filter: brightness(0.95); }
  75%      { transform: scaleY(1.03) translateY(-0.2px); filter: brightness(1.05); }
}
.login-page .lg-flame {
  transform-origin: 32px 28px;
  animation: lgFlameFlicker 2.4s ease-in-out infinite;
}
.login-page .lg-flame-inner { animation-duration: 1.8s; animation-delay: -0.3s; }
.login-page .lg-flame-halo  {
  animation: lgFlameHalo 3s ease-in-out infinite;
  transform-origin: 32px 20px;
}
@keyframes lgFlameHalo {
  0%, 100% { opacity: 0.85; transform: scale(1);    }
  50%      { opacity: 1;    transform: scale(1.08); }
}

/* Ember rise — three particles drifting up from the sealed envelope */
@keyframes lgEmberRise {
  0%   { opacity: 0; transform: translate(0,    0); }
  20%  { opacity: 1; }
  100% { opacity: 0; transform: translate(2px, -6px); }
}
.login-page .lg-ember        { animation: lgEmberRise 2.6s ease-out infinite; }
.login-page .lg-ember-2      { animation-delay: -0.9s; }
.login-page .lg-ember-3      { animation-delay: -1.8s; }

/* Wax-seal subtle pulse */
@keyframes lgWaxPulse {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(107, 31, 44, 0)); }
  50%      { filter: drop-shadow(0 0 4px rgba(107, 31, 44, 0.45)); }
}
.login-page .lg-wax { animation: lgWaxPulse 3.2s ease-in-out infinite; }

/* Twinkles (shared with .tw class on celestial illustrations) */
@keyframes lgTwinkle {
  0%, 100% { opacity: 1;    }
  50%      { opacity: 0.25; }
}
.login-page .lg-twink { animation: lgTwinkle 2.6s ease-in-out infinite; }
.login-page .lg-twink-1 { animation-delay: 0s;   animation-duration: 2.4s; }
.login-page .lg-twink-2 { animation-delay: 0.7s; animation-duration: 3.2s; }
.login-page .lg-twink-3 { animation-delay: 1.4s; animation-duration: 2.8s; }
.login-page .lg-twink-4 { animation-delay: 0.3s; animation-duration: 3.6s; }

@media (prefers-reduced-motion: reduce) {
  .login-page .lg-flame,
  .login-page .lg-flame-halo,
  .login-page .lg-ember,
  .login-page .lg-wax,
  .login-page .lg-twink { animation: none; }
}

/* Mobile — stack medallions ABOVE the subtitle */
@media (max-width: 640px) {
  .login-page .lg-hero-band {
    grid-template-columns: 1fr;
    gap: 0.9rem;
    text-align: center;
  }
  .login-page .lg-medallion {
    width: 76px; height: 76px;
    margin: 0 auto;
  }
  /* Reorder: candle, envelope, then subtitle below them — keeps the
     paired-medallions visual together on a narrow viewport */
  .login-page .lg-medallion-candle  { order: 1; }
  .login-page .lg-medallion-letter  { order: 2; }
  .login-page .lg-subtitle          { order: 3; margin-top: 0.4rem; }
}

/* ─── FORM SECTION ─── */
.login-page .lg-form-section {
  margin-top: 2rem;
  padding: 0;
  position: relative;
  z-index: 2;
}

/* Tighten birth-chart's .form-frame to feel right for a single-field form */
.login-page .lg-form-frame {
  max-width: 520px;
  padding: 2.6rem 2.4rem 2.4rem;
  margin: 0 auto;
}
@media (max-width: 580px) {
  .login-page .lg-form-frame {
    padding: 2rem 1.4rem 1.8rem;
  }
}

.login-page .lg-form-eyebrow {
  text-align: center;
  font-family: 'EB Garamond', serif;
  font-variant: small-caps;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.32em;
  color: var(--gold-deep);
  margin: 0 0 0.4rem;
  padding-left: 0.32em;
}
.login-page .lg-form-title {
  text-align: center;
  font-family: 'EB Garamond', serif;
  font-weight: 600;
  font-size: clamp(1.4rem, 2.6vw, 1.85rem);
  color: var(--burgundy);
  line-height: 1.2;
  margin: 0 0 1.6rem;
  letter-spacing: -0.005em;
}
.login-page .lg-form-title em {
  font-style: italic;
  font-weight: 500;
  color: var(--burgundy-deep);
}

/* Error banner — Italianno-burgundy, sits inside the parchment frame */
.login-page .lg-form-error {
  margin: 0 0 1.2rem;
  padding: 0.85rem 1rem;
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--burgundy-deep);
  background: rgba(107, 31, 44, 0.06);
  border-left: 3px solid var(--burgundy);
  border-radius: 2px;
  text-align: center;
}

.login-page .lg-form { margin: 0; }

/* Fineprint — let the .form-fineprint base do the heavy lift, lighter color tweak */
.login-page .lg-form-fineprint {
  font-size: 1rem;
  color: var(--ink-soft, #4A3B52);
  margin-top: 1.1rem;
}
.login-page .lg-form-fineprint em {
  color: var(--burgundy);
  font-weight: 600;
  font-style: italic;
}

/* ─── FORM FOOTER (rule + "no account yet?" link) ─── */
.login-page .lg-form-foot {
  margin-top: 2.2rem;
  text-align: center;
}
.login-page .lg-foot-rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  max-width: 300px;
  margin: 0 auto 1rem;
}
.login-page .lg-foot-rule-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold) 50%, transparent);
}
.login-page .lg-foot-rule-mark {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.1rem;
  color: var(--gold);
  line-height: 1;
  opacity: 0.85;
}
.login-page .lg-foot-prompt {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 1.04rem;
  color: var(--ink-soft, #4A3B52);
  margin: 0;
}

/* Shared link style — burgundy with gold under-glow on hover */
.login-page .lg-link {
  color: var(--burgundy);
  font-weight: 700;
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 100% 1px;
  transition: color 0.25s, background-size 0.25s;
}
.login-page .lg-link:hover {
  color: var(--burgundy-deep);
  background-size: 100% 2px;
}

/* ─── SEALED LETTER STATES (sent / patience / expired) ─── */
.login-page .lg-sealed {
  margin: 2.4rem auto 0;
  max-width: 760px;
  padding: 3.2rem 2.8rem;
  grid-template-columns: 1fr auto;
  gap: 2.6rem;
  position: relative;
  z-index: 2;
}
.login-page .lg-sealed-text { min-width: 0; }
.login-page .lg-sealed .letter-deck em {
  color: var(--ink);
  font-weight: 600;
  font-style: italic;
}
.login-page .lg-sealed .letter-deck strong {
  color: var(--burgundy);
  font-weight: 700;
}

/* Internal divider inside the sealed letter */
.login-page .lg-sealed-divider {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  max-width: 340px;
  margin: 1.5rem 0 1.2rem;
}
.login-page .lg-sealed-divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
}
.login-page .lg-sealed-divider-mark {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1rem;
  color: var(--gold-bright);
  line-height: 1;
  opacity: 0.9;
}

.login-page .lg-sealed-fineprint {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 1rem;
  color: var(--ink-soft, #4A3B52);
  margin: 0;
  line-height: 1.5;
}

/* Celestial illustration — sized like the standard .celestial */
.login-page .lg-celestial {
  width: 200px;
  height: 200px;
  flex-shrink: 0;
}
@media (max-width: 720px) {
  .login-page .lg-sealed {
    grid-template-columns: 1fr;
    padding: 2.4rem 1.6rem 2.2rem;
    gap: 1.8rem;
    text-align: center;
  }
  .login-page .lg-sealed-divider { margin-left: auto; margin-right: auto; }
  .login-page .lg-sealed-text .letter-actions { justify-content: center; }
  .login-page .lg-celestial { width: 170px; height: 170px; margin: 0 auto; }
}

/* Sealed-letter celestial micro-animations (sent / expired / patience) */
@keyframes lgSealedSealPulse {
  0%, 100% { transform: scale(1);    }
  50%      { transform: scale(1.04); }
}
.login-page .lg-celestial-seal {
  transform-origin: center;
  animation: lgSealedSealPulse 2.4s ease-in-out infinite;
}

/* Smoke rises slowly + fades */
@keyframes lgSmokeDrift {
  0%   { opacity: 0;    transform: translateY(0); }
  18%  { opacity: 1; }
  100% { opacity: 0;    transform: translateY(-6px); }
}
.login-page .lg-smoke     { animation: lgSmokeDrift 4.6s ease-out infinite; transform-origin: center; }
.login-page .lg-smoke-2   { animation-delay: -1.4s; animation-duration: 5.2s; }
.login-page .lg-smoke-3   { animation-delay: -2.8s; animation-duration: 4.0s; }

@media (prefers-reduced-motion: reduce) {
  .login-page .lg-celestial-seal,
  .login-page .lg-smoke { animation: none; }
}

/* Twinkle stars in the celestial — reuse the .tw class names already
   defined by yes-no-tarot.css's .celestial pattern (the keyframes match) */

/* ─── COLOPHON — tighten margin so it doesn't crowd the panel above ─── */
.login-page .lg-colophon {
  margin-top: 3rem;
  text-align: center;
}

/* ─── DEFENSIVE: hero padding tighter when the body has just the hero
   + sealed-letter (no form-section) — avoids extra empty space on
   the sent/patience/expired states */
.login-page .ca-wrap > .page-hero + .sealed-letter {
  margin-top: 1.8rem;
}

/* ═════════════════════════════════════════════════════════════════════
   PORTED FROM yes-no-tarot.css — we don't load that whole sheet on
   the login page, but we use a handful of its classes (sealed-letter,
   letter-*, celestial, btn-dark, yn-colophon, .tw twinkle keyframes).
   Replicated here scoped to `.login-page` so they don't leak.
   ═════════════════════════════════════════════════════════════════════ */

/* Sealed-letter base — the cream parchment panel with gold trim */
.login-page .sealed-letter {
  position: relative;
  background:
    radial-gradient(ellipse 80% 50% at 30% 0%, rgba(184, 145, 80, 0.2), transparent 65%),
    linear-gradient(180deg, var(--vellum-warm) 0%, var(--vellum) 100%);
  border: 1px solid var(--gold);
  display: grid;
  align-items: center;
  box-shadow:
    0 14px 40px rgba(58, 31, 56, 0.18),
    inset 0 0 0 6px var(--vellum-warm),
    inset 0 0 0 7px rgba(184, 145, 80, 0.45);
  border-radius: 4px;
}

/* Letter typography */
.login-page .letter-eyebrow {
  font-family: 'Italianno', cursive;
  font-weight: 400;
  font-size: 2rem;
  line-height: 1;
  color: var(--burgundy);
  margin: 0 0 0.6rem;
  -webkit-text-stroke: 0.3px var(--burgundy);
}
.login-page .letter-title {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-weight: 600;
  font-size: clamp(2rem, 3.4vw, 2.7rem);
  line-height: 1.05;
  letter-spacing: -0.012em;
  color: var(--ink);
  margin: 0 0 0.4rem;
}
.login-page .letter-script {
  font-family: 'Italianno', cursive;
  font-size: clamp(1.9rem, 2.6vw, 2.2rem);
  color: var(--burgundy);
  line-height: 1;
  margin: 0 0 1.1rem;
  -webkit-text-stroke: 0.5px var(--burgundy);
  text-shadow: 0 0 1px rgba(107, 31, 44, 0.25);
}
.login-page .letter-deck {
  font-family: 'EB Garamond', serif;
  font-weight: 500;
  font-size: clamp(1.08rem, 1.6vw, 1.22rem);
  line-height: 1.55;
  color: var(--ink-soft, #4A3B52);
  margin: 0 0 1rem;
  max-width: 460px;
}
.login-page .letter-actions {
  display: flex;
  gap: 1.2rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 1.1rem;
}

/* Celestial illustration container */
.login-page .celestial {
  position: relative;
  flex-shrink: 0;
}
.login-page .celestial svg { width: 100%; height: 100%; display: block; }

/* Stars (.tw) twinkle — reuses the same 7-stagger pattern as yes-no */
@keyframes lgCelestialTwinkle {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.25; }
}
.login-page .celestial .tw { animation: lgCelestialTwinkle 2.6s ease-in-out infinite; }
.login-page .celestial .tw-1 { animation-delay: 0s;   animation-duration: 2.4s; }
.login-page .celestial .tw-2 { animation-delay: 0.7s; animation-duration: 3.2s; }
.login-page .celestial .tw-3 { animation-delay: 1.4s; animation-duration: 2.8s; }
.login-page .celestial .tw-4 { animation-delay: 0.3s; animation-duration: 3.6s; }
.login-page .celestial .tw-5 { animation-delay: 1.9s; animation-duration: 2.2s; }
.login-page .celestial .tw-6 { animation-delay: 0.5s; animation-duration: 3.0s; }
.login-page .celestial .tw-7 { animation-delay: 1.1s; animation-duration: 2.6s; }
@media (prefers-reduced-motion: reduce) {
  .login-page .celestial .tw { animation: none; }
}

/* Buttons — minimal port. .btn-dark is the only one we use in actions. */
.login-page .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  padding: 1rem 2.2rem;
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.25s, box-shadow 0.25s, background 0.25s;
  border: 1px solid var(--burgundy-deep);
}
.login-page .btn-dark {
  background: linear-gradient(180deg, var(--burgundy) 0%, var(--burgundy-deep) 100%);
  color: var(--vellum-warm);
  box-shadow:
    0 4px 14px rgba(74, 22, 32, 0.35),
    inset 0 1px 0 rgba(255, 240, 220, 0.12);
}
.login-page .btn-dark:hover {
  transform: translateY(-2px);
  box-shadow:
    0 8px 22px rgba(74, 22, 32, 0.45),
    inset 0 1px 0 rgba(255, 240, 220, 0.18);
}
.login-page .btn-dark::after {
  content: '⟶';
  font-family: 'EB Garamond', serif;
  font-weight: 400;
  font-size: 1.1em;
  margin-left: 0.1em;
}

/* Colophon — quiet end-of-page mark */
.login-page .yn-colophon {
  margin: 3rem auto 0;
  text-align: center;
  padding: 1.6rem 0;
}
.login-page .yn-colophon-mark {
  font-family: 'Italianno', cursive;
  font-size: 1.7rem;
  color: var(--gold-deep);
  line-height: 1;
  letter-spacing: 0.02em;
  -webkit-text-stroke: 0.3px var(--gold-deep);
}
