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

:root {
  --bg: #0f0f13;
  --surface: #18181f;
  --surface-2: #1e1e27;
  --border: #2a2a36;
  --border-focus: #6c63ff;
  --text: #e8e8f0;
  --text-muted: #888899;
  --accent: #6c63ff;
  --accent-hover: #7c74ff;
  --accent-soft: rgba(108, 99, 255, 0.12);
  --danger: #ff5a7e;
  --danger-soft: rgba(255, 90, 126, 0.1);
  --radius: 10px;
  --radius-sm: 7px;
}

html { font-size: 15px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

/* Subtle background pattern */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(108, 99, 255, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 110%, rgba(108, 99, 255, 0.05) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.auth-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
}

/* Card */
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 40px 36px 36px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

@media (max-width: 480px) {
  .auth-card { padding: 32px 24px 28px; }
}

/* Logo */
.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 30px;
}

.auth-logo svg {
  width: 20px;
  height: 20px;
  color: var(--accent);
}

/* Headings */
.auth-card h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  text-align: center;
  margin-bottom: 6px;
}

.auth-sub {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 28px;
  line-height: 1.5;
}

/* Google button */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px 16px;
  background: #ffffff;
  color: #3c4043;
  border: 1px solid #dadce0;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  margin-bottom: 22px;
  letter-spacing: 0.01em;
}

.btn-google:hover {
  background: #f8f9fa;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-google:active { background: #f1f3f4; }

.btn-google svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn-google.hidden { display: none; }

/* Divider */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-bottom: 22px;
}

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

/* Fields */
.field {
  margin-bottom: 15px;
}

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.input-wrap {
  position: relative;
}

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  padding: 10px 13px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
}

input[type="email"]:focus,
input[type="password"]:focus,
input[type="text"]:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

input::placeholder { color: var(--text-muted); opacity: 0.45; }

.pw-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.12s;
}

.pw-toggle svg { width: 16px; height: 16px; }
.pw-toggle:hover { color: var(--text); }

input.has-toggle { padding-right: 38px; }

/* Error banner */
.error-banner {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  background: var(--danger-soft);
  border: 1px solid rgba(255, 90, 126, 0.25);
  color: var(--danger);
  font-size: 0.82rem;
  line-height: 1.45;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.error-banner svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px; }
.error-banner.hidden { display: none; }

/* Submit button */
.btn-primary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 11px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, opacity 0.15s;
  margin-top: 2px;
  letter-spacing: 0.01em;
}

.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-primary .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Footer link */
.auth-footer {
  text-align: center;
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-top: 22px;
}

.auth-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.auth-footer a:hover { text-decoration: underline; }

/* Strength meter */
.pw-strength {
  margin-top: 6px;
  display: flex;
  gap: 4px;
  align-items: center;
}

.strength-bar {
  flex: 1;
  height: 3px;
  border-radius: 99px;
  background: var(--border);
  transition: background 0.25s;
}

.strength-bar.weak   { background: var(--danger); }
.strength-bar.fair   { background: #f59e0b; }
.strength-bar.strong { background: #4ade80; }

.strength-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  min-width: 40px;
  text-align: right;
}
