@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&family=Outfit:wght@300;400;500&display=swap');

/* ─── Variables ──────────────────────────────────────────────────────────── */
:root {
  --bg-deep:     var(--bg);
  --bg-card:     var(--surface);
  --bg-raised:   #101222;
  --gold:        var(--accent);
  --gold-lt:     var(--accent-hover);
  --gold-dim:    rgba(196, 146, 58, 0.10);
  --gold-glow:   rgba(196, 146, 58, 0.18);
  --gold-border: rgba(196, 146, 58, 0.20);
  --cream:       var(--text);
  --text-mid:    var(--text-dim);
  --error:       #c45a3a;
  --error-bg:    rgba(196, 90, 58, 0.10);
  --ff-display:  'Cormorant Garamond', Georgia, serif;
  --ff-body:     'Outfit', system-ui, sans-serif;
}

/* ─── Reset & Base ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg-deep);
  color: var(--cream);
  font-family: var(--ff-body);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Grain overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-size: 300px;
}

/* ─── Ambient Suits ──────────────────────────────────────────────────────── */
.ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ambient-glow {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(ellipse at center, var(--border-soft) 0%, transparent 70%);
  border-radius: 50%;
}

.suit {
  position: absolute;
  font-size: clamp(1.2rem, 2.5vw, 2rem);
  color: rgba(196,146,58,0.04);
  user-select: none;
  animation: drift linear infinite;
}
.suit:nth-child(2)  { left:  8%; top: 15%; font-size: 1.4rem; animation-duration: 28s; animation-delay: -4s; }
.suit:nth-child(3)  { left: 22%; top: 70%; font-size: 1rem;   animation-duration: 34s; animation-delay: -12s; }
.suit:nth-child(4)  { left: 75%; top: 20%; font-size: 1.8rem; animation-duration: 22s; animation-delay: -7s; }
.suit:nth-child(5)  { left: 88%; top: 65%; font-size: 1.1rem; animation-duration: 30s; animation-delay: -18s; }
.suit:nth-child(6)  { left: 50%; top: 85%; font-size: 1.5rem; animation-duration: 26s; animation-delay: -2s; }
.suit:nth-child(7)  { left: 35%; top: 10%; font-size: 1.2rem; animation-duration: 38s; animation-delay: -9s; }
.suit:nth-child(8)  { left: 63%; top: 50%; font-size: 0.9rem; animation-duration: 32s; animation-delay: -15s; }

@keyframes drift {
  0%   { transform: translateY(0)   rotate(0deg);   opacity: 0.6; }
  50%  { transform: translateY(-30px) rotate(8deg);  opacity: 1; }
  100% { transform: translateY(0)   rotate(0deg);   opacity: 0.6; }
}

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.auth-page {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6rem 1.25rem 4rem;
}

/* ─── Header ─────────────────────────────────────────────────────────────── */
.auth-card-header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--gold-border);
}

.auth-logo {
  display: inline-block;
  text-decoration: none;
  margin-bottom: 1.25rem;
}

.auth-logo-img {
  width: 180px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.auth-title {
  font-family: var(--ff-display);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 400;
  line-height: 1.1;
  color: var(--cream);
  margin: 0;
}

.auth-title em {
  font-style: italic;
  color: var(--gold);
}

/* ─── Card ───────────────────────────────────────────────────────────────── */
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--gold-border);
  padding: 2.5rem 2rem;
  position: relative;
  animation: card-reveal 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(196,146,58,0.04) 0%, transparent 60%);
  pointer-events: none;
}

@keyframes card-reveal {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Flash Alerts ───────────────────────────────────────────────────────── */
.auth-alert {
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  line-height: 1.5;
  border-left: 2px solid var(--error);
  background: var(--error-bg);
  color: #e8836a;
}

.auth-alert--success {
  border-left-color: var(--gold);
  background: var(--gold-dim);
  color: var(--gold-lt);
}

.auth-alert-link-btn {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-decoration: underline;
  margin-left: 0.4rem;
}

/* ─── Form ───────────────────────────────────────────────────────────────── */
.auth-form { display: flex; flex-direction: column; gap: 1.25rem; }

.form-group { display: flex; flex-direction: column; gap: 0.35rem; }

.form-label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-mid);
}

.form-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.form-label-link {
  font-size: 0.72rem;
  color: var(--gold);
  text-underline-offset: 3px;
  text-decoration: none;
  cursor: pointer;
}

.form-label-link:hover { color: var(--gold-lt); }

.form-label .optional {
  font-weight: 300;
  letter-spacing: 0;
  text-transform: none;
  font-size: 0.9em;
  color: var(--text-muted);
}

.form-input {
  width: 100%;
  background: var(--bg-raised);
  border: 1px solid rgba(196,146,58,0.15);
  color: var(--cream);
  font-family: var(--ff-body);
  font-size: 0.95rem;
  font-weight: 300;
  padding: 0.75rem 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}

.form-input::placeholder { color: var(--text-muted); }

.form-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-dim);
}

.form-input.is-invalid {
  border-color: var(--error);
  box-shadow: 0 0 0 3px var(--error-bg);
}

/* ─── Field Errors ───────────────────────────────────────────────────────── */
.field-errors {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.field-error {
  font-size: 0.8rem;
  color: #e8836a;
}

/* ─── Checkbox Consent ───────────────────────────────────────────────────── */
.form-divider {
  border: none;
  border-top: 1px solid var(--gold-border);
  margin: 0.25rem 0;
}

.form-check {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
}

.form-check-input {
  flex-shrink: 0;
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.15rem;
  background: var(--bg-raised);
  border: 1px solid rgba(196,146,58,0.25);
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  position: relative;
  transition: border-color 0.2s, background 0.2s;
}

.form-check-input:checked {
  background: var(--gold);
  border-color: var(--gold);
}

.form-check-input:checked::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10'%3E%3Cpolyline points='1,5 4.5,8.5 11,1' fill='none' stroke='%2307080d' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/70% no-repeat;
}

.form-check-input:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--gold-dim);
}

.form-check-label {
  font-size: 0.85rem;
  color: var(--text-mid);
  line-height: 1.5;
}

.form-check-label a {
  color: var(--gold);
  text-underline-offset: 3px;
  text-decoration-color: rgba(196,146,58,0.4);
}

.form-check-label a:hover { color: var(--gold-lt); }

/* ─── Card intro / message / hint ───────────────────────────────────────── */
.auth-card-intro {
  font-size: 0.88rem;
  color: var(--text-mid);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.auth-card--message { text-align: center; }

.auth-icon {
  color: var(--gold);
  margin-bottom: 1.25rem;
}

.auth-card-message {
  font-size: 0.9rem;
  color: var(--text-mid);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.auth-card-message strong { color: var(--cream); font-weight: 400; }

.auth-card-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: 0.25rem;
}

.auth-card-hint a {
  color: var(--gold);
  text-underline-offset: 3px;
}

.auth-card-hint a:hover { color: var(--gold-lt); }

/* ─── Submit Button ──────────────────────────────────────────────────────── */
.auth-submit {
  width: 100%;
  padding: 0.9rem 1.5rem;
  background: var(--gold);
  border: 1px solid var(--gold);
  color: var(--bg);
  font-family: var(--ff-body);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  margin-top: 0.25rem;
}

.auth-submit:hover {
  background: var(--gold-lt);
  border-color: var(--gold-lt);
}

.auth-submit:active { transform: translateY(1px); }

/* ─── Footer Link ────────────────────────────────────────────────────────── */
.auth-footer-link {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.auth-footer-link a {
  color: var(--gold);
  text-underline-offset: 3px;
  text-decoration-color: rgba(196,146,58,0.4);
}

.auth-footer-link a:hover { color: var(--gold-lt); }

/* ─── Suits Divider ──────────────────────────────────────────────────────── */
.suits-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.25rem 0;
}

.suits-divider-line {
  flex: 1;
  height: 1px;
  background: var(--gold-border);
}

.suits-divider-text {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--text-muted);
}

/* ─── Light mode overrides ───────────────────────────────────────────────── */
html[data-theme="light"] { --bg-raised: var(--surface-2); }

html[data-theme="light"] .form-input {
  background: #fff;
  border-color: rgba(0,0,0,0.12);
  color: #1a1a1a;
}
html[data-theme="light"] .form-input::placeholder { color: #aaa; }
html[data-theme="light"] .form-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(196,146,58,0.15);
}
html[data-theme="light"] .form-check-input {
  background: #fff;
  border-color: rgba(0,0,0,0.18);
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .auth-card { padding: 2rem 1.25rem; }
  .auth-title { font-size: 1.8rem; }
}
