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

/* ─── Google Fonts ──────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ─── Page shell ────────────────────────────────── */
body.auth-page {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: #fff;
  background:
    radial-gradient(ellipse 900px 600px at 10% 5%,  rgba(59,130,246,0.12), transparent 65%),
    radial-gradient(ellipse 700px 500px at 92% 10%, rgba(139,92,246,0.12), transparent 65%),
    radial-gradient(ellipse 600px 400px at 50% 90%, rgba(99,102,241,0.07), transparent 70%),
    linear-gradient(170deg, #050510 0%, #000000 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

/* ─── Card ──────────────────────────────────────── */
.auth-wrap {
  width: min(460px, 100%);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 24px;
  padding: 40px 36px;
  box-shadow:
    0 32px 80px rgba(0,0,0,0.6),
    0 0 0 1px rgba(255,255,255,0.04) inset;
  backdrop-filter: blur(20px) saturate(160%);
  animation: fadeUp 0.35s ease both;
}

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

/* ─── Logo / brand mark ─────────────────────────── */
.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  font-size: 17px;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  letter-spacing: 0.2px;
}
.auth-brand-dot {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  flex-shrink: 0;
}

/* ─── Headings ──────────────────────────────────── */
.auth-wrap h1 {
  margin: 0 0 6px;
  font-size: clamp(26px, 3.5vw, 32px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.4px;
}

.auth-subtitle {
  margin: 0 0 24px;
  color: rgba(255,255,255,0.55);
  font-size: 15px;
  line-height: 1.5;
}

/* ─── Alert ─────────────────────────────────────── */
.auth-alert {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.28);
  color: #fca5a5;
  padding: 12px 15px;
  border-radius: 12px;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.5;
}
.auth-alert ul {
  margin: 0;
  padding-left: 16px;
}

/* ─── Form fields ───────────────────────────────── */
.auth-field {
  margin-bottom: 14px;
}

label {
  display: block;
  margin: 0 0 7px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.05);
  color: #fff;
  font-size: 15px;
  font-family: inherit;
  line-height: 1.4;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}
input[type="email"]::placeholder,
input[type="password"]::placeholder,
input[type="text"]::placeholder {
  color: rgba(255,255,255,0.3);
}
input[type="email"]:focus,
input[type="password"]:focus,
input[type="text"]:focus {
  outline: none;
  border-color: rgba(99,102,241,0.7);
  background: rgba(255,255,255,0.07);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.18);
}

/* ─── Primary button ────────────────────────────── */
button[type="submit"], .auth-btn {
  width: 100%;
  margin-top: 20px;
  padding: 14px 20px;
  border: none;
  border-radius: 13px;
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 55%, #8b5cf6 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  letter-spacing: 0.1px;
  box-shadow: 0 6px 22px rgba(99,102,241,0.32);
  transition: transform 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
  position: relative;
  overflow: hidden;
}
button[type="submit"]::after, .auth-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background 150ms ease;
}
button[type="submit"]:hover::after, .auth-btn:hover::after {
  background: rgba(255,255,255,0.07);
}
button[type="submit"]:hover, .auth-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(99,102,241,0.42);
}
button[type="submit"]:active, .auth-btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(99,102,241,0.24);
}

/* Loading state */
button[type="submit"].btn-loading,
.auth-btn.btn-loading {
  opacity: 0.75;
  pointer-events: none;
  cursor: not-allowed;
}
@keyframes auth-spin {
  to { transform: rotate(360deg); }
}
.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-spin 0.65s linear infinite;
  flex-shrink: 0;
}

/* ─── Secondary link-button (Google, back links) ── */
.auth-link-btn {
  width: 100%;
  margin-top: 14px;
  padding: 13px 20px;
  border-radius: 13px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.14);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  transition: background 150ms ease, transform 150ms ease;
}
.auth-link-btn:hover {
  background: rgba(255,255,255,0.12);
  transform: translateY(-1px);
}

/* ─── Google button override ────────────────────── */
.auth-google {
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.08);
  color: #1f2937;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}
.auth-google:hover {
  background: #f5f5f5;
  color: #1f2937;
}
.auth-google .google-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  flex-shrink: 0;
}
.auth-google .google-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* ─── Divider ───────────────────────────────────── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: rgba(255,255,255,0.3);
  font-size: 13px;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.1);
}

/* ─── Footer links ──────────────────────────────── */
.auth-muted {
  margin-top: 18px;
  text-align: center;
  font-size: 14px;
  color: rgba(255,255,255,0.45);
}
.auth-muted a {
  color: #818cf8;
  text-decoration: none;
  font-weight: 500;
  transition: color 120ms ease;
}
.auth-muted a:hover { color: #a5b4fc; text-decoration: underline; }

/* Forgot password link (inline, smaller) */
.auth-forgot {
  text-align: right;
  font-size: 13px;
  margin-top: 6px;
}
.auth-forgot a {
  color: #818cf8;
  text-decoration: none;
}
.auth-forgot a:hover { text-decoration: underline; }

/* ─── Success state ─────────────────────────────── */
.auth-success-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(34,197,94,0.2), rgba(16,185,129,0.15));
  border: 1px solid rgba(34,197,94,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 18px;
}
.auth-wrap.auth-success h1 {
  font-size: 24px;
  margin-bottom: 10px;
}
.auth-success p {
  margin: 0 0 12px;
  color: rgba(255,255,255,0.7);
  font-size: 15px;
  line-height: 1.6;
}

/* ─── Reenviar link ─────────────────────────────── */
.auth-resend-form button {
  width: auto;
  padding: 10px 18px;
  font-size: 14px;
  min-height: 40px;
  margin-top: 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: none;
}
.auth-resend-form button:hover { background: rgba(255,255,255,0.14); }

/* ─── Responsive ────────────────────────────────── */
@media (max-width: 480px) {
  body.auth-page { padding: 16px; }
  .auth-wrap { padding: 28px 20px; border-radius: 20px; }
  .auth-wrap h1 { font-size: 24px; }
}
