/* =========================================================================
   Socialize Design Tokens
   Cream + coral. Warm, grounded, friendly-sleek.
   Copied from the iOS app's Social_Design_System/colors_and_type.css so the
   /connect page matches the app's look exactly.
   ========================================================================= */

:root,
[data-theme="light"] {
  --primary:           oklch(0.70 0.16 35);
  --primary-press:     oklch(0.62 0.17 35);
  --primary-soft:      oklch(0.94 0.04 40);
  --primary-ink:       oklch(0.40 0.14 35);

  --bg:        oklch(0.975 0.012 80);
  --surface:   oklch(0.99 0.005 80);
  --surface-2: oklch(0.96 0.014 80);
  --surface-3: oklch(0.93 0.018 75);

  --ink:       oklch(0.22 0.02 60);
  --ink-2:     oklch(0.42 0.015 60);
  --ink-3:     oklch(0.60 0.012 60);
  --ink-on-primary: oklch(0.99 0.005 80);

  --line:      oklch(0.91 0.012 65);
  --line-2:    oklch(0.85 0.014 65);

  --danger:    oklch(0.62 0.18 25);

  --shadow-sm: 0 1px 2px oklch(0.2 0.04 60 / 0.06), 0 1px 1px oklch(0.2 0.04 60 / 0.04);
  --shadow-md: 0 4px 12px oklch(0.2 0.04 60 / 0.08), 0 2px 4px oklch(0.2 0.04 60 / 0.05);
  --shadow-lg: 0 16px 40px oklch(0.2 0.04 60 / 0.12), 0 4px 12px oklch(0.2 0.04 60 / 0.06);

  --r-sm:   8px;
  --r-md:   14px;
  --r-lg:   20px;
  --r-full: 999px;

  --font-sans:    -apple-system, BlinkMacSystemFont, system-ui, ui-sans-serif, 'Segoe UI', sans-serif;
  --font-display: ui-serif, 'New York', Charter, Georgia, 'Times New Roman', serif;

  --fs-xs:  12px;
  --fs-sm:  14px;
  --fs-md:  16px;
  --fs-lg:  18px;
  --fs-2xl: 24px;

  --dur: 200ms;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

[data-theme="dark"] {
  --primary:           oklch(0.74 0.15 35);
  --primary-press:     oklch(0.68 0.16 35);
  --primary-soft:      oklch(0.32 0.07 35);
  --primary-ink:       oklch(0.82 0.13 35);

  --bg:        oklch(0.18 0.012 60);
  --surface:   oklch(0.22 0.014 60);
  --surface-2: oklch(0.26 0.016 60);
  --surface-3: oklch(0.30 0.018 60);

  --ink:       oklch(0.96 0.012 80);
  --ink-2:     oklch(0.78 0.012 70);
  --ink-3:     oklch(0.60 0.012 65);
  --ink-on-primary: oklch(0.18 0.012 60);

  --line:      oklch(0.32 0.014 60);
  --line-2:    oklch(0.40 0.016 60);

  --danger:    oklch(0.68 0.18 25);

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.40), 0 1px 1px oklch(0 0 0 / 0.30);
  --shadow-md: 0 4px 12px oklch(0 0 0 / 0.45), 0 2px 4px oklch(0 0 0 / 0.30);
  --shadow-lg: 0 16px 40px oklch(0 0 0 / 0.55), 0 4px 12px oklch(0 0 0 / 0.35);

  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary:           oklch(0.74 0.15 35);
    --primary-press:     oklch(0.68 0.16 35);
    --primary-soft:      oklch(0.32 0.07 35);
    --primary-ink:       oklch(0.82 0.13 35);

    --bg:        oklch(0.18 0.012 60);
    --surface:   oklch(0.22 0.014 60);
    --surface-2: oklch(0.26 0.016 60);
    --surface-3: oklch(0.30 0.018 60);

    --ink:       oklch(0.96 0.012 80);
    --ink-2:     oklch(0.78 0.012 70);
    --ink-3:     oklch(0.60 0.012 65);
    --ink-on-primary: oklch(0.18 0.012 60);

    --line:      oklch(0.32 0.014 60);
    --line-2:    oklch(0.40 0.016 60);

    --danger:    oklch(0.68 0.18 25);

    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.40), 0 1px 1px oklch(0 0 0 / 0.30);
    --shadow-md: 0 4px 12px oklch(0 0 0 / 0.45), 0 2px 4px oklch(0 0 0 / 0.30);
    --shadow-lg: 0 16px 40px oklch(0 0 0 / 0.55), 0 4px 12px oklch(0 0 0 / 0.35);

    color-scheme: dark;
  }
}

/* =========================================================================
   Base / type
   ========================================================================= */

* { box-sizing: border-box; }

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  margin: 0;
}

.h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 10px;
}

.body {
  font-size: var(--fs-md);
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0 0 28px;
}

.eyebrow {
  display: block;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 8px;
}

.caption {
  font-size: var(--fs-xs);
  line-height: 1.4;
  color: var(--ink-3);
}

a { color: var(--primary-ink); }
a:hover { color: var(--primary-press); }

/* =========================================================================
   Page layout
   ========================================================================= */

.page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px 28px 32px;
}

.lang-switcher {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px 10px;
  margin: 0 0 16px;
}

.lang-link {
  font-size: var(--fs-xs);
  color: var(--ink-3);
  text-decoration: none;
  border-bottom: none;
}
.lang-link:hover { color: var(--ink-2); }
.lang-link.lang-active {
  color: var(--primary-ink);
  font-weight: 600;
}

.logo {
  display: block;
  margin: 0 0 20px;
}

.logo-dark { display: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo-dark { display: block; }
}

[data-theme="dark"] .logo-light { display: none; }
[data-theme="dark"] .logo-dark { display: block; }

/* =========================================================================
   Buttons
   ========================================================================= */

.btn {
  appearance: none;
  border: none;
  border-radius: var(--r-md);
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  font-weight: 600;
  padding: 14px 20px;
  cursor: pointer;
  transition: background var(--dur) var(--ease), opacity var(--dur) var(--ease);
  box-shadow: var(--shadow-sm);
}

.btn:disabled { opacity: 0.5; cursor: default; }

.btn-primary {
  background: var(--primary);
  color: var(--ink-on-primary);
}
.btn-primary:hover:not(:disabled) { background: var(--primary-press); }

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-2);
}
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); }

.btn-full { width: 100%; }

.btn-oauth {
  width: 100%;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 20px;
}

.btn-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* apple-logo.png is a solid silhouette (alpha shape only) — mask it with the current
   ink color instead of drawing it directly, so it tints correctly in dark mode too
   (same effect as Android's ColorFilter.tint / iOS's foregroundStyle on the SF Symbol). */
.apple-icon {
  background-color: var(--ink);
  -webkit-mask-image: url('/images/apple-logo.png');
  mask-image: url('/images/apple-logo.png');
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

.oauth-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

/* Shown inside social apps' built-in browsers, where sign-in cannot work. */
.inapp-banner {
  background: var(--primary-soft);
  border-radius: var(--r-md);
  padding: 16px;
  margin: 0 0 20px;
}
.inapp-title {
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 6px;
}
.inapp-body {
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--ink-2);
  margin: 0 0 14px;
}
.inapp-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.inapp-actions .btn {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.legal { text-align: center; }

.button-row {
  display: flex;
  gap: 12px;
  margin: 0;
}
.button-row .btn { flex: 1; }

.store-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.store-badge {
  display: block;
  text-align: center;
  padding: 12px 16px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  color: var(--ink);
  font-weight: 600;
  font-size: var(--fs-sm);
  text-decoration: none;
  border-bottom: none;
}
.store-badge:hover { background: var(--surface-3); }

/* =========================================================================
   Forms
   ========================================================================= */

.form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.field input[type="text"],
.field input[type="date"] {
  font-family: var(--font-sans);
  font-size: var(--fs-lg);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  padding: 14px 16px;
}
.field input:focus {
  outline: none;
  border-color: var(--primary);
}

.pill-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  flex: 1;
  min-width: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 10px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-2);
  background: var(--surface);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  text-align: center;
}

.pill input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.pill:has(input:checked) {
  border-color: var(--primary);
  border-width: 2px;
  color: var(--ink);
  font-weight: 600;
  background: var(--primary-soft);
}
