/**
 * AUTH.CSS — Standard Consistent Redesign
 * Aesthetic: Aligned with Home/Ecosystem (Red/Green palette)
 */

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("../fonts/PlusJakartaSans-VariableFont_wght.ttf") format("truetype");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", -apple-system, sans-serif;
  color: var(--text-primary);
  background:
    radial-gradient(1100px 520px at 12% -18%, rgba(255, 71, 87, 0.12), transparent 62%),
    radial-gradient(900px 440px at 88% -10%, rgba(16, 185, 129, 0.12), transparent 60%),
    var(--bg-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Background consistent with index.html */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(500px 240px at 20% 22%, rgba(255, 71, 87, 0.08), transparent 70%),
    radial-gradient(500px 240px at 80% 78%, rgba(45, 212, 191, 0.08), transparent 70%);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 28px 28px;
}

.auth-layout {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 20px 20px;
  position: relative;
  z-index: 1;
}

.auth-card {
  margin-top: 100px;
  width: min(420px, 100%);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 22px 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.auth-hero {
  margin-bottom: 14px;
  display: flex;
  justify-content: center;
}

.auth-lottie {
  width: 112px;
  height: 82px;
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text-primary);
  text-align: center;
}

.auth-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0 0 16px;
  text-align: center;
}

/* Field standard aligned with pm-input */
.auth-field { margin-bottom: 16px; }

.auth-field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  margin-left: 2px;
}

.auth-field input {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 6px;
  outline: none;
  transition: all 0.2s;
  width: 100%;
  font-family: inherit;
}

.auth-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255, 71, 87, 0.1);
}

.auth-btn {
  width: 100%;
  margin-top: 12px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.auth-btn:hover {
  background: #ff6a7f;
  transform: translateY(-1px);
}

.auth-inline {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 16px;
}

.auth-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12px;
  transition: color 0.2s;
}

.auth-link:hover {
  color: var(--accent);
}

.auth-alert {
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 12px;
  border: 1px solid transparent;
}

.auth-alert.error {
  background: rgba(255, 71, 87, 0.08);
  color: var(--accent);
  border-color: rgba(255, 71, 87, 0.2);
}

.auth-alert.success {
  background: rgba(16, 185, 129, 0.08);
  color: var(--success);
  border-color: rgba(16, 185, 129, 0.2);
}

/* ── Google OAuth button ─────────────────────────────────────────────────── */

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 12px;
  color: var(--text-muted);
  font-size: 11px;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, transform 0.15s;
}
.auth-btn-google:hover {
  background: var(--bg-secondary);
  border-color: #4285F4;
  transform: translateY(-1px);
}
.auth-btn-google:active {
  transform: translateY(0);
}
.google-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Navbar overrides for Auth context */
#navbar-root {
    position: sticky;
    top: 0;
    z-index: 100;
}

#navbar-root + .auth-shell {
    margin-top: 0;
}

@media (max-width: 480px) {
  .auth-card {
    border: none;
    background: transparent;
    box-shadow: none;
    padding: 20px;
  }
}

/* ── Two-column row ──────────────────────────────────────── */
.auth-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ── Select input ────────────────────────────────────────── */
.auth-select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-tertiary, #1a1a2e);
    border: 1px solid var(--border, #2d2d44);
    border-radius: 6px;
    color: var(--text-primary, #e2e8f0);
    font-size: 14px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    transition: border-color 0.2s;
}

.auth-select:focus {
    outline: none;
    border-color: var(--accent, #e94560);
}

.auth-select option {
    background: var(--bg-secondary, #16213e);
    color: var(--text-primary, #e2e8f0);
}

/* ── Optional label hint ─────────────────────────────────── */
.auth-optional {
    font-size: 11px;
    color: var(--text-muted, #6b7280);
    font-weight: 400;
}

/* ── Password strength meter ─────────────────────────────── */
.auth-password-strength {
    height: 3px;
    background: var(--bg-tertiary, #1a1a2e);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}

.strength-bar {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    transition: width 0.25s ease, background-color 0.25s ease;
}

.strength-bar.weak    { width: 33%; background: #ef4444; }
.strength-bar.fair    { width: 66%; background: #f59e0b; }
.strength-bar.strong  { width: 100%; background: #10b981; }

.strength-label {
    font-size: 11px;
    margin-top: 4px;
    min-height: 14px;
    color: var(--text-muted, #6b7280);
    transition: color 0.2s;
}
.strength-label.weak    { color: #ef4444; }
.strength-label.fair    { color: #f59e0b; }
.strength-label.strong  { color: #10b981; }

/* ── Password match indicator ────────────────────────────── */
.auth-password-match {
    font-size: 11px;
    margin-top: 4px;
    min-height: 14px;
    color: var(--text-muted, #6b7280);
}
.auth-password-match.match    { color: #10b981; }
.auth-password-match.no-match { color: #ef4444; }

/* ── Checkbox field (terms) ───────────────────────────────── */
.auth-checkbox-field {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.auth-checkbox-field input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--accent, #ff4757);
    cursor: pointer;
    flex-shrink: 0;
}

.auth-checkbox-field label {
    font-size: 12px;
    color: var(--text-secondary, #9ca3af);
    cursor: pointer;
    margin: 0;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}
