/* =============================================
   IlmAI - Shared Styles
   Used by all pages
   ============================================= */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #4F46E5;
  --primary-dark: #3730A3;
  --primary-light: #EEF2FF;
  --accent: #06B6D4;
  --success: #10B981;
  --success-dark: #065F46;
  --error: #EF4444;
  --error-dark: #991B1B;
  --warning: #F59E0B;
  --text: #1E1B4B;
  --text2: #6B7280;
  --text3: #9CA3AF;
  --bg: #F8F7FF;
  --card: #FFFFFF;
  --border: #E5E7EB;
  --primary-gradient: linear-gradient(135deg, #4F46E5, #6366F1);
}

body {
  font-family: 'Sora', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: -150px; right: -150px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(79,70,229,0.12) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  bottom: -100px; left: -100px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(6,182,212,0.10) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

/* ---- Card ---- */
.card {
  background: var(--card);
  border-radius: 24px;
  box-shadow: 0 4px 40px rgba(79,70,229,0.12);
  width: 100%;
  max-width: 480px;
  padding: 2.5rem;
  position: relative;
  z-index: 1;
  border: 1px solid rgba(79,70,229,0.08);
  animation: cardIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(28px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

/* ---- Logo ---- */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: 2rem;
  text-decoration: none;
}

.logo-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.logo-icon img { width: 22px; height: 22px; fill: white; }

.logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---- Headings ---- */
h2 {
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.4rem;
}

.subtitle {
  color: var(--text2);
  font-size: 0.875rem;
  text-align: center;
  margin-bottom: 1.8rem;
  line-height: 1.6;
}

/* ---- Form Fields ---- */
.form-scroll {
  max-height: 58vh;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field { margin-bottom: 1rem; }

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.inp-wrap { position: relative; }

.inp-wrap input,
.inp-wrap select {
  width: 100%;
  padding: 11px 14px 11px 40px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 0.9rem;
  font-family: 'Sora', 'Segoe UI', sans-serif;
  background: white;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.inp-wrap input:focus,
.inp-wrap select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.10);
}

.inp-wrap input.err { border-color: var(--error); background: #FFF5F5; }
.inp-wrap input.ok  { border-color: var(--success); }

.has-right-icon input { padding-right: 42px; }

.ico {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: var(--text3);
  pointer-events: none;
}

.eye-btn {
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  cursor: pointer; color: var(--text3);
  display: flex; align-items: center;
  padding: 4px;
  border-radius: 6px;
}

.eye-btn:hover { color: var(--primary); }

.err-msg {
  color: var(--error);
  font-size: 0.75rem;
  margin-top: 4px;
  display: none;
}

/* ---- Gender ---- */
.gender-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.gender-opt {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
  cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  font-size: 0.875rem;
  font-family: 'Sora', 'Segoe UI', sans-serif;
  font-weight: 500;
  transition: all 0.2s;
  background: white;
  color: var(--text);
}

.gender-opt.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

/* ---- Password Strength ---- */
.strength-bar {
  height: 4px; border-radius: 2px;
  background: var(--border);
  margin-top: 6px; overflow: hidden;
}

.strength-fill {
  height: 100%; border-radius: 2px;
  transition: width 0.4s, background 0.4s;
  width: 0%;
}

.strength-label { font-size: 0.72rem; margin-top: 3px; font-weight: 600; }

/* ---- Buttons ---- */
.btn {
  width: 100%;
  padding: 13px;
  border-radius: 12px;
  border: none;
  font-family: 'Sora', 'Segoe UI', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.btn-primary {
  background: var(--primary-gradient);
  color: white;
  box-shadow: 0 4px 14px rgba(79,70,229,0.35);
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(79,70,229,0.45); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-google {
  background: white;
  color: var(--text);
  border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: 10px;
}

.btn-google:hover { background: #F9FAFB; border-color: var(--primary); }

.btn-outline {
  background: white;
  color: var(--primary);
  border: 1.5px solid var(--primary);
  margin-top: 10px;
}

.btn-outline:hover { background: var(--primary-light); }

/* ---- Divider ---- */
.divider {
  display: flex; align-items: center; gap: 10px;
  margin: 1.2rem 0;
  color: var(--text3);
  font-size: 0.8rem;
}

.divider::before, .divider::after {
  content: ''; flex: 1;
  height: 1px; background: var(--border);
}

/* ---- Links ---- */
.center {
  text-align: center;
  margin-top: 1.2rem;
  color: var(--text2);
  font-size: 0.875rem;
}

.link-btn {
  background: none; border: none;
  color: var(--primary);
  font-family: 'Sora', 'Segoe UI', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.link-btn:hover { color: var(--primary-dark); }
.link-btn:disabled { color: var(--text3); text-decoration: none; cursor: default; }

/* ---- Icon Circle ---- */
.icon-circle {
  width: 78px; height: 78px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(79,70,229,0.12), rgba(6,182,212,0.12));
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.5rem;
}

/* ---- Alert Box ---- */
.alert-box {
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  line-height: 1.5;
  display: none;
}

.alert-box.error   { background: #FEF2F2; border: 1px solid #FECACA; color: #991B1B; }
.alert-box.warning { background: #FFFBEB; border: 1px solid #FDE68A; color: #92400E; }
.alert-box.success { background: #F0FDF4; border: 1px solid #BBF7D0; color: #065F46; }

/* ---- Info Box ---- */
.info-box {
  background: #F0FDF4;
  border: 1.5px solid #BBF7D0;
  border-radius: 14px;
  padding: 14px 16px;
  margin: 1rem 0;
  display: flex; gap: 12px; align-items: flex-start;
}

.info-box p { font-size: 0.82rem; color: #065F46; line-height: 1.6; }

/* ---- OTP Boxes ---- */
.otp-wrap { display: flex; gap: 10px; justify-content: center; margin: 1.5rem 0; }

.otp-box {
  width: 52px; height: 58px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 1.4rem; font-weight: 700;
  text-align: center;
  font-family: 'Sora', monospace;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: white;
  -webkit-appearance: none;
}

.otp-box:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,0.12); }
.otp-box.filled { border-color: var(--success); background: #F0FDF4; color: #065F46; }

/* ---- Spinner ---- */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Loading Overlay ---- */
.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(248,247,255,0.9);
  display: none;
  align-items: center; justify-content: center;
  z-index: 9998;
  backdrop-filter: blur(4px);
}

.loading-box {
  background: white;
  border-radius: 20px;
  padding: 2rem 2.5rem;
  text-align: center;
  box-shadow: 0 8px 40px rgba(79,70,229,0.15);
}

.big-spinner {
  width: 48px; height: 48px;
  border: 4px solid var(--primary-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

/* ---- Toast ---- */
.toast {
  position: fixed;
  top: 20px; right: 20px;
  padding: 14px 20px;
  border-radius: 14px;
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 9999;
  animation: toastIn 0.3s ease;
  max-width: 340px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.toast.success { background: #065F46; color: white; }
.toast.error   { background: #991B1B; color: white; }
.toast.info    { background: #1E1B4B; color: white; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: none; }
}

/* ---- Screen toggle ---- */
.screen       { display: none; }
.screen.active { display: block; }

/* ---- Responsive ---- */
@media (max-width: 500px) {
  .card { padding: 1.8rem 1.5rem; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .otp-box { width: 44px; height: 50px; font-size: 1.2rem; }
}