/* ─── Variables ──────────────────────────────────────────────────────────────── */
:root {
  --bg:           #0c0c12;
  --bg-card:      #13131c;
  --bg-input:     #1a1a26;
  --bg-hover:     #1f1f2e;
  --accent:       #f0c040;
  --accent-glow:  rgba(240, 192, 64, 0.25);
  --accent-dim:   rgba(240, 192, 64, 0.12);
  --blue:         #7289da;
  --green:        #3ba55d;
  --red:          #ed4245;
  --text:         #e8e8f2;
  --text-muted:   #7878a0;
  --text-faint:   #4a4a62;
  --border:       rgba(255,255,255,0.07);
  --radius:       12px;
  --radius-sm:    8px;
  --shadow:       0 24px 64px rgba(0,0,0,0.6);
  --transition:   0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

/* ─── Animated background blobs ─────────────────────────────────────────────── */
.bg-blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.12;
  pointer-events: none;
  animation: blobFloat 12s ease-in-out infinite;
}
.blob-1 { width: 500px; height: 500px; background: var(--accent); top: -150px; left: -150px; animation-delay: 0s; }
.blob-2 { width: 400px; height: 400px; background: #7289da; bottom: -100px; right: -100px; animation-delay: 4s; }
.blob-3 { width: 300px; height: 300px; background: #43b581; top: 50%; left: 50%; transform: translate(-50%,-50%); animation-delay: 8s; }

@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(20px, -20px) scale(1.05); }
  66%       { transform: translate(-15px, 15px) scale(0.97); }
}

/* ─── Layout ─────────────────────────────────────────────────────────────────── */
.auth-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  z-index: 1;
}

/* ─── Brand ──────────────────────────────────────────────────────────────────── */
.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
  animation: fadeSlideDown 0.6s ease both;
}

.duck-logo {
  filter: drop-shadow(0 4px 20px rgba(240, 192, 64, 0.4));
}

.brand-text { display: flex; flex-direction: column; }
.brand-name {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
  line-height: 1;
}
.brand-accent { color: var(--accent); }
.brand-sub {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* ─── Card ───────────────────────────────────────────────────────────────────── */
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  box-shadow: var(--shadow);
  animation: fadeSlideUp 0.6s ease both 0.1s;
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(240,192,64,0.3), transparent);
}

/* ─── Tab switcher ───────────────────────────────────────────────────────────── */
.tab-switcher {
  display: flex;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 28px;
  position: relative;
}

.tab-btn {
  flex: 1;
  padding: 9px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  transition: color var(--transition);
  position: relative;
  z-index: 1;
}
.tab-btn.active { color: var(--text); }

.tab-indicator {
  position: absolute;
  top: 4px; bottom: 4px;
  width: calc(50% - 4px);
  background: var(--bg-hover);
  border-radius: 6px;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--border);
  left: 4px;
}
.tab-indicator.right { transform: translateX(calc(100% + 0px)); }

/* ─── Alert ──────────────────────────────────────────────────────────────────── */
.alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 20px;
  animation: fadeSlideDown 0.3s ease both;
  display: flex;
  align-items: center;
  gap: 8px;
}
.alert.error   { background: rgba(237,66,69,0.12); border: 1px solid rgba(237,66,69,0.25); color: #f28b8d; }
.alert.success { background: rgba(59,165,93,0.12); border: 1px solid rgba(59,165,93,0.25); color: #6cd999; }

/* ─── Form ───────────────────────────────────────────────────────────────────── */
.auth-form { display: flex; flex-direction: column; gap: 18px; }

.input-group { display: flex; flex-direction: column; gap: 7px; }

.input-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 13px;
  color: var(--text-faint);
  pointer-events: none;
  transition: color var(--transition);
}

.input-wrapper:focus-within .input-icon { color: var(--accent); }

.input-wrapper input {
  width: 100%;
  padding: 11px 40px 11px 38px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.input-wrapper input::placeholder { color: var(--text-faint); }

.input-wrapper input:focus {
  border-color: rgba(240,192,64,0.4);
  box-shadow: 0 0 0 3px var(--accent-dim);
  background: var(--bg-hover);
}

.toggle-pw {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color var(--transition);
}
.toggle-pw:hover { color: var(--text-muted); }

.input-hint {
  font-size: 11px;
  color: var(--text-faint);
}

/* ─── Password strength ──────────────────────────────────────────────────────── */
.password-strength { display: flex; align-items: center; gap: 10px; }

.strength-bar {
  flex: 1;
  height: 3px;
  background: var(--bg-input);
  border-radius: 2px;
  overflow: hidden;
}

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

#strengthLabel { font-size: 11px; color: var(--text-faint); white-space: nowrap; }

/* ─── Primary button ─────────────────────────────────────────────────────────── */
.btn-primary {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: #1a1400;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--transition);
}

.btn-primary:hover:not(:disabled) {
  background: #ffd357;
  box-shadow: 0 4px 20px rgba(240,192,64,0.4);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: none;
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-loader { display: flex; align-items: center; }

/* ─── Footer note ────────────────────────────────────────────────────────────── */
.footer-note {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 24px;
  text-align: center;
  max-width: 340px;
  line-height: 1.6;
  animation: fadeSlideUp 0.6s ease both 0.3s;
}

/* ─── Animations ─────────────────────────────────────────────────────────────── */
@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.spin { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-height: 700px) {
  html, body { overflow: auto; }
  .auth-container { padding: 40px 24px; }
}
