/* ══════════════════════════════════════════════════════════════
   auth.css — DiziFANS Auth Pages (Login, Register, Forgot, Reset)
   Shared design system for all authentication forms
   ══════════════════════════════════════════════════════════════ */

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

/* ── Page layout ─────────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(ellipse 120% 700px at 50% 0, #3d0a12 0%, #1a0308 40%, #0d0d14 100%) no-repeat fixed;
  font-family: 'Inter', sans-serif;
}

.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  position: relative;
  overflow: hidden;
}

/* Decorative blobs */
.auth-main::before,
.auth-main::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
.auth-main::before {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(244,63,94,.12) 0%, transparent 70%);
  top: -100px; right: -100px;
  animation: blobFloat 8s ease-in-out infinite;
}
.auth-main::after {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(139,92,246,.08) 0%, transparent 70%);
  bottom: -80px; left: -80px;
  animation: blobFloat 10s ease-in-out infinite reverse;
}

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

/* ── Auth card ───────────────────────────────────────────────────── */
.auth-card {
  width: 100%;
  max-width: 460px;
  background: rgba(20, 5, 10, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 24px;
  padding: 44px 40px;
  box-shadow: 0 24px 80px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,0.06);
  position: relative;
  z-index: 1;
}

@media (max-width: 520px) {
  .auth-card { padding: 32px 24px; border-radius: 18px; }
}

/* ── Logo ────────────────────────────────────────────────────────── */
.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}
.auth-logo a {
  font-size: 30px;
  font-weight: 900;
  color: #fff;
  text-decoration: none;
  letter-spacing: -1px;
}
.auth-logo a span { color: #f43f5e; }

/* ── Card header ─────────────────────────────────────────────────── */
.auth-title {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  text-align: center;
  margin: 0 0 6px;
  letter-spacing: -0.3px;
}
.auth-subtitle {
  font-size: 14px;
  color: rgba(255,255,255,.45);
  text-align: center;
  margin: 0 0 28px;
}

/* ── Google button ───────────────────────────────────────────────── */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 20px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  margin-bottom: 22px;
}
.btn-google:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.22);
  transform: translateY(-1px);
}
.btn-google svg { flex-shrink: 0; }

/* ── Divider ─────────────────────────────────────────────────────── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.08);
}
.auth-divider span {
  font-size: 12px;
  color: rgba(255,255,255,0.3);
  font-weight: 500;
}

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

.field-group { display: flex; flex-direction: column; gap: 6px; }

.field-label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.field-wrap { position: relative; }

.field-input {
  width: 100%;
  padding: 13px 16px;
  background: rgba(255,255,255,0.05);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  color: #fff;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}
.field-input::placeholder { color: rgba(255,255,255,0.2); }
.field-input:focus {
  border-color: #f43f5e;
  background: rgba(244,63,94,0.04);
  box-shadow: 0 0 0 3px rgba(244,63,94,.12);
}
.field-input.valid   { border-color: #22c55e; }
.field-input.invalid { border-color: #ef4444; }
.field-input.has-icon { padding-right: 46px; }

/* Eye / icon button */
.field-icon-btn {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255,255,255,0.35);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}
.field-icon-btn:hover { color: rgba(255,255,255,0.7); }

/* Validation messages */
.field-error {
  font-size: 12px;
  color: #f87171;
  min-height: 16px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.field-hint {
  font-size: 12px;
  color: rgba(255,255,255,0.3);
}

/* Password strength bar */
.pw-strength {
  height: 3px;
  border-radius: 3px;
  background: rgba(255,255,255,0.08);
  margin-top: 6px;
  overflow: hidden;
}
.pw-strength-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s, background 0.4s;
  width: 0%;
}
.pw-strength-bar.weak   { background: #ef4444; width: 33%; }
.pw-strength-bar.medium { background: #f59e0b; width: 66%; }
.pw-strength-bar.strong { background: #22c55e; width: 100%; }

/* Language select */
.field-select {
  width: 100%;
  padding: 13px 16px;
  background: rgba(255,255,255,0.05);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  color: #fff;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='rgba(255,255,255,.4)' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  box-sizing: border-box;
}
.field-select:focus { border-color: #f43f5e; box-shadow: 0 0 0 3px rgba(244,63,94,.12); }
.field-select option { background: #1a0308; color: #fff; }

/* Remember me / checkbox */
.field-checkbox {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
}
.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #f43f5e;
  cursor: pointer;
}
.forgot-link {
  font-size: 13px;
  color: #f43f5e;
  text-decoration: none;
  transition: opacity 0.2s;
  white-space: nowrap;
}
.forgot-link:hover { opacity: 0.8; text-decoration: underline; }

/* ── Submit button ───────────────────────────────────────────────── */
.btn-auth {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(244,63,94,0.35);
  position: relative;
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-auth:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(244,63,94,0.45);
}
.btn-auth:active:not(:disabled) { transform: translateY(0); }
.btn-auth:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* Loading spinner inside button */
.btn-spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}
.btn-auth.loading .btn-spinner { display: block; }
.btn-auth.loading .btn-text    { display: none; }

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

/* ── Alert / global message ─────────────────────────────────────── */
.auth-alert {
  padding: 13px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  display: none;
  align-items: center;
  gap: 8px;
  animation: slideDown 0.25s ease;
}
.auth-alert.show { display: flex; }
.auth-alert.error   { background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; }
.auth-alert.success { background: rgba(34,197,94,0.12); border: 1px solid rgba(34,197,94,0.3); color: #86efac; }
.auth-alert.info    { background: rgba(59,130,246,0.12); border: 1px solid rgba(59,130,246,0.3); color: #93c5fd; }

@keyframes slideDown {
  from { opacity:0; transform: translateY(-6px); }
  to   { opacity:1; transform: none; }
}

/* ── Footer link ─────────────────────────────────────────────────── */
.auth-footer-link {
  text-align: center;
  margin-top: 22px;
  font-size: 14px;
  color: rgba(255,255,255,0.4);
}
.auth-footer-link a {
  color: #f43f5e;
  text-decoration: none;
  font-weight: 600;
  margin-left: 4px;
}
.auth-footer-link a:hover { text-decoration: underline; }

/* ── Success state (forgot password) ────────────────────────────── */
.auth-success-box {
  text-align: center;
  padding: 8px 0;
  display: none;
}
.auth-success-box.show { display: block; animation: fadeIn 0.4s ease; }
.auth-success-icon { font-size: 56px; margin-bottom: 16px; }
.auth-success-title { font-size: 20px; font-weight: 800; color: #fff; margin: 0 0 10px; }
.auth-success-text  { font-size: 14px; color: rgba(255,255,255,.45); line-height: 1.7; }

@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }

/* ── Back link ───────────────────────────────────────────────────── */
.auth-back-link {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,0.4);
  font-size: 13px;
  text-decoration: none;
  margin-bottom: 24px;
  transition: color 0.2s;
}
.auth-back-link:hover { color: #fff; }

/* ── Honeypot (invisible) ────────────────────────────────────────── */
.auth-hp { position: absolute; left: -9999px; opacity: 0; pointer-events: none; }

/* ── Logout button (in navbar) ───────────────────────────────────── */
.nav-user-area {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-user-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  background: rgba(244,63,94,0.12);
  border: 1px solid rgba(244,63,94,0.25);
  border-radius: 20px;
  color: #f43f5e;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  font-family: inherit;
}
.nav-user-btn:hover { background: rgba(244,63,94,0.22); border-color: rgba(244,63,94,0.4); }
.nav-user-btn.logout { background: transparent; color: rgba(255,255,255,0.4); border-color: transparent; }
.nav-user-btn.logout:hover { color: #f87171; background: rgba(239,68,68,0.08); }

.nav-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #f43f5e;
}

/* ── Responsive tweaks ───────────────────────────────────────────── */
@media (max-width: 480px) {
  .auth-title    { font-size: 20px; }
  .auth-subtitle { font-size: 13px; }
  .field-checkbox { flex-direction: column; align-items: flex-start; gap: 8px; }
}
