/* ============================================================
   MATV — Login & Registration Pages  auth.css
   Aesthetic: Sacred Threshold — warm earth + forest night,
   candlelit gold, ceremonial depth. Feels like arriving
   somewhere meaningful, not signing up for software.
   Fonts: Playfair Display + Crimson Pro + DM Sans
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400&family=Crimson+Pro:ital,wght@0,300;0,400;0,600;1,300;1,400&family=DM+Sans:wght@300;400;500;600&family=DM+Mono:wght@400&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --earth:        #080c0a;
  --earth-1:      #0c1210;
  --earth-2:      #111a14;
  --earth-3:      #182218;
  --earth-4:      #1f2c1f;

  --forest:       #1a4a1a;
  --forest-mid:   #2d6e2d;
  --forest-lt:    #3d8b3d;
  --leaf:         #5dba5d;
  --leaf-dim:     rgba(93,186,93,0.14);

  --gold:         #CFA349;
  --gold-lt:      #e8c06b;
  --gold-warm:    #d4a85a;
  --gold-dim:     rgba(207,163,73,0.15);
  --gold-glow:    rgba(207,163,73,0.07);
  --gold-candle:  rgba(207,163,73,0.45);

  --red:          #c0392b;
  --crimson:      #8b1a1a;
  --crimson-dim:  rgba(139,26,26,0.15);

  --amber:        #d4850a;
  --amber-dim:    rgba(212,133,10,0.15);

  --txt:          #ede8dc;
  --txt-mid:      #b0a890;
  --txt-muted:    rgba(237,232,220,0.50);
  --txt-faint:    rgba(237,232,220,0.24);
  --txt-ghost:    rgba(237,232,220,0.12);

  --border:       rgba(207,163,73,0.13);
  --border-mid:   rgba(207,163,73,0.24);
  --border-hi:    rgba(207,163,73,0.50);

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Crimson Pro', Georgia, serif;
  --font-ui:      'DM Sans', system-ui, sans-serif;
  --font-mono:    'DM Mono', monospace;

  --r:            5px;
  --r-lg:         12px;
  --r-xl:         20px;
  --t:            0.20s ease;
  --shadow:       0 4px 32px rgba(0,0,0,0.55);
  --shadow-gold:  0 0 40px rgba(207,163,73,0.08);
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-ui);
  background: var(--earth);
  color: var(--txt);
  min-height: 100vh;
  line-height: 1.65;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }

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

/* ── LEFT PANEL — Story / Welcome ──────────────────────────── */
.auth-story {
  position: relative;
  background: var(--forest);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 52px;
  overflow: hidden;
  min-height: 100vh;
}

.story-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 30% 40%, rgba(45,110,45,0.55) 0%, transparent 70%),
    radial-gradient(ellipse 50% 70% at 80% 80%, rgba(207,163,73,0.10) 0%, transparent 60%),
    linear-gradient(175deg, #0a1a0a 0%, #061206 40%, #0c1a0c 100%);
}
.story-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(207,163,73,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(207,163,73,0.03) 1px, transparent 1px);
  background-size: 52px 52px;
  pointer-events: none;
}

.story-top { position: relative; z-index: 2; }
.story-logo {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 64px;
}
.story-logo img { width: 46px; height: 46px; object-fit: contain; }
.story-logo-text strong {
  font-family: var(--font-display);
  font-size: 16px; font-weight: 700;
  color: var(--gold); display: block; line-height: 1;
}
.story-logo-text span {
  font-size: 10px; letter-spacing: 0.16em;
  text-transform: uppercase; color: rgba(207,163,73,0.5);
}

.story-headline {
  font-family: var(--font-display);
  font-size: clamp(34px, 4vw, 52px);
  font-weight: 900;
  line-height: 1.08;
  color: var(--txt);
  margin-bottom: 20px;
}
.story-headline .line-gold { color: var(--gold); font-style: italic; display: block; }
.story-headline .line-leaf { color: var(--leaf); display: block; }

.story-body {
  font-family: var(--font-body);
  font-size: 18px; font-weight: 300;
  line-height: 1.8;
  color: var(--txt-muted);
  max-width: 420px;
  margin-bottom: 40px;
}

.story-pillars {
  display: flex; flex-direction: column; gap: 12px;
  margin-bottom: 48px;
}
.pillar {
  display: flex; align-items: center; gap: 12px;
  font-size: 14px; color: var(--txt-mid);
}
.pillar-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold); flex-shrink: 0;
}

.story-bottom {
  position: relative; z-index: 2;
  border-top: 1px solid var(--border);
  padding-top: 24px;
}
.story-quote {
  font-family: var(--font-body);
  font-size: 15px; font-style: italic;
  color: var(--txt-muted); line-height: 1.7;
}
.story-quote cite {
  display: block; font-style: normal;
  font-size: 12px; color: rgba(207,163,73,0.55);
  letter-spacing: 0.08em; margin-top: 8px;
}

/* ── RIGHT PANEL — Form ────────────────────────────────────── */
.auth-form-panel {
  background: var(--earth-1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 48px 52px;
  overflow-y: auto;
  min-height: 100vh;
}

.auth-form-inner { width: 100%; max-width: 480px; }

.form-eyebrow {
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 6px;
  display: flex; align-items: center; gap: 8px;
}
.form-eyebrow::before { content:''; display:block; width:20px; height:1px; background:var(--gold); }

.form-title {
  font-family: var(--font-display);
  font-size: 30px; font-weight: 700; line-height: 1.1;
  color: var(--txt); margin-bottom: 6px;
}
.form-sub {
  font-family: var(--font-body);
  font-size: 16px; color: var(--txt-muted); margin-bottom: 32px;
}

/* ── STEP PROGRESS (registration) ─────────────────────────── */
.step-progress {
  display: flex; align-items: center; gap: 0;
  margin-bottom: 32px;
}
.step-node {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
  border: 1.5px solid var(--border);
  background: var(--earth-3);
  color: var(--txt-muted);
  transition: all var(--t);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.step-node.active {
  background: var(--gold); color: var(--earth);
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(207,163,73,0.15);
}
.step-node.done {
  background: var(--forest-mid); color: var(--leaf);
  border-color: var(--forest-lt);
}
.step-connector {
  flex: 1; height: 1.5px;
  background: var(--border);
  transition: background var(--t);
}
.step-connector.done { background: var(--forest-lt); }
.step-label {
  font-size: 9px; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--txt-faint);
  text-align: center; margin-top: 6px;
}

/* ── FORM ELEMENTS ─────────────────────────────────────────── */
.f-step { display: none; }
.f-step.active { display: block; animation: step-in 0.3s ease; }
@keyframes step-in { from{opacity:0;transform:translateX(12px)} to{opacity:1;transform:translateX(0)} }

.f-group { margin-bottom: 18px; }
.f-label {
  display: block; font-size: 11px; font-weight: 600;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--txt-muted); margin-bottom: 6px;
}
.f-label .req { color: var(--gold); margin-left: 2px; }

.f-input, .f-select, .f-textarea {
  width: 100%;
  background: var(--earth-3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 11px 14px;
  color: var(--txt);
  font-size: 14px;
  font-family: var(--font-ui);
  outline: none;
  transition: border-color var(--t), background var(--t);
  line-height: 1.5;
}
.f-input:focus, .f-select:focus, .f-textarea:focus {
  border-color: var(--border-hi);
  background: var(--earth-4);
}
.f-input::placeholder { color: var(--txt-faint); }
.f-textarea { resize: vertical; min-height: 90px; }
.f-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23b0a890' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}
.f-select option { background: #1f2c1f; }

.f-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.f-hint { font-size: 12px; color: var(--txt-faint); margin-top: 5px; line-height: 1.5; }
.f-error { font-size: 12px; color: #f08080; margin-top: 4px; display: none; }
.f-error.show { display: block; }

/* Password toggle */
.f-input-wrap { position: relative; }
.f-input-wrap .f-input { padding-right: 42px; }
.pw-toggle {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  color: var(--txt-muted); font-size: 14px; cursor: pointer;
  padding: 2px;
}

/* Radio / Checkbox pills */
.pill-group { display: flex; flex-wrap: wrap; gap: 8px; }
.pill-option { display: none; }
.pill-label {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px; font-weight: 500;
  color: var(--txt-muted);
  cursor: pointer;
  transition: all var(--t);
  user-select: none;
}
.pill-label:hover { border-color: var(--border-mid); color: var(--txt); }
.pill-option:checked + .pill-label {
  background: var(--gold-dim);
  border-color: var(--gold);
  color: var(--gold-lt);
}

/* Checkbox row */
.check-row {
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 12px; font-size: 13px; color: var(--txt-mid);
  font-family: var(--font-body); line-height: 1.5;
}
.check-row input[type=checkbox] {
  width: 16px; height: 16px; flex-shrink: 0;
  margin-top: 2px; accent-color: var(--gold); cursor: pointer;
}

/* ── KKABBA ELDER PANEL ────────────────────────────────────── */
.elder-panel {
  background: linear-gradient(135deg, #0d1f0d, #100a00);
  border: 1px solid rgba(207,163,73,0.22);
  border-radius: var(--r-lg);
  padding: 22px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}
.elder-panel::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--forest), var(--gold), var(--forest));
}
.elder-header {
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
}
.elder-icon { font-size: 28px; }
.elder-header-text strong {
  font-family: var(--font-display); font-size: 16px; font-weight: 700;
  color: var(--gold); display: block; line-height: 1.2;
}
.elder-header-text span { font-size: 12px; color: var(--txt-muted); }

.elder-message {
  font-family: var(--font-body);
  font-size: 15px; line-height: 1.75;
  color: var(--txt-mid); margin-bottom: 16px;
  border-left: 2px solid var(--gold-dim);
  padding-left: 14px;
  font-style: italic;
}

.elder-response {
  background: var(--earth-3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.7;
  display: none;
  margin-top: 12px;
}
.elder-response.show { display: block; animation: step-in 0.3s ease; }
.elder-response.accepted { border-color: rgba(93,186,93,0.3); color: var(--leaf); }
.elder-response.modified { border-color: rgba(207,163,73,0.3); color: var(--gold-lt); }
.elder-response.rejected { border-color: rgba(192,57,43,0.3); color: #f08080; }

/* ── MEMBERSHIP TIERS ──────────────────────────────────────── */
.tier-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 4px; }
.tier-card {
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  cursor: pointer;
  transition: all var(--t);
  position: relative;
  overflow: hidden;
}
.tier-card::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: var(--tier-color, var(--border));
}
.tier-card:hover { border-color: var(--border-mid); transform: translateY(-1px); }
.tier-card.selected {
  border-color: var(--tier-color, var(--gold));
  background: var(--gold-glow);
}
.tier-card.free-tier     { --tier-color: var(--leaf); }
.tier-card.creator-tier  { --tier-color: var(--gold); }
.tier-card.patron-tier   { --tier-color: #c080e0; }
.tier-card.exchange-tier { --tier-color: var(--amber); }

.tier-name { font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.tier-price {
  font-family: var(--font-mono); font-size: 20px; font-weight: 500;
  margin-bottom: 6px;
}
.tier-desc { font-size: 11px; color: var(--txt-muted); line-height: 1.5; }
.tier-badge {
  display: inline-block; font-size: 9px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 10px; margin-bottom: 8px;
}
.tier-card.free-tier     .tier-price { color: var(--leaf); }
.tier-card.creator-tier  .tier-price { color: var(--gold); }
.tier-card.patron-tier   .tier-price { color: #c080e0; }
.tier-card.exchange-tier .tier-price { color: var(--amber); }

/* ── DIVIDER ───────────────────────────────────────────────── */
.auth-divider {
  display: flex; align-items: center; gap: 14px;
  margin: 22px 0;
  font-size: 12px; color: var(--txt-faint); letter-spacing: 0.06em;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ── BUTTONS ───────────────────────────────────────────────── */
.btn-auth {
  width: 100%; padding: 13px 24px;
  background: var(--gold); color: var(--earth);
  border: none; border-radius: var(--r);
  font-family: var(--font-ui); font-size: 14px; font-weight: 600;
  letter-spacing: 0.04em; cursor: pointer;
  transition: all var(--t); margin-top: 4px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-auth:hover { background: var(--gold-lt); }
.btn-auth:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-auth.btn-outline {
  background: transparent; color: var(--txt);
  border: 1px solid var(--border-mid);
}
.btn-auth.btn-outline:hover { border-color: var(--border-hi); background: var(--earth-3); }
.btn-auth.btn-green {
  background: var(--forest-mid); color: #fff;
}
.btn-auth.btn-green:hover { background: var(--forest-lt); }
.btn-next-prev {
  display: flex; gap: 10px; margin-top: 8px;
}
.btn-next-prev .btn-auth { flex: 1; }

/* ── SOCIAL AUTH ───────────────────────────────────────────── */
.social-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 4px; }
.btn-social {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px;
  background: var(--earth-3); border: 1px solid var(--border);
  border-radius: var(--r); font-size: 13px; font-weight: 500;
  color: var(--txt-mid); cursor: pointer;
  transition: all var(--t);
}
.btn-social:hover { border-color: var(--border-mid); color: var(--txt); background: var(--earth-4); }
.btn-social img { width: 16px; height: 16px; }

/* ── ALERTS ────────────────────────────────────────────────── */
.auth-alert {
  padding: 12px 16px; border-radius: var(--r); margin-bottom: 16px;
  font-size: 13px; line-height: 1.5; display: none;
}
.auth-alert.show { display: flex; gap: 10px; align-items: flex-start; }
.auth-alert.error   { background: var(--crimson-dim); border: 1px solid rgba(139,26,26,0.4); color: #f08080; }
.auth-alert.success { background: var(--leaf-dim);   border: 1px solid rgba(93,186,93,0.3); color: var(--leaf); }
.auth-alert.info    { background: var(--gold-dim);   border: 1px solid rgba(207,163,73,0.3); color: var(--gold-lt); }

/* ── FOOTER LINKS ──────────────────────────────────────────── */
.auth-footer-link {
  text-align: center; font-size: 13px; color: var(--txt-muted);
  margin-top: 20px;
}
.auth-footer-link a { color: var(--gold); font-weight: 500; }
.auth-footer-link a:hover { color: var(--gold-lt); }

/* ── STRENGTH METER ────────────────────────────────────────── */
.strength-meter { margin-top: 8px; }
.strength-bars { display: flex; gap: 3px; margin-bottom: 4px; }
.strength-bar { flex: 1; height: 3px; border-radius: 2px; background: var(--earth-4); transition: background 0.3s; }
.strength-label { font-size: 11px; color: var(--txt-faint); }

/* ── LOADING SPINNER ───────────────────────────────────────── */
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(8,12,10,0.3);
  border-top-color: var(--earth);
  animation: spin 0.7s linear infinite;
  display: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-story { display: none; }
  .auth-form-panel { padding: 32px 24px; }
  .tier-grid { grid-template-columns: 1fr; }
  .f-row-2 { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .auth-form-panel { padding: 24px 16px; }
  .social-row { grid-template-columns: 1fr; }
}
