/* ==========================================================================
   NEWTON THE TUTOR — LIQUID GLASS LAYER
   Apple-style liquid glass, extended glassmorphism, premium auth pages,
   and cinematic scroll animations. Loaded LAST so it refines earlier layers.
   ========================================================================== */

/* ========================================================================
   1. APPLE-STYLE LIQUID GLASS PRIMITIVES
   ======================================================================== */
:root {
  --lg-tint:        rgba(255, 255, 255, 0.06);
  --lg-tint-strong: rgba(255, 255, 255, 0.10);
  --lg-border:      rgba(255, 255, 255, 0.18);
  --lg-blur:        blur(30px) saturate(1.8);
  --lg-blur-lg:     blur(48px) saturate(2);
  --lg-shadow:      0 20px 60px rgba(0, 0, 0, 0.35);
  --lg-inner:       inset 0 1px 0 rgba(255,255,255,0.30), inset 0 -1px 0 rgba(0,0,0,0.18);
}
[data-theme="light"] {
  --lg-tint:        rgba(255, 255, 255, 0.55);
  --lg-tint-strong: rgba(255, 255, 255, 0.72);
  --lg-border:      rgba(255, 255, 255, 0.9);
  --lg-shadow:      0 20px 60px rgba(78, 39, 128, 0.14);
  --lg-inner:       inset 0 1px 0 rgba(255,255,255,0.9), inset 0 -1px 0 rgba(78,39,128,0.06);
}

/* The signature liquid-glass surface */
.liquid-glass {
  position: relative;
  background: var(--lg-tint);
  backdrop-filter: var(--lg-blur);
  -webkit-backdrop-filter: var(--lg-blur);
  border: 1px solid var(--lg-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--lg-shadow), var(--lg-inner);
  overflow: hidden;
  isolation: isolate;
}
/* Top edge specular highlight — the "wet glass" look */
.liquid-glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 15% -10%, rgba(255,255,255,0.28), transparent 55%),
    linear-gradient(180deg, rgba(255,255,255,0.10), transparent 35%);
  mix-blend-mode: screen;
  z-index: 0;
}
[data-theme="light"] .liquid-glass::before {
  background:
    radial-gradient(120% 80% at 15% -10%, rgba(255,255,255,0.9), transparent 55%),
    linear-gradient(180deg, rgba(255,255,255,0.45), transparent 40%);
  mix-blend-mode: normal;
}
/* Subtle refracted colour glow inside */
.liquid-glass::after {
  content: "";
  position: absolute;
  inset: -40%;
  pointer-events: none;
  background: conic-gradient(from 120deg,
    rgba(78,39,128,0.0), rgba(124,77,204,0.14), rgba(79,127,255,0.10),
    rgba(78,39,128,0.0));
  filter: blur(40px);
  opacity: 0.6;
  z-index: -1;
  animation: liquidSwirl 18s linear infinite;
}
@keyframes liquidSwirl { to { transform: rotate(360deg); } }
.liquid-glass > * { position: relative; z-index: 1; }

/* Extend liquid feel to existing card families (glass everywhere) */
.glass-card,
.service-card,
.why-card,
.price-card,
.testi-card,
.tutor-card,
.blog-card,
.subject-card,
.stat-block,
.dashboard-card {
  backdrop-filter: var(--lg-blur) !important;
  -webkit-backdrop-filter: var(--lg-blur) !important;
  border: 1px solid var(--lg-border);
  box-shadow: var(--lg-shadow), var(--lg-inner);
}
.why-card, .service-card, .price-card, .testi-card, .blog-card, .tutor-card {
  transition: transform .5s cubic-bezier(.16,1,.3,1), box-shadow .5s cubic-bezier(.16,1,.3,1), border-color .5s ease;
}
.why-card:hover, .service-card:hover, .price-card:hover, .testi-card:hover, .blog-card:hover, .tutor-card:hover {
  border-color: rgba(124,77,204,0.4);
  box-shadow: 0 30px 70px rgba(0,0,0,0.4), 0 0 46px rgba(78,39,128,0.28), var(--lg-inner);
}
[data-theme="light"] .why-card:hover,
[data-theme="light"] .service-card:hover,
[data-theme="light"] .price-card:hover,
[data-theme="light"] .testi-card:hover,
[data-theme="light"] .blog-card:hover,
[data-theme="light"] .tutor-card:hover {
  box-shadow: 0 30px 70px rgba(78,39,128,0.18), var(--lg-inner);
}

/* Footer glassiness */
footer, .site-footer, .footer {
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
}

/* ========================================================================
   2. CINEMATIC SCROLL ANIMATIONS
   ======================================================================== */
/* Base states — JS adds .in-view */
[data-anim] {
  opacity: 0;
  will-change: transform, opacity, filter;
  transition:
    opacity 0.9s cubic-bezier(.16,1,.3,1),
    transform 0.9s cubic-bezier(.16,1,.3,1),
    filter 0.9s cubic-bezier(.16,1,.3,1);
}
[data-anim="up"]      { transform: translateY(48px); }
[data-anim="down"]    { transform: translateY(-48px); }
[data-anim="left"]    { transform: translateX(-56px); }
[data-anim="right"]   { transform: translateX(56px); }
[data-anim="scale"]   { transform: scale(0.86); }
[data-anim="blur"]    { filter: blur(14px); transform: translateY(28px); }
[data-anim="rotate"]  { transform: perspective(1200px) rotateX(18deg) translateY(40px); transform-origin: top; }
[data-anim="flip"]    { transform: perspective(1200px) rotateY(35deg); }
[data-anim].in-view {
  opacity: 1;
  filter: blur(0);
  transform: none;
}
/* Stagger via inline --d (seconds) set by JS or delay classes */
[data-anim] { transition-delay: var(--d, 0s); }

/* Reuse for the legacy .reveal system too — richer easing */
.reveal, .reveal-left, .reveal-right, .reveal-scale {
  transition:
    opacity 0.85s cubic-bezier(.16,1,.3,1),
    transform 0.85s cubic-bezier(.16,1,.3,1) !important;
}

/* Hero text kinetic entrance */
@keyframes floatY { 0%,100%{ transform: translateY(0);} 50%{ transform: translateY(-10px);} }
.float-slow { animation: floatY 6s ease-in-out infinite; }

/* Gradient shimmer sweep for headings on view */
.shine-head {
  background-size: 220% auto;
  animation: shineText 6s linear infinite;
}
@keyframes shineText { to { background-position: 220% center; } }

/* Section entrance glow */
@keyframes revealGlow {
  0% { box-shadow: 0 0 0 rgba(124,77,204,0); }
  100% { box-shadow: 0 0 40px rgba(124,77,204,0.25); }
}

/* Magnetic / micro-interaction lift for buttons */
.btn { transition: transform .35s cubic-bezier(.34,1.56,.64,1), box-shadow .35s ease, filter .35s ease; }
.btn:hover { transform: translateY(-3px) scale(1.02); }
.btn:active { transform: translateY(0) scale(.98); }

/* ========================================================================
   3. PREMIUM AUTH PAGES (login + signup) — the big missing piece
   ======================================================================== */
body.auth-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 18%, rgba(78,39,128,0.35), transparent 45%),
    radial-gradient(circle at 88% 12%, rgba(41,0,166,0.30), transparent 45%),
    radial-gradient(circle at 70% 90%, rgba(124,77,204,0.25), transparent 45%),
    var(--bg-primary);
  overflow-x: hidden;
}
[data-theme="light"] body.auth-body {
  background:
    radial-gradient(circle at 12% 18%, rgba(124,77,204,0.18), transparent 45%),
    radial-gradient(circle at 88% 12%, rgba(79,127,255,0.15), transparent 45%),
    radial-gradient(circle at 70% 90%, rgba(78,39,128,0.12), transparent 45%),
    var(--bg-primary);
}

.auth-split {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  min-height: 100vh;
  padding-top: var(--nav-height);
  position: relative;
  z-index: 2;
}
@media (max-width: 980px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-panel-left { display: none !important; }
}

/* ---- Left branding panel ---- */
.auth-panel-left {
  position: relative;
  display: flex;
  align-items: center;
  padding: 56px;
  overflow: hidden;
}
.auth-bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.08);
  filter: saturate(1.05);
}
.auth-bg-overlay {
  position: absolute; inset: 0;
  background:
    linear-gradient(135deg, rgba(10,6,26,0.86), rgba(41,0,166,0.55) 60%, rgba(78,39,128,0.7));
  backdrop-filter: blur(2px);
}
.auth-panel-left-inner {
  position: relative;
  z-index: 2;
  max-width: 520px;
  margin: auto;
  animation: authFadeUp 1s cubic-bezier(.16,1,.3,1) both;
}
@keyframes authFadeUp { from { opacity: 0; transform: translateY(30px);} to { opacity: 1; transform: none; } }

.auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 48px;
  color: #fff;
}
.auth-logo .nav-logo-mark {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: 16px;
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 20px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-deep), var(--accent-alt));
  box-shadow: 0 10px 30px rgba(41,0,166,0.5), inset 0 1px 0 rgba(255,255,255,0.4);
}
.auth-logo .logo-name { font-family:'Sora',sans-serif; font-weight: 800; font-size: 20px; line-height: 1; letter-spacing:-.5px; }
.auth-logo .logo-sub  { font-size: 12px; opacity: .8; letter-spacing: 3px; text-transform: uppercase; }

.auth-panel-left .label { color: #d9ccff; }
.auth-panel-left .heading-lg,
.auth-panel-left .body,
.auth-panel-left p { color: #fff; }
.auth-panel-left .text-secondary { color: rgba(255,255,255,0.8); }

/* Testimonial + benefits glass cards */
.auth-testimonial,
.auth-benefits {
  background: rgba(255,255,255,0.09);
  backdrop-filter: blur(16px) saturate(1.6);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 20px;
  padding: 24px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), 0 16px 40px rgba(0,0,0,0.25);
}
.auth-testimonial { margin-bottom: 8px; }
.testi-stars { color: var(--accent-gold); display: flex; gap: 4px; }
.auth-testi-text { color: #fff; font-size: 15px; line-height: 1.7; font-style: italic; margin-bottom: 16px; }
.auth-testi-author { display: flex; align-items: center; gap: 12px; }
.testi-avatar { width: 44px; height: 44px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.4); }
.testi-name { color: #fff; font-weight: 700; font-size: 14px; }
.testi-role { color: rgba(255,255,255,0.7); font-size: 12px; }

.auth-benefits { display: grid; gap: 12px; }
.auth-benefit { display: flex; align-items: center; gap: 12px; color: #fff; font-size: 14px; }
.auth-benefit i { color: var(--accent-green); font-size: 15px; }

.auth-panel-stats { display: flex; gap: 28px; margin-top: 28px; }
.auth-stat-num { font-family:'Sora',sans-serif; font-weight: 800; font-size: 28px; color: #fff; line-height: 1; }
.auth-stat-label { font-size: 12px; color: rgba(255,255,255,0.72); margin-top: 4px; }

/* ---- Right form panel ---- */
.auth-panel-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 40px;
  position: relative;
}
.auth-form-wrap {
  width: 100%;
  max-width: 440px;
  animation: authFadeUp 1s cubic-bezier(.16,1,.3,1) .1s both;
}
.auth-panel-right-wide .auth-form-wrap { max-width: 620px; }

.auth-form-header { margin-bottom: 32px; }
.auth-form-title {
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: clamp(30px, 4vw, 42px);
  letter-spacing: -1px;
  margin-bottom: 8px;
  color: var(--text-primary);
}
.auth-form-sub { color: var(--text-secondary); font-size: 15px; }
.accent-link { color: var(--accent-alt); font-weight: 600; }
[data-theme="light"] .accent-link { color: var(--accent); }
.accent-link:hover { text-decoration: underline; }

/* The form itself sits on a liquid glass sheet */
.auth-form {
  background: var(--lg-tint);
  backdrop-filter: var(--lg-blur);
  -webkit-backdrop-filter: var(--lg-blur);
  border: 1px solid var(--lg-border);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--lg-shadow), var(--lg-inner);
  position: relative;
  overflow: hidden;
}
.auth-form::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background: radial-gradient(120% 60% at 20% -10%, rgba(255,255,255,0.18), transparent 55%);
}
.auth-form > * { position: relative; z-index: 1; }

.form-group { margin-bottom: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

.form-label {
  display: flex; align-items: center; justify-content: space-between;
  font-family: 'Inter', sans-serif;
  font-size: 13px; font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.form-label-link { font-size: 12px; color: var(--accent-alt); font-weight: 500; }
[data-theme="light"] .form-label-link { color: var(--accent); }

.input-icon-wrap { position: relative; }
.input-icon {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 14px; pointer-events: none;
  transition: color .3s ease;
}
.form-control {
  width: 100%;
  padding: 14px 16px;
  font-family: 'Manrope', sans-serif;
  font-size: 15px;
  color: var(--text-primary);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  transition: border-color .3s ease, box-shadow .3s ease, background .3s ease;
}
[data-theme="light"] .form-control { background: rgba(255,255,255,0.7); }
.form-control-icon { padding-left: 44px; }
.form-control::placeholder { color: var(--text-muted); }
.form-control:focus {
  outline: none;
  border-color: var(--accent-alt);
  background: rgba(255,255,255,0.08);
  box-shadow: 0 0 0 4px rgba(124,77,204,0.18);
}
[data-theme="light"] .form-control:focus { background: #fff; box-shadow: 0 0 0 4px rgba(78,39,128,0.14); }
.form-control:focus + .input-eye,
.input-icon-wrap:focus-within .input-icon { color: var(--accent-alt); }

.input-eye {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 14px; padding: 6px; border-radius: 8px;
  transition: color .25s ease, background .25s ease;
}
.input-eye:hover { color: var(--accent-alt); background: rgba(124,77,204,0.12); }

/* Checkbox */
.form-check-row { margin: 8px 0 20px; }
.form-check { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-secondary); cursor: pointer; }
.form-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.form-check-mark {
  width: 20px; height: 20px; flex-shrink: 0;
  border-radius: 6px;
  border: 1.5px solid var(--border-glass);
  background: rgba(255,255,255,0.05);
  display: grid; place-items: center;
  transition: all .25s ease;
}
[data-theme="light"] .form-check-mark { background: rgba(255,255,255,0.8); }
.form-check-mark::after {
  content: "\f00c";
  font-family: "Font Awesome 6 Free"; font-weight: 900;
  font-size: 11px; color: #fff; opacity: 0; transform: scale(.5);
  transition: all .2s ease;
}
.form-check input:checked + .form-check-mark {
  background: linear-gradient(135deg, var(--accent-deep), var(--accent-alt));
  border-color: transparent;
}
.form-check input:checked + .form-check-mark::after { opacity: 1; transform: scale(1); }

/* Solid CTA button */
.btn-solid {
  background: linear-gradient(135deg, var(--accent-deep), var(--accent) 55%, var(--accent-alt));
  color: #fff;
  box-shadow: 0 12px 34px rgba(41,0,166,0.4), inset 0 1px 0 rgba(255,255,255,0.35);
}
.btn-solid:hover { filter: brightness(1.08); box-shadow: 0 18px 44px rgba(41,0,166,0.5), inset 0 1px 0 rgba(255,255,255,0.4); }
.btn-lg { padding: 16px 28px; font-size: 15px; }
.w-full { width: 100%; justify-content: center; }

/* Divider */
.auth-divider {
  display: flex; align-items: center; gap: 16px;
  margin: 24px 0;
  color: var(--text-muted);
}
.auth-divider::before, .auth-divider::after {
  content: ""; flex: 1; height: 1px;
  background: var(--border-glass);
}
.auth-divider span { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; }

/* Social buttons */
.auth-social-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.auth-social-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px;
  font-family: 'Manrope', sans-serif; font-weight: 600; font-size: 14px;
  color: var(--text-primary);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  transition: all .3s ease;
}
[data-theme="light"] .auth-social-btn { background: rgba(255,255,255,0.75); }
.auth-social-btn:hover { border-color: var(--accent-alt); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(78,39,128,0.2); }

.auth-terms { font-size: 12px; color: var(--text-muted); margin-top: 20px; line-height: 1.6; }
.auth-terms a { color: var(--accent-alt); }
[data-theme="light"] .auth-terms a { color: var(--accent); }

/* Banners */
.form-error-banner, .form-success-banner {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border-radius: 14px; margin-bottom: 20px;
  font-size: 13px; line-height: 1.5;
}
.form-error-banner {
  background: rgba(220,60,80,0.12);
  border: 1px solid rgba(220,60,80,0.35);
  color: #ff9db0;
}
[data-theme="light"] .form-error-banner { color: #b3162f; }
.form-error-banner ul { display: grid; gap: 4px; }
.form-error-banner i, .form-success-banner i { margin-top: 2px; }
.form-success-banner {
  background: rgba(74,222,128,0.12);
  border: 1px solid rgba(74,222,128,0.35);
  color: #86efac;
}
[data-theme="light"] .form-success-banner { color: #15803d; }

/* Password strength */
.password-strength {
  display: flex; align-items: center; gap: 12px;
  margin: -4px 0 18px;
  font-size: 12px; color: var(--text-muted);
}
.password-strength .pw-bar,
.password-strength #pwBar {
  height: 6px; width: 0%; border-radius: 999px;
  background: var(--accent);
  transition: width .3s ease, background .3s ease;
  flex-shrink: 0;
}
.password-strength { position: relative; }
.password-strength::before {
  content: ""; position: absolute; left: 0; top: 3px;
  width: 140px; height: 6px; border-radius: 999px;
  background: rgba(255,255,255,0.1); z-index: -1;
}
.password-strength .pw-bar { max-width: 140px; }

/* Plan selector (signup) */
.plan-selector-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 620px) { .plan-selector-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px) { .plan-selector-grid { grid-template-columns: 1fr; } }
.plan-selector-card {
  position: relative;
  padding: 16px;
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid var(--border-glass);
  cursor: pointer;
  transition: all .3s cubic-bezier(.16,1,.3,1);
  overflow: hidden;
}
[data-theme="light"] .plan-selector-card { background: rgba(255,255,255,0.7); }
.plan-selector-card input { position: absolute; opacity: 0; }
.plan-selector-card:hover { transform: translateY(-3px); border-color: var(--accent-alt); }
.plan-selector-card.selected {
  border-color: var(--accent-alt);
  background: linear-gradient(135deg, rgba(78,39,128,0.28), rgba(124,77,204,0.12));
  box-shadow: 0 12px 30px rgba(78,39,128,0.3);
}
.plan-selector-name { font-family:'Sora',sans-serif; font-weight: 700; font-size: 15px; color: var(--text-primary); margin-bottom: 4px; }
.plan-selector-price { font-family:'Sora',sans-serif; font-weight: 800; font-size: 22px; color: var(--accent-alt); }
[data-theme="light"] .plan-selector-price { color: var(--accent); }
.plan-selector-price span { font-size: 12px; font-weight: 500; color: var(--text-muted); margin-left: 2px; }
.plan-selector-desc { font-size: 12px; color: var(--text-secondary); margin-top: 6px; line-height: 1.5; }
.plan-selector-check {
  position: absolute; top: 12px; right: 12px;
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent-deep), var(--accent-alt));
  color: #fff; font-size: 10px;
  opacity: 0; transform: scale(.4);
  transition: all .25s cubic-bezier(.34,1.56,.64,1);
}
.plan-selector-card.selected .plan-selector-check { opacity: 1; transform: scale(1); }
.plan-selector-wrap .form-label { margin-bottom: 12px; }

/* ========================================================================
   4. LIGHT-MODE READABILITY — ensure black main text everywhere
   ======================================================================== */
[data-theme="light"] body,
[data-theme="light"] p,
[data-theme="light"] li,
[data-theme="light"] .body-lg,
[data-theme="light"] .body-md { color: var(--text-primary); }
[data-theme="light"] .body-sm,
[data-theme="light"] .text-secondary { color: var(--text-secondary); }
[data-theme="light"] .nav-link { color: rgba(0,0,0,0.72); }
[data-theme="light"] .nav-link:hover { color: #000; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  [data-anim] { opacity: 1 !important; transform: none !important; filter: none !important; transition: none !important; }
  .liquid-glass::after, .float-slow, .shine-head { animation: none !important; }
}
