/* platform auth — sign-in card. All visual properties tokenized so sites can
   override --auth-* in their own stylesheet for a brand-matched login page.
   Defaults are intentionally neutral (greys + system fonts) so every site
   themes on equal terms — no site gets a free brand from these defaults.
   To theme: drop a /config/auth-theme.css with --auth-* overrides; login.php
   auto-loads it after this base sheet. */

:root {
  --auth-bg:           #f4f5f7;
  --auth-card:         #ffffff;
  --auth-border:       rgba(0, 0, 0, 0.10);
  --auth-shadow:       0 24px 60px rgba(0, 0, 0, 0.10);
  --auth-text:         #1a1a1a;
  --auth-text-2:       #555;
  --auth-text-3:       #888;
  --auth-accent:       #2a2a2a;
  --auth-radius:       10px;
  --auth-error-bg:     rgba(220, 53, 69, 0.08);
  --auth-error-border: rgba(220, 53, 69, 0.25);
  --auth-error-text:   #b02a37;
  --auth-serif:        -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --auth-sans:         -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --auth-bg:     #161718;
    --auth-card:   #1f2022;
    --auth-border: rgba(255, 255, 255, 0.08);
    --auth-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    --auth-text:   #ececec;
    --auth-text-2: #b0b0b0;
    --auth-text-3: #777;
    --auth-accent: #ececec;
  }
}

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

/* Scoped to body.auth-page — login.css is ALSO loaded by render_login_modal()
 * on arbitrary host pages so its provider buttons + form styles can be reused
 * inside the in-page modal. Without this scope, the global body { display:flex;
 * justify-content:center } would centre EVERY page that hosts a login modal
 * (e.g. anonymous viewers on a marketing landing) and shove content off-axis. */
body.auth-page {
  font-family: var(--auth-sans);
  background: var(--auth-bg);
  color: var(--auth-text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  background: var(--auth-card);
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius);
  padding: 40px 36px;
  width: 100%;
  max-width: 360px;
  text-align: center;
  box-shadow: var(--auth-shadow);
}

.auth-logo {
  font-family: var(--auth-serif);
  font-style: italic;
  font-size: 28px;
  font-weight: 500;
  color: var(--auth-accent);
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}
.auth-subtitle {
  font-size: 13px;
  color: var(--auth-text-3);
  margin-bottom: 32px;
}

.auth-google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 11px 20px;
  background: #fff;
  color: #3c4043;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: box-shadow 0.15s, transform 0.15s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}
.auth-google-btn:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
  transform: translateY(-1px);
}
.auth-google-btn svg { flex-shrink: 0; }

/* Facebook button — inherits the Google button's shape so the two
 * stack visually as identical pill-shaped CTAs. Brand color is
 * Facebook blue (#1877F2). Sits below the Google button when both
 * configured. */
.auth-facebook-btn {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; width: 100%;
  padding: 11px 20px;
  background: #1877F2; color: #fff;
  border: none; border-radius: 8px;
  font-size: 14px; font-weight: 500; font-family: inherit;
  cursor: pointer; text-decoration: none;
  transition: box-shadow 0.15s, transform 0.15s, filter 0.15s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  margin-top: 10px;
}
.auth-facebook-btn:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
  transform: translateY(-1px);
  filter: brightness(1.06);
}
.auth-facebook-btn svg { flex-shrink: 0; background: #fff; border-radius: 50%; }

/* OTP / magic-link — email-input + ghost button stacked.
 * Same width + radius as Google/FB so the three CTAs line up visually.
 * Ghost styling (neutral background, hairline border) signals it's the
 * lower-friction option compared to the branded social buttons above. */
.auth-otp-form {
  display: flex; flex-direction: column; gap: 8px;
  width: 100%; margin: 0;
}
.auth-otp-input {
  width: 100%; padding: 11px 14px;
  border: 1px solid #d1d5db; border-radius: 8px;
  font-family: inherit; font-size: 14px;
  background: #fff; color: #111827;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-otp-input:focus {
  outline: none;
  border-color: #6b7280;
  box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.15);
}
.auth-otp-btn {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; width: 100%;
  padding: 11px 20px;
  background: #f9fafb; color: #111827;
  border: 1px solid #d1d5db; border-radius: 8px;
  font-size: 14px; font-weight: 500; font-family: inherit;
  cursor: pointer; text-decoration: none;
  transition: background 0.15s, box-shadow 0.15s, transform 0.15s;
}
.auth-otp-btn:hover {
  background: #f3f4f6;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}
.auth-otp-btn svg { flex-shrink: 0; opacity: 0.6; }

.auth-error {
  margin-top: 16px;
  font-size: 12px;
  color: var(--auth-error-text);
  background: var(--auth-error-bg);
  border: 1px solid var(--auth-error-border);
  border-radius: 6px;
  padding: 8px 12px;
  text-align: left;
}

.auth-info {
  margin-top: 4px;
  margin-bottom: 18px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--auth-text-2);
  background: var(--auth-accent-soft, rgba(0, 0, 0, 0.04));
  border: 1px solid var(--auth-accent-glow, rgba(0, 0, 0, 0.12));
  border-radius: 6px;
  padding: 10px 12px;
  text-align: left;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 18px;
  color: var(--auth-text-3);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--auth-border);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.auth-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--auth-text-2);
  margin-bottom: 2px;
}

.auth-input {
  width: 100%;
  padding: 11px 14px;
  background: var(--auth-bg);
  color: var(--auth-text);
  border: 1px solid var(--auth-border);
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-input:focus {
  outline: none;
  border-color: var(--auth-accent);
  box-shadow: 0 0 0 3px var(--auth-accent-glow, rgba(0, 0, 0, 0.12));
}

.auth-code-input {
  font-family: var(--ui-font-family-mono);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 8px;
  text-align: center;
  padding: 12px 14px;
}

.auth-submit-btn {
  margin-top: 4px;
  padding: 11px 20px;
  background: var(--auth-accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: filter 0.15s, transform 0.15s;
}
.auth-submit-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.auth-back {
  margin-top: 14px;
  font-size: 12px;
  text-align: center;
}
.auth-back a {
  color: var(--auth-text-3);
  text-decoration: none;
}
.auth-back a:hover {
  color: var(--auth-accent);
}

.auth-footer {
  margin-top: 28px;
  font-size: 11px;
  color: var(--auth-text-3);
}
