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

:root {
  --bg: #0a0e1a;
  --surface: #111827;
  --surface2: #1f2937;
  --accent: #6366f1;
  --accent-light: #818cf8;
  --gold: #f59e0b;
  --text: #f9fafb;
  --muted: #9ca3af;
  --border: rgba(255,255,255,0.08);
  --danger: #f87171;
}

html, body {
  height: 100%;
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* ── LAYOUT ── */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── NAV ── */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 48px;
  border-bottom: 1px solid var(--border);
  background: rgba(10,14,26,0.8);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.logo span { color: var(--accent-light); }

/* ── HERO ── */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px 60px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(99,102,241,0.18) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(245,158,11,0.10) 0%, transparent 60%);
  pointer-events: none;
}

/* ── LOGIN CARD ── */
#login-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}

#login-section h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 24px;
}

/* ── FORM ── */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.field input {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  outline: none;
  transition: border-color .2s;
  width: 100%;
}

.field input:focus { border-color: var(--accent); }

.field input::placeholder { color: rgba(156,163,175,0.5); }

.password-wrap { position: relative; }

.password-wrap input { padding-right: 44px; }

.toggle-pw {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 16px;
  padding: 0;
  line-height: 1;
  transition: color .2s;
}
.toggle-pw:hover { color: var(--text); }

.btn-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: background .2s, transform .1s, opacity .2s;
  margin-top: 4px;
}

.btn-login:hover   { background: var(--accent-light); transform: translateY(-1px); }
.btn-login:active  { transform: translateY(0); }
.btn-login:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* ── SPINNER ── */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: none;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── ERROR ── */
.error-msg {
  margin-top: 14px;
  font-size: 13px;
  color: var(--danger);
  text-align: center;
  background: rgba(248,113,113,0.08);
  border: 1px solid rgba(248,113,113,0.2);
  border-radius: 8px;
  padding: 10px 12px;
  display: none;
  line-height: 1.5;
}

/* ── USER PANEL ── */
#user-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
  display: none;
  text-align: center;
}

.avatar-placeholder {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: linear-gradient(135deg, var(--accent), var(--gold));
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
}

#user-section h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

#user-email-display {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 28px;
}

.btn-dashboard {
  display: block;
  width: 100%;
  padding: 13px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: background .2s, transform .1s;
  margin-bottom: 10px;
  text-decoration: none;
  text-align: center;
}
.btn-dashboard:hover { background: var(--accent-light); transform: translateY(-1px); }

.btn-signout {
  display: block;
  width: 100%;
  padding: 12px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.btn-signout:hover { border-color: rgba(255,255,255,0.2); color: var(--text); }

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 20px;
  font-size: 12px;
  color: var(--muted);
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  nav { padding: 16px 20px; }
  #login-section, #user-section { padding: 28px 24px; }
}

@media (max-width: 480px) {
  .hero { padding: 60px 16px 40px; }
}
