@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --bg-base:        #000000;
  --bg-card:        rgba(255, 255, 255, 0.05);
  --border:         rgba(255, 255, 255, 0.12);
  --border-focus:   rgba(155, 153, 254, 0.6);
  --accent-1:       #9B99FE;
  --accent-2:       #2BC8B7;
  --accent-3:       #2BC8B7;
  --text-primary:   #ffffff;
  --text-muted:     #a1a1aa;
  --error-bg:       rgba(239, 68, 68, 0.12);
  --error-color:    #f87171;
  --success-bg:     rgba(52, 211, 153, 0.12);
  --success-color:  #34d399;
  --input-bg:       rgba(255, 255, 255, 0.05);
  --input-hover:    rgba(255, 255, 255, 0.08);
  --btn-gradient:   linear-gradient(135deg, #9B99FE 0%, #2BC8B7 100%);
  --glow:           0 0 40px rgba(155, 153, 254, 0.15);
}

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

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

/* ── ANIMATED BACKGROUND ── */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.bg-gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(155, 153, 254, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(43, 200, 183, 0.14) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 50% 50%, rgba(155, 153, 254, 0.06) 0%, transparent 70%);
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 40%, transparent 100%);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: float 8s ease-in-out infinite;
}

.orb-1 {
  width: 400px; height: 400px;
  top: -150px; left: -100px;
  background: radial-gradient(circle, rgba(155,153,254,0.18), transparent 70%);
  animation-delay: 0s;
}

.orb-2 {
  width: 500px; height: 500px;
  bottom: -200px; right: -150px;
  background: radial-gradient(circle, rgba(43,200,183,0.2), transparent 70%);
  animation-delay: -4s;
}

.orb-3 {
  width: 300px; height: 300px;
  top: 50%; left: 60%;
  background: radial-gradient(circle, rgba(155,153,254,0.10), transparent 70%);
  animation-delay: -2s;
}

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-30px) scale(1.05); }
}

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

/* ── CARD ── */
.card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 44px 40px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04) inset,
    0 32px 64px rgba(0,0,0,0.4),
    var(--glow);
  animation: cardIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── LOGO ── */
.logo {
  text-align: center;
  margin-bottom: 36px;
}

.logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, rgba(155,153,254,0.2), rgba(43,200,183,0.2));
  border: 1px solid rgba(155,153,254,0.3);
  border-radius: 16px;
  font-size: 26px;
  margin-bottom: 16px;
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(155,153,254,0.2); }
  50%       { box-shadow: 0 0 0 8px rgba(155,153,254,0); }
}

.logo h1 {
  font-family: 'Inter', sans-serif;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 30%, var(--accent-1) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 5px;
  letter-spacing: 0.3px;
}

/* ── FLASH MESSAGES ── */
.flash {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 13.5px;
  font-weight: 500;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.flash.error   { background: var(--error-bg);   color: var(--error-color);   border: 1px solid rgba(239,68,68,0.2); }
.flash.success { background: var(--success-bg); color: var(--success-color); border: 1px solid rgba(52,211,153,0.2); }

/* ── FORM ── */
.form-group {
  margin-bottom: 18px;
}

label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.input-wrap {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
  pointer-events: none;
  transition: color 0.2s;
}

input {
  width: 100%;
  padding: 13px 14px 13px 42px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color: var(--text-primary);
  outline: none;
  transition: all 0.25s ease;
  caret-color: var(--accent-1);
}

input::placeholder { color: rgba(240,244,255,0.25); }

input:hover {
  background: var(--input-hover);
  border-color: rgba(255,255,255,0.14);
}

input:focus {
  background: rgba(155, 153, 254, 0.06);
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(155,153,254,0.1);
}

input:focus + .input-icon,
.input-wrap:focus-within .input-icon {
  color: var(--accent-1);
}

.toggle-password {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  transition: color 0.2s;
  width: auto;
}

.toggle-password:hover { color: var(--accent-1); background: none; box-shadow: none; }

/* ── BUTTON ── */
button[type="submit"] {
  width: 100%;
  padding: 14px;
  background: var(--btn-gradient);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.3px;
  margin-top: 8px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

button[type="submit"]::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(155,153,254,0.4);
}

button[type="submit"]:hover::before { opacity: 1; }
button[type="submit"]:active { transform: translateY(0); }

/* loading state */
button[type="submit"].loading {
  pointer-events: none;
  opacity: 0.8;
}

/* ── DIVIDER ── */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 20px;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.divider span {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

/* ── FOOTER ── */
.footer-text {
  text-align: center;
  font-size: 13.5px;
  color: var(--text-muted);
}

.footer-text a {
  color: var(--accent-1);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.footer-text a:hover { color: #b8b6ff; }

/* ── BADGE ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(155,153,254,0.1);
  border: 1px solid rgba(155,153,254,0.2);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11px;
  color: var(--accent-1);
  margin-bottom: 12px;
  letter-spacing: 0.3px;
}

.badge-dot {
  width: 6px;
  height: 6px;
  background: #9B99FE;
  border-radius: 50%;
  animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

/* ── Global SVG Sizing & Alignment ── */
svg:not([width="0"]):not([height="0"]) {
  width: 1.25em;
  height: 1.25em;
  vertical-align: middle;
}
