/* =============================================
   VOTONN — login.css
   Dark editorial · Bebas Neue + DM Sans
   ============================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink:        #0a0b0f;
  --ink-2:      #13151d;
  --ink-3:      #1e2130;
  --surface:    #ffffff;
  --muted:      #8891a8;
  --muted-2:    #5a6278;
  --accent:     #3b6cf4;
  --accent-h:   #2d5ce0;
  --accent-glow:rgba(59,108,244,0.22);
  --danger:     #e84545;
  --success:    #2dd4a0;
  --warn:       #f5a623;
  --border:     rgba(255,255,255,0.07);
  --card-bg:    rgba(19,21,29,0.95);
  --font-display: 'Bebas Neue', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --radius:     14px;
  --shadow:     0 24px 60px rgba(0,0,0,0.5);
}

html, body {
  height: 100%;
  font-family: var(--font-body);
  background: var(--ink);
  color: var(--surface);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Animated background ── */
.bg-grid {
  position: fixed; inset: 0; z-index: 0;
  background-image:
    linear-gradient(rgba(59,108,244,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,108,244,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  animation: gridDrift 30s linear infinite;
}
@keyframes gridDrift {
  from { background-position: 0 0; }
  to   { background-position: 48px 48px; }
}

.bg-glow {
  position: fixed; inset: 0; z-index: 0;
  background: radial-gradient(ellipse 60% 60% at 20% 50%, rgba(59,108,244,0.12) 0%, transparent 70%),
              radial-gradient(ellipse 40% 40% at 80% 20%, rgba(59,108,244,0.07) 0%, transparent 70%);
  pointer-events: none;
}

/* ── Layout ── */
.page-wrap {
  position: relative; z-index: 1;
  display: flex;
  min-height: 100vh;
}

/* ── Brand panel (left) ── */
.brand-panel {
  flex: 0 0 44%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 52px;
  border-right: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(59,108,244,0.06) 0%, transparent 60%);
  position: relative;
  overflow: hidden;
}

.brand-panel::before {
  content: '';
  position: absolute;
  top: -120px; left: -80px;
  width: 420px; height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59,108,244,0.15), transparent 70%);
  pointer-events: none;
}

.brand-top {
  display: flex;
  align-items: center;
  gap: 2px;
}

.logo-mark {
  font-family: var(--font-display);
  font-size: 2.6rem;
  line-height: 1;
  background: linear-gradient(135deg, var(--accent), #7ba4ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 2.6rem;
  line-height: 1;
  letter-spacing: 0.06em;
  color: var(--surface);
}

.brand-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 24px;
}

.brand-headline {
  font-family: var(--font-display);
  font-size: clamp(4rem, 6vw, 6.5rem);
  line-height: 0.95;
  letter-spacing: 0.02em;
  color: var(--surface);
  margin-bottom: 28px;
}

.brand-headline::after {
  content: '';
  display: block;
  width: 56px; height: 4px;
  background: var(--accent);
  margin-top: 20px;
  border-radius: 2px;
}

.brand-sub {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--muted);
  font-weight: 300;
  max-width: 280px;
}

.brand-bottom {
  display: flex;
  align-items: center;
  gap: 28px;
}

.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-num {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 0.03em;
  color: var(--surface);
}
.stat-label {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.stat-divider {
  width: 1px; height: 40px;
  background: var(--border);
}

/* ── Form panel (right) ── */
.form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
}

.form-card {
  width: 100%;
  max-width: 420px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 44px 40px;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  animation: cardIn 0.5s cubic-bezier(0.16,1,0.3,1) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.form-header { margin-bottom: 32px; }
.form-title {
  font-family: var(--font-display);
  font-size: 2.2rem;
  letter-spacing: 0.03em;
  color: var(--surface);
  margin-bottom: 6px;
}
.form-sub {
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 300;
}

/* ── Google button wrapper (renderButton renders inside this div) ── */
.google-btn-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  margin-bottom: 4px;
}
/* Make Google's iframe fill the card width */
.google-btn-wrap > div { width: 100% !important; }
.google-btn-wrap iframe { border-radius: 10px !important; }

/* ── Divider ── */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: var(--muted-2);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Form fields ── */
.field-group { margin-bottom: 18px; }
.field-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.field-wrap { position: relative; }
.field-icon {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--muted-2);
  pointer-events: none;
  transition: color 0.2s;
}
.field-input {
  width: 100%;
  padding: 13px 44px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: var(--surface);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  outline: none;
}
.field-input::placeholder { color: var(--muted-2); font-weight: 300; }
.field-input:focus {
  border-color: var(--accent);
  background: rgba(59,108,244,0.06);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.field-input:focus + .field-icon,
.field-wrap:focus-within .field-icon { color: var(--accent); }

/* invalid state */
.field-input.invalid { border-color: var(--danger); }
.field-input.invalid:focus { box-shadow: 0 0 0 3px rgba(232,69,69,0.2); }
.field-error {
  display: block;
  font-size: 0.76rem;
  color: var(--danger);
  margin-top: 5px;
  min-height: 16px;
}

/* Eye toggle */
.eye-btn {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  cursor: pointer;
  color: var(--muted-2);
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  transition: color 0.2s;
}
.eye-btn:hover { color: var(--surface); }
.eye-btn svg { width: 16px; height: 16px; }

/* ── Password strength ── */
.strength-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.strength-bar {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  overflow: hidden;
}
.strength-fill {
  height: 100%;
  width: 0%;
  border-radius: 4px;
  transition: width 0.3s ease, background 0.3s ease;
}
.strength-label {
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
  min-width: 60px;
  text-align: right;
}

/* strength levels */
.strength-fill[data-level="1"] { width: 25%; background: var(--danger); }
.strength-fill[data-level="2"] { width: 50%; background: var(--warn); }
.strength-fill[data-level="3"] { width: 75%; background: #82c7ff; }
.strength-fill[data-level="4"] { width: 100%; background: var(--success); }

/* ── Forgot row ── */
.forgot-row {
  display: flex;
  justify-content: flex-end;
  margin: -6px 0 20px;
}
.forgot-link {
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}
.forgot-link:hover { color: #7ba4ff; }

/* ── Submit button ── */
.submit-btn {
  width: 100%;
  padding: 14px 20px;
  background: var(--accent);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
}
.submit-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.12), transparent);
  pointer-events: none;
}
.submit-btn:hover {
  background: var(--accent-h);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(59,108,244,0.4);
}
.submit-btn:active { transform: translateY(0); }
.submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* Spinner */
.btn-spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Signup link ── */
.signup-link {
  text-align: center;
  font-size: 0.84rem;
  color: var(--muted);
  margin-top: 20px;
  font-weight: 300;
}
.signup-link a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.signup-link a:hover { text-decoration: underline; }

/* ── reCAPTCHA notice ── */
.captcha-notice {
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted-2);
  margin-top: 20px;
  line-height: 1.5;
}
.captcha-notice a { color: var(--muted); text-decoration: none; }
.captcha-notice a:hover { color: var(--surface); }

/* ── Responsive ── */
@media (max-width: 860px) {
  .page-wrap { flex-direction: column; }
  .brand-panel {
    flex: none;
    padding: 32px 28px 28px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .brand-headline { font-size: 3.6rem; }
  .brand-body { padding-top: 8px; }
  .brand-bottom { margin-top: 20px; }
  .form-card { padding: 32px 28px; }
}
@media (max-width: 480px) {
  .brand-panel {
    padding: 24px 16px;
  }
  .brand-headline { font-size: 2.6rem; }
  .form-panel {
    padding: 16px 8px;
  }
  .form-card { 
    padding: 24px 16px; 
    border-radius: 14px; 
  }
}