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

:root {
  --bg:          #F3F0EA;
  --surface:     #FBFAF7;
  --border:      rgba(45, 42, 39, 0.10);
  --fg:          #2D2A27;
  --muted:       #6F6A64;
  --accent:      #66756E;
  --danger:      #A8483C;
  --font:        'Outfit', ui-sans-serif, system-ui, sans-serif;
  --r-card:      22px;
  --r-btn:       14px;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' 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");
  background-repeat: repeat;
  background-size: 200px 200px;
}

.auth-page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 40px 20px;
}

.auth-brand { display: inline-flex; text-decoration: none; }
.auth-brand svg { height: 30px; width: auto; display: block; }
.logo-accent { fill: var(--accent); }

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 32px 28px;
  box-shadow: 0 4px 18px rgba(45, 42, 39, 0.06);
}

.auth-step { display: flex; flex-direction: column; }
.auth-step[hidden] { display: none; }

.auth-title {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.4px;
  margin-bottom: 8px;
}

.auth-sub {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--muted);
  margin-bottom: 20px;
}
.auth-sub:last-of-type { margin-bottom: 24px; }

.auth-email { color: var(--fg); font-weight: 500; overflow-wrap: anywhere; }

.auth-emoji { font-size: 34px; line-height: 1; margin-bottom: 12px; }

.auth-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 8px;
}

.auth-input {
  font-family: inherit;
  font-size: 16px;
  color: var(--fg);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-btn);
  padding: 13px 16px;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.auth-input::placeholder { color: rgba(111, 106, 100, 0.55); }
.auth-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(102, 117, 110, 0.14);
}
.auth-input--invalid { border-color: var(--danger); }

.auth-input--code {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 10px;
  text-align: center;
  padding: 14px 16px 14px 26px;
}

.auth-submit {
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: #F7F5F0;
  background: var(--fg);
  border: none;
  border-radius: var(--r-btn);
  padding: 14px 24px;
  margin-top: 18px;
  width: 100%;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.auth-submit:hover:not(:disabled) { opacity: 0.88; }
.auth-submit:active:not(:disabled) { transform: translateY(1px); }
.auth-submit:disabled { opacity: 0.5; cursor: default; }

.auth-error {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--danger);
  margin-top: 12px;
}
.auth-error[hidden] { display: none; }

.auth-legal {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  margin-top: 16px;
}

.auth-resend,
.auth-back,
.auth-exit {
  font-family: inherit;
  font-size: 13.5px;
  color: var(--muted);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  align-self: flex-start;
  transition: color 0.15s ease;
}
.auth-resend { margin-top: 16px; align-self: center; }
.auth-back { margin-bottom: 14px; }
.auth-resend:hover:not(:disabled),
.auth-back:hover,
.auth-exit:hover { color: var(--fg); }
.auth-resend:disabled { cursor: default; opacity: 0.6; }

.auth-exit { align-self: center; }

@media (max-width: 420px) {
  .auth-card { padding: 26px 20px; }
  .auth-title { font-size: 21px; }
  .auth-input--code { font-size: 22px; letter-spacing: 8px; }
}
