:root {
  --bg: #f8f9fa;
  --card: #ffffff;
  --ink: #1a1a2e;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --error: #dc2626;
  --success: #059669;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, "Segoe UI", Roboto, system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(135deg, #eef2ff 0%, #f8f9fa 40%, #f0fdf4 100%);
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.auth-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 20px;
}

.auth-header {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo {
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.5px;
}
.auth-logo:hover { text-decoration: none; }

.auth-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.auth-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  width: 100%;
  max-width: 420px;
  padding: 32px 28px;
}

.auth-tabs {
  display: flex;
  border-bottom: 2px solid var(--line);
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  padding: 10px 0;
  background: none;
  border: none;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s;
}
.auth-tab:hover { color: var(--ink); }

.auth-tab-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.auth-tab-active:hover { color: var(--accent); }

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

.auth-form-hidden { display: none; }

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

.field span {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.field input {
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  font-size: 15px;
  color: var(--ink);
  background: var(--bg);
  transition: border-color 0.15s;
}
.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn {
  padding: 11px 20px;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.auth-feedback {
  margin: 0;
  font-size: 13px;
  min-height: 20px;
  display: none;
}

.auth-feedback.is-visible { display: block; }

.auth-feedback[data-mode="error"] { color: var(--error); }
.auth-feedback[data-mode="success"] { color: var(--success); }
.auth-feedback[data-mode="idle"] { color: var(--muted); }

.auth-footer-text {
  margin: 20px 0 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

/* Checkbox fields */
.field-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
  cursor: pointer;
}
.field-checkbox input[type="checkbox"] {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  flex-shrink: 0;
}
.field-checkbox a {
  color: var(--accent);
  text-decoration: underline;
}
.field-checkbox strong {
  color: var(--ink);
}

@media (max-width: 480px) {
  .auth-card { padding: 24px 18px; }
}

/* ── Shared FreeSurf footer ── */
.freesurf-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 40px 24px 24px;
  margin-top: 48px;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
}

.freesurf-footer-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}

.freesurf-footer-brand { max-width: 300px; }

.freesurf-footer-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--brand);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.freesurf-footer-tagline {
  margin: 8px 0 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.freesurf-footer-links {
  display: flex;
  gap: 48px;
  flex-wrap: wrap;
}

.freesurf-footer-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.freesurf-footer-heading {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.freesurf-footer-col a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}
.freesurf-footer-col a:hover { color: var(--brand); }

.freesurf-footer-bottom {
  max-width: 960px;
  margin: 28px auto 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .freesurf-footer-inner { flex-direction: column; gap: 24px; }
  .freesurf-footer-bottom { flex-direction: column; text-align: center; }
}
