/* ═══════════════════════════════════════════════════════════════
   Auth Pages — Stripe / Sohne Design System
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --font-sans: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  /* Brand */
  --purple:        #533afd;
  --purple-hover:  #4434d4;
  --purple-light:  #eeeeff;
  --purple-ring:   rgba(83, 58, 253, 0.18);

  /* Neutrals */
  --fg-heading:    #061b31;
  --fg-label:      #273951;
  --fg-body:       #64748d;
  --fg-muted:      rgba(16, 16, 16, 0.3);

  --bg-page:       #f6f9fc;
  --bg-surface:    #ffffff;
  --bg-subtle:     #f6f9fc;

  /* Borders */
  --border:        #e5edf5;
  --border-active: #b9b9f9;

  /* Status */
  --success:       #15be53;
  --success-text:  #108c3d;
  --success-bg:    rgba(21, 190, 83, 0.12);
  --success-bdr:   rgba(21, 190, 83, 0.4);
  --red:           #e0173d;
  --red-bg:        rgba(224, 23, 61, 0.07);
  --red-bdr:       rgba(224, 23, 61, 0.25);

  /* Shadows — Stripe blue-tinted chromatic depth */
  --elev-1: 0px 3px 6px rgba(23, 23, 23, 0.06);
  --elev-3: rgba(50, 50, 93, 0.25) 0px 30px 45px -30px,
            rgba(0, 0, 0, 0.1) 0px 18px 36px -18px;

  /* Radius */
  --r-sm:  4px;
  --r-md:  6px;
  --r-lg:  8px;
}

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

body {
  font-family: var(--font-sans);
  font-feature-settings: "ss01" on;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.5;
  color: var(--fg-body);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Auth layout ────────────────────────────────────────────── */

.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg-page);
}

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

/* Brand mark at top of auth flow */
.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 32px;
  text-decoration: none;
}

.auth-logo-mark {
  width: 34px;
  height: 34px;
  background: var(--purple);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.auth-logo-mark svg {
  width: 18px;
  height: 18px;
  fill: #fff;
}

.auth-logo-name {
  font-size: 1rem;
  font-weight: 500;
  color: var(--fg-heading);
  letter-spacing: -0.2px;
}

/* Card */
.auth-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 40px 44px;
  box-shadow: var(--elev-3);
}

.auth-card h1 {
  font-size: 1.625rem;
  font-weight: 300;
  color: var(--fg-heading);
  letter-spacing: -0.4px;
  line-height: 1.12;
  margin-bottom: 8px;
}

.auth-sub {
  font-size: 0.9375rem;
  font-weight: 300;
  color: var(--fg-body);
  margin-bottom: 28px;
  line-height: 1.5;
}

.auth-sub a {
  color: var(--purple);
  font-weight: 400;
  text-decoration: none;
}

.auth-sub a:hover { text-decoration: underline; }

/* ── Form fields ────────────────────────────────────────────── */

.field { margin-bottom: 18px; }

.field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--fg-label);
  margin-bottom: 6px;
}

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 0.9375rem;
  font-weight: 300;
  font-family: var(--font-sans);
  color: var(--fg-heading);
  background: var(--bg-surface);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input[type="email"]:focus,
input[type="password"]:focus,
input[type="text"]:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--purple-ring);
}

input::placeholder {
  color: var(--fg-muted);
  font-weight: 300;
}

/* ── Buttons ────────────────────────────────────────────────── */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 20px;
  border: none;
  border-radius: var(--r-sm);
  font-size: 0.9375rem;
  font-weight: 400;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
  text-decoration: none;
  line-height: 1;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary-auth {
  background: var(--purple);
  color: #fff;
  margin-top: 4px;
  box-shadow: rgba(83, 58, 253, 0.3) 0px 4px 12px -2px;
}

.btn-primary-auth:hover:not(:disabled) {
  background: var(--purple-hover);
  box-shadow: rgba(83, 58, 253, 0.4) 0px 6px 16px -2px;
}

.btn-primary-auth:active:not(:disabled) {
  transform: scale(0.99);
}

.btn-google-auth {
  background: var(--bg-surface);
  color: var(--fg-label);
  border: 1px solid var(--border);
  box-shadow: var(--elev-1);
}

.btn-google-auth:hover:not(:disabled) {
  border-color: var(--border-active);
  box-shadow: rgba(50, 50, 93, 0.15) 0px 4px 12px -4px;
}

/* ── Divider ────────────────────────────────────────────────── */

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--fg-muted);
  font-size: 0.8125rem;
  font-weight: 400;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--border);
}

/* ── Alert messages ─────────────────────────────────────────── */

.alert {
  padding: 11px 14px;
  border-radius: var(--r-sm);
  font-size: 0.875rem;
  font-weight: 300;
  line-height: 1.5;
  margin-bottom: 18px;
  border: 1px solid transparent;
}

.alert-error {
  background: var(--red-bg);
  color: var(--red);
  border-color: var(--red-bdr);
}

.alert-success {
  background: var(--success-bg);
  color: var(--success-text);
  border-color: var(--success-bdr);
}

.alert-success a {
  color: var(--success-text);
  font-weight: 500;
  word-break: break-all;
}

/* ── Footer links ───────────────────────────────────────────── */

.auth-footer {
  text-align: center;
  margin-top: 22px;
  font-size: 0.875rem;
  font-weight: 300;
  color: var(--fg-body);
}

.auth-footer a {
  color: var(--purple);
  font-weight: 400;
  text-decoration: none;
}

.auth-footer a:hover { text-decoration: underline; }

/* ── Spinner ────────────────────────────────────────────────── */

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Language toggle (top-right of auth-wrap) ──────────────── */

.lang-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--elev-1);
}

.lang-toggle button {
  border: none;
  background: transparent;
  padding: 4px 10px;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--fg-body);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.lang-toggle button[aria-pressed="true"] {
  background: var(--purple);
  color: #fff;
}

.lang-toggle button:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}

/* ── Trust row below card ───────────────────────────────────── */

.trust-row {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.trust-row .trust-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--fg-body);
}

.trust-row .trust-item svg {
  width: 13px;
  height: 13px;
  stroke: var(--success-text);
  flex-shrink: 0;
}

/* ── Legal footer (very bottom of auth pages) ───────────────── */

.legal-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--fg-muted);
}

.legal-footer a {
  color: var(--fg-body);
  text-decoration: none;
  margin: 0 6px;
}

.legal-footer a:hover {
  color: var(--purple);
  text-decoration: underline;
}

.legal-footer .sep {
  color: var(--border);
}

/* ── Focus visibility (a11y) ────────────────────────────────── */

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* ── Responsive ─────────────────────────────────────────────── */

@media (max-width: 480px) {
  .auth-card { padding: 28px 24px; }
  .lang-toggle { top: 14px; right: 14px; }
}
