/* ============================================================
   ABUGIDA PAGES
   Landing, Auth, Dashboard-specific
   ============================================================ */

/* ============================================================
   1. PAGE VISIBILITY
   ============================================================ */
.page { display: none; min-height: 100vh; }
.page.active { display: block; }
.page-auth { padding-top: var(--header-height); }
.page-dashboard { padding-top: 0; }

/* ============================================================
   2. LANDING — HERO
   ============================================================ */
.hero {
  min-height: calc(100vh - var(--header-height));
  display: flex;
  align-items: center;
  padding: var(--space-16) var(--space-6) var(--space-12);
}
.hero-inner {
  max-width: var(--max-content-width);
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  align-items: center;
}
.hero-content { max-width: 560px; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.375rem 0.875rem;
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  margin-bottom: var(--space-6);
}
.hero-badge-dot {
  width: 6px;
  height: 6px;
  background: var(--color-success);
  border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.hero-title {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: var(--space-6);
  color: var(--color-text-primary);
}
.hero-title-accent {
  background: linear-gradient(135deg, var(--color-primary), #7C3AED);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-8);
  max-width: 480px;
}
.hero-actions {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-10);
}
.hero-stats {
  display: flex;
  gap: var(--space-8);
}
.hero-stat { display: flex; flex-direction: column; }
.hero-stat-value {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text-primary);
}
.hero-stat-label {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
}

/* Hero Visual — Dashboard Preview */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}
.hero-preview {
  width: 100%;
  max-width: 460px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}
.preview-chrome {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
}
.preview-dots { display: flex; gap: 6px; }
.preview-dot { width: 10px; height: 10px; border-radius: 50%; }
.preview-dot.r { background: #EF4444; }
.preview-dot.y { background: #F59E0B; }
.preview-dot.g { background: #10B981; }
.preview-title-bar {
  flex: 1;
  text-align: center;
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-tertiary);
}
.preview-body { padding: var(--space-5); }
.preview-profile {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.preview-profile-name { font-weight: 600; font-size: var(--text-sm); }
.preview-profile-role { font-size: var(--text-xs); color: var(--color-text-tertiary); }
.preview-stat-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.preview-stat-card {
  background: var(--color-surface-secondary);
  border-radius: var(--radius-md);
  padding: var(--space-3);
}
.preview-stat-label {
  font-size: 11px;
  color: var(--color-text-tertiary);
  margin-bottom: var(--space-1);
}
.preview-stat-value {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text-primary);
}

/* ============================================================
   3. LANDING — FEATURES
   ============================================================ */
.section {
  padding: var(--space-24) var(--space-6);
}
.section-inner {
  max-width: var(--max-content-width);
  margin: 0 auto;
}
.section-header {
  text-align: center;
  margin-bottom: var(--space-16);
}
.section-header .display-lg {
  margin-bottom: var(--space-4);
}
.section-header .body-lg {
  color: var(--color-text-secondary);
  max-width: 560px;
  margin: 0 auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-6);
}
.feature-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: all var(--duration-normal) var(--ease-out);
}
.feature-card:hover {
  border-color: var(--color-primary-subtle);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
}
.feature-icon svg { width: 22px; height: 22px; }
.feature-icon.blue { background: var(--color-primary-light); color: var(--color-primary); }
.feature-icon.green { background: var(--color-success-light); color: var(--color-success); }
.feature-icon.purple { background: #F5F3FF; color: #7C3AED; }
[data-theme="dark"] .feature-icon.purple { background: rgba(124,58,237,0.1); }
.feature-icon.orange { background: #FFF7ED; color: #EA580C; }
[data-theme="dark"] .feature-icon.orange { background: rgba(234,88,12,0.1); }
.feature-icon.teal { background: #F0FDFA; color: #0D9488; }
[data-theme="dark"] .feature-icon.teal { background: rgba(13,148,136,0.1); }
.feature-icon.rose { background: #FFF1F2; color: #E11D48; }
[data-theme="dark"] .feature-icon.rose { background: rgba(225,29,72,0.1); }

.feature-card h3 {
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--space-2);
}
.feature-card p {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
}

/* ============================================================
   4. LANDING — HOW IT WORKS
   ============================================================ */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
  position: relative;
}
.steps-grid::before {
  content: '';
  position: absolute;
  top: 40px;
  left: 15%;
  right: 15%;
  height: 2px;
  background: var(--color-border);
}
.step-card {
  text-align: center;
  position: relative;
}
.step-number {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-lg);
  font-weight: 700;
  margin: 0 auto var(--space-5);
  position: relative;
  z-index: 1;
}
.step-card h3 {
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--space-2);
}
.step-card p {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  max-width: 240px;
  margin: 0 auto;
}

/* ============================================================
   5. LANDING — TRUST / SECURITY
   ============================================================ */
.trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-6);
}
.trust-card {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}
.trust-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.trust-icon svg { width: 20px; height: 20px; }
.trust-card h4 {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-1);
}
.trust-card p {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
}

/* ============================================================
   6. LANDING — CTA
   ============================================================ */
.cta-section {
  text-align: center;
  padding: var(--space-20) var(--space-6);
}
.cta-box {
  max-width: 600px;
  margin: 0 auto;
  background: linear-gradient(135deg, var(--color-primary) 0%, #7C3AED 100%);
  border-radius: var(--radius-2xl);
  padding: var(--space-12) var(--space-8);
  color: white;
  position: relative;
  overflow: hidden;
}
.cta-box::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 250px;
  height: 250px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}
.cta-box h2 {
  font-size: var(--text-3xl);
  font-weight: 700;
  margin-bottom: var(--space-4);
  position: relative;
}
.cta-box p {
  font-size: var(--text-base);
  opacity: 0.9;
  margin-bottom: var(--space-8);
  position: relative;
}
.cta-actions {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  position: relative;
}
.cta-actions .btn-primary {
  background: white;
  color: var(--color-primary);
  border-color: white;
}
.cta-actions .btn-primary:hover {
  background: var(--color-surface-secondary);
  border-color: var(--color-surface-secondary);
}
.cta-actions .btn-secondary {
  background: transparent;
  color: white;
  border-color: rgba(255,255,255,0.3);
}
.cta-actions .btn-secondary:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.5);
}

/* ============================================================
   7. LANDING — FOOTER
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: var(--space-12) var(--space-6) var(--space-8);
  background: var(--color-surface);
}
.footer-inner {
  max-width: var(--max-content-width);
  margin: 0 auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-8);
  margin-bottom: var(--space-8);
}
.footer-brand p {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-top: var(--space-3);
  max-width: 280px;
  line-height: var(--leading-relaxed);
}
.footer-col h4 {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: var(--space-4);
}
.footer-col a {
  display: block;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  padding: var(--space-1) 0;
  transition: color var(--duration-fast) ease;
}
.footer-col a:hover { color: var(--color-primary); }
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
}

/* ============================================================
   8. AUTH PAGE
   ============================================================ */
.auth-page {
  min-height: calc(100vh - var(--header-height));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-4);
}
.auth-wrapper {
  width: 100%;
  max-width: var(--max-form-width);
}
.auth-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.auth-card-header {
  text-align: center;
  padding: var(--space-8) var(--space-6) var(--space-4);
}
.auth-card-header .brand { justify-content: center; margin-bottom: var(--space-6); }
.auth-card-header h1 {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-2);
}
.auth-card-header p {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

/* Auth Tabs */
.auth-tabs {
  display: flex;
  margin: 0 var(--space-6);
  background: var(--color-surface-secondary);
  border-radius: var(--radius-md);
  padding: 3px;
  margin-bottom: var(--space-6);
}
.auth-tab {
  flex: 1;
  padding: 0.5625rem;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--duration-fast) ease;
  text-align: center;
}
.auth-tab.active {
  background: var(--color-surface);
  color: var(--color-text-primary);
  box-shadow: var(--shadow-xs);
}
.auth-tab:hover:not(.active) { color: var(--color-text-primary); }

.auth-tab-panel { display: none; padding: 0 var(--space-6) var(--space-6); }
.auth-tab-panel.active { display: block; }

/* Auth Error */
.auth-error {
  background: var(--color-error-light);
  border: 1px solid rgba(239,68,68,0.2);
  color: var(--color-error-dark);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.auth-error::before {
  content: '';
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='12' cy='12' r='10' stroke='currentColor' stroke-width='2'/%3E%3Cline x1='12' y1='8' x2='12' y2='12' stroke='currentColor' stroke-width='2' stroke-linecap='round'/%3E%3Ccircle cx='12' cy='16' r='1' fill='currentColor'/%3E%3C/svg%3E") center/contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='12' cy='12' r='10' stroke='currentColor' stroke-width='2'/%3E%3Cline x1='12' y1='8' x2='12' y2='12' stroke='currentColor' stroke-width='2' stroke-linecap='round'/%3E%3Ccircle cx='12' cy='16' r='1' fill='currentColor'/%3E%3C/svg%3E") center/contain no-repeat;
}
.auth-error.hidden { display: none; }

/* Forgot Password Link */
.forgot-password-link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--duration-fast) ease;
}
.forgot-password-link:hover { color: var(--color-primary-hover); text-decoration: underline; }

/* Phone Input */
.phone-input-wrapper {
  display: flex;
  align-items: stretch;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  overflow: hidden;
  transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}
.phone-input-wrapper:hover { border-color: var(--color-text-tertiary); }
.phone-input-wrapper:focus-within {
  border-color: var(--color-border-focus);
  box-shadow: var(--shadow-ring);
}
.phone-prefix {
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  background: var(--color-surface-secondary);
  border-right: 1px solid var(--color-border);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text-secondary);
  user-select: none;
  white-space: nowrap;
}
.phone-input {
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  flex: 1;
  min-width: 0;
}
.phone-input:focus { box-shadow: none !important; }

/* Forgot Password Modal */
#forgotPasswordModal { z-index: var(--z-modal); }
#forgotPasswordModal .modal-panel { overflow: visible; }

.auth-footer {
  text-align: center;
  padding: var(--space-4) var(--space-6) var(--space-6);
  border-top: 1px solid var(--color-border);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}
.auth-footer a {
  color: var(--color-primary);
  font-weight: 600;
}

/* ============================================================
   9. REGISTRATION STEPS
   ============================================================ */
.register-steps-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: var(--space-6);
  padding: 0 var(--space-6);
}
.register-step-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  position: relative;
  z-index: 1;
}
.register-step-circle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 2px solid var(--color-border);
  background: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-tertiary);
  transition: all var(--duration-normal) ease;
}
.register-step-indicator.active .register-step-circle {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}
.register-step-indicator.completed .register-step-circle {
  background: var(--color-success);
  border-color: var(--color-success);
  color: white;
}
.register-step-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-tertiary);
  white-space: nowrap;
}
.register-step-indicator.active .register-step-label { color: var(--color-primary); font-weight: 600; }
.register-step-indicator.completed .register-step-label { color: var(--color-success); }

.register-step-line {
  flex: 1;
  height: 2px;
  background: var(--color-border);
  margin: 0 var(--space-2);
  margin-bottom: var(--space-6);
  transition: background var(--duration-normal) ease;
}
.register-step-line.completed { background: var(--color-success); }

.register-step { display: none; }
.register-step.active { display: block; animation: fadeIn var(--duration-normal) ease; }

.register-step-header {
  margin-bottom: var(--space-6);
}
.register-step-header h2 {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-1);
}
.register-step-header p {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

/* ============================================================
   10. OTP INPUT
   ============================================================ */
.otp-group {
  display: flex;
  gap: var(--space-2);
  justify-content: center;
  margin-bottom: var(--space-4);
}
.otp-input {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: var(--text-xl);
  font-weight: 700;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text-primary);
  transition: all var(--duration-fast) ease;
  outline: none;
}
.otp-input:focus {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-ring);
}
.otp-input.filled {
  border-color: var(--color-primary-subtle);
  background: var(--color-primary-light);
}

.otp-timer {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  margin-bottom: var(--space-4);
}
.otp-timer button {
  color: var(--color-primary);
  font-weight: 600;
}
.otp-timer button:hover { text-decoration: underline; }

/* ============================================================
   11. CHILD FORM (Registration)
   ============================================================ */
.child-form-card {
  background: var(--color-surface-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
  position: relative;
}
.child-form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}
.child-form-header h4 {
  font-size: var(--text-sm);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.child-form-number {
  width: 24px;
  height: 24px;
  background: var(--color-primary);
  color: white;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}
.btn-remove-child {
  font-size: var(--text-xs);
  color: var(--color-error);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
}
.btn-remove-child:hover { background: var(--color-error-light); }

/* ============================================================
   12. RESPONSIVE — LANDING
   ============================================================ */
@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-content { max-width: 100%; }
  .hero-subtitle { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .hero-stats { justify-content: center; }
  .hero-visual { margin-top: var(--space-8); }
  .steps-grid::before { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .hero { min-height: auto; padding: var(--space-12) var(--space-4) var(--space-8); }
  .hero-title { font-size: var(--text-3xl); }
  .hero-actions { flex-direction: column; }
  .hero-stats { flex-direction: column; gap: var(--space-4); align-items: center; }
  .section { padding: var(--space-16) var(--space-4); }
  .section-header { margin-bottom: var(--space-10); }
  .features-grid { grid-template-columns: 1fr; }
  .steps-grid { grid-template-columns: 1fr; gap: var(--space-6); }
  .trust-grid { grid-template-columns: 1fr; }
  .cta-box { padding: var(--space-8) var(--space-5); }
  .cta-box h2 { font-size: var(--text-2xl); }
  .footer-grid { grid-template-columns: 1fr; gap: var(--space-6); }
  .footer-bottom { flex-direction: column; gap: var(--space-2); text-align: center; }

  .register-steps-bar { gap: 0; }
  .register-step-label { display: none; }
  .otp-input { width: 42px; height: 50px; font-size: var(--text-lg); }
}

@media (max-width: 480px) {
  .hero { padding: var(--space-8) var(--space-4) var(--space-6); }
  .hero-title { font-size: var(--text-2xl); }
  .hero-preview { max-width: 100%; }
}
