/* ============================================================
   DRAFTLY LOGIN — NEBULA THEME
   Dark cosmic login page. Modular, self-contained.
   ============================================================ */

:root {
  --bg: #0b0c15;
  --bg-elevated: #11121f;
  --bg-card: #161827;
  --bg-card-hover: #1c1e32;
  --border: #252842;
  --border-light: #2e3150;
  --border-focus: #3a3d5e;
  --text: #e8eaf0;
  --text-secondary: #9ca3bf;
  --text-muted: #6b7194;
  --accent: #6c5ce7;
  --accent-light: rgba(108,92,231,0.12);
  --accent-glow: rgba(108,92,231,0.35);
  --saffron: #F9DB79;
  --saffron-hover: #fae291;
  --saffron-glow: rgba(249,219,121,0.15);
  --success: #00cec9;
  --danger: #ff6b6b;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --radius: 14px;
  --radius-sm: 10px;
  --transition: 0.25s cubic-bezier(0.4,0,0.2,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font); background: var(--bg); color: var(--text);
  line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden;
  min-height: 100vh; display: flex; flex-direction: column;
}

/* ---------- Ambient Background ---------- */
.ambient { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.35; animation: orbFloat 20s ease-in-out infinite; }
.orb-1 { width: 500px; height: 500px; background: rgba(108,92,231,0.25); top: -10%; left: -10%; animation-delay: 0s; }
.orb-2 { width: 400px; height: 400px; background: rgba(253,121,168,0.15); bottom: -10%; right: -10%; animation-delay: -7s; }
.orb-3 { width: 300px; height: 300px; background: rgba(249,219,121,0.1); top: 40%; left: 50%; animation-delay: -14s; }
@keyframes orbFloat { 0%,100% { transform: translate(0,0) scale(1); } 33% { transform: translate(30px,-20px) scale(1.05); } 66% { transform: translate(-20px,15px) scale(0.95); } }

.stars { position: absolute; inset: 0; background-image: radial-gradient(1.5px 1.5px at 20px 30px, rgba(255,255,255,0.15), transparent), radial-gradient(1px 1px at 50px 120px, rgba(255,255,255,0.1), transparent), radial-gradient(1.5px 1.5px at 80px 50px, rgba(255,255,255,0.12), transparent), radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.08), transparent), radial-gradient(1.5px 1.5px at 160px 20px, rgba(255,255,255,0.1), transparent), radial-gradient(1px 1px at 200px 150px, rgba(255,255,255,0.06), transparent), radial-gradient(1.5px 1.5px at 250px 90px, rgba(255,255,255,0.12), transparent), radial-gradient(1px 1px at 300px 60px, rgba(255,255,255,0.08), transparent), radial-gradient(1.5px 1.5px at 350px 180px, rgba(255,255,255,0.1), transparent), radial-gradient(1px 1px at 400px 40px, rgba(255,255,255,0.06), transparent), radial-gradient(1.5px 1.5px at 450px 130px, rgba(255,255,255,0.12), transparent), radial-gradient(1px 1px at 500px 100px, rgba(255,255,255,0.08), transparent); background-size: 550px 220px; animation: starsDrift 120s linear infinite; }
@keyframes starsDrift { from { background-position: 0 0; } to { background-position: 550px 220px; } }

/* ---------- Navigation ---------- */
.nav { position: relative; z-index: 10; }
.nav-container { max-width: 1200px; margin: 0 auto; padding: 20px 24px; display: flex; align-items: center; justify-content: space-between; }
.nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-icon { width: 32px; height: 32px; border-radius: 8px; background: linear-gradient(135deg, var(--accent), #a29bfe); display: flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; font-size: 15px; flex-shrink: 0; }
.brand-text { font-weight: 700; font-size: 17px; color: var(--text); letter-spacing: -0.3px; }
.nav-back { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); text-decoration: none; font-size: 14px; font-weight: 500; transition: color var(--transition); padding: 8px 14px; border-radius: 8px; }
.nav-back:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.nav-back svg { flex-shrink: 0; }

/* ---------- Main Login ---------- */
.login { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 24px; position: relative; z-index: 1; }
.login-card { position: relative; width: 100%; max-width: 440px; background: rgba(22,24,39,0.85); backdrop-filter: blur(24px); border: 1px solid var(--border); border-radius: 24px; padding: 40px 36px; box-shadow: 0 32px 80px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.02); overflow: hidden; }
.login-glow { position: absolute; top: -50%; left: 50%; transform: translateX(-50%); width: 200px; height: 200px; background: radial-gradient(circle, rgba(108,92,231,0.18), transparent 70%); pointer-events: none; }

.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 32px; }
.login-brand .brand-icon { width: 44px; height: 44px; border-radius: 12px; font-size: 20px; }
.brand-text-group { display: flex; flex-direction: column; }
.brand-text-group .brand-text { font-size: 20px; font-weight: 800; letter-spacing: -0.5px; }
.brand-tagline { font-size: 13px; color: var(--text-muted); font-weight: 500; margin-top: 2px; }

/* ---------- Toggle ---------- */
.login-toggle { position: relative; display: flex; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px; padding: 4px; margin-bottom: 28px; }
.toggle-btn { flex: 1; position: relative; z-index: 2; padding: 10px 16px; border: none; background: none; color: var(--text-muted); font-size: 14px; font-weight: 600; cursor: pointer; transition: color var(--transition); border-radius: 10px; font-family: inherit; }
.toggle-btn:hover { color: var(--text-secondary); }
.toggle-btn.active { color: var(--text); }
.toggle-pill { position: absolute; top: 4px; left: 4px; height: calc(100% - 8px); width: calc(50% - 4px); background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 10px; transition: transform var(--transition); z-index: 1; box-shadow: 0 2px 8px rgba(0,0,0,0.2); }
.login-toggle[data-mode="signup"] .toggle-pill { transform: translateX(100%); }

/* ---------- Forms ---------- */
.login-form { display: none; animation: fadeIn 0.3s ease; }
.login-form.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.form-input {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-elevated); color: var(--text); font-size: 15px; font-family: inherit;
  outline: none; transition: all var(--transition);
}
.form-input::placeholder { color: var(--text-muted); }
.form-input:hover { border-color: var(--border-light); }
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); background: var(--bg-card); }

.input-wrap { position: relative; }
.input-action {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  padding: 4px; display: flex; align-items: center; justify-content: center;
  transition: color var(--transition); border-radius: 6px;
}
.input-action:hover { color: var(--text-secondary); background: rgba(255,255,255,0.03); }
.input-action svg { display: block; }
.input-action .hidden { display: none; }

.form-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 10px; }
.form-link { color: var(--accent); text-decoration: none; font-size: 13px; font-weight: 600; transition: color var(--transition); }
.form-link:hover { color: #a29bfe; text-decoration: underline; }

/* Checkbox */
.checkbox { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; color: var(--text-secondary); font-weight: 500; user-select: none; }
.checkbox input { position: absolute; opacity: 0; width: 0; height: 0; }
.check-box { width: 18px; height: 18px; border-radius: 6px; border: 2px solid var(--border); background: var(--bg-elevated); display: flex; align-items: center; justify-content: center; transition: all var(--transition); flex-shrink: 0; }
.checkbox:hover .check-box { border-color: var(--border-light); }
.checkbox input:checked + .check-box { background: var(--accent); border-color: var(--accent); box-shadow: 0 2px 8px rgba(108,92,231,0.3); }
.checkbox input:checked + .check-box::after { content: '✓'; color: #fff; font-size: 10px; font-weight: 800; }
.check-label { line-height: 1.4; }
.check-label .form-link { font-size: inherit; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 28px; border-radius: 10px; font-size: 15px; font-weight: 700; border: none; cursor: pointer;
  transition: all var(--transition); font-family: inherit; text-decoration: none; line-height: 1;
}
.btn-primary {
  background: var(--saffron); color: #1a1a1a;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.5); background: var(--saffron-hover); }
.btn-glow { position: relative; }
.btn-glow::after {
  content: ''; position: absolute; inset: -2px; border-radius: 12px;
  background: linear-gradient(135deg, var(--saffron-glow), transparent 60%);
  z-index: -1; opacity: 0; transition: opacity var(--transition); filter: blur(8px);
}
.btn-glow:hover::after { opacity: 1; }
.w-full { width: 100%; }

/* Strength meter */
.strength-meter { margin-top: 10px; display: flex; align-items: center; gap: 10px; }
.strength-bar { flex: 1; height: 4px; background: var(--bg-elevated); border-radius: 2px; overflow: hidden; }
.strength-bar div { height: 100%; width: 0; border-radius: 2px; transition: width 0.3s ease, background var(--transition); }
.strength-bar.weak div { width: 33%; background: var(--danger); }
.strength-bar.fair div { width: 66%; background: var(--saffron); }
.strength-bar.strong div { width: 100%; background: var(--success); }
.strength-label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; transition: color var(--transition); }
.strength-meter.weak .strength-label { color: var(--danger); }
.strength-meter.fair .strength-label { color: var(--saffron); }
.strength-meter.strong .strength-label { color: var(--success); }

/* Divider */
.divider { display: flex; align-items: center; gap: 16px; margin: 24px 0; color: var(--text-muted); font-size: 13px; font-weight: 600; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* Social */
.social-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 24px; }
.social-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-elevated); color: var(--text); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all var(--transition); font-family: inherit;
}
.social-btn:hover { border-color: var(--border-light); background: var(--bg-card); transform: translateY(-1px); }
.social-btn svg { flex-shrink: 0; }

.login-note { text-align: center; font-size: 12px; color: var(--text-muted); font-weight: 500; line-height: 1.6; }

/* ---------- Footer ---------- */
.footer { position: relative; z-index: 1; padding: 24px; }
.footer-links { display: flex; justify-content: center; align-items: center; gap: 24px; flex-wrap: wrap; }
.footer-links a { color: var(--text-muted); text-decoration: none; font-size: 13px; font-weight: 500; transition: color var(--transition); }
.footer-links a:hover { color: var(--text); }

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  .login-card { padding: 32px 24px; border-radius: 20px; }
  .login-brand { margin-bottom: 24px; }
  .login-brand .brand-icon { width: 40px; height: 40px; font-size: 18px; }
  .brand-text-group .brand-text { font-size: 18px; }
  .toggle-btn { font-size: 13px; padding: 10px 12px; }
  .social-grid { grid-template-columns: 1fr; }
  .nav-container { padding: 16px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
