/* =========================================================
   SUFFA ACADEMY — Main Stylesheet
   Theme: deep navy + teal + gold, glass (transparent) cards
   ========================================================= */

:root {
  --bg: #0b1026;
  --bg-2: #121a3a;
  --primary: #14b8a6;      /* teal */
  --primary-2: #06b6d4;    /* cyan */
  --accent: #f5b942;       /* gold */
  --violet: #8b5cf6;
  --text: #e8ecff;
  --muted: #a5adcf;
  --glass: rgba(255, 255, 255, 0.06);
  --glass-strong: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.14);
  --error: #ff6b81;
  --success: #34d399;
  --radius: 18px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  --grad: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 50%, var(--accent) 100%);
  --ease: cubic-bezier(.22, 1, .36, 1);
}

*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: radial-gradient(ellipse at top, var(--bg-2), var(--bg) 60%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  min-height: 100vh;
}

body.loading { overflow: hidden; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

.container { width: min(1180px, 92%); margin-inline: auto; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.gradient-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 200% auto;
  animation: shine 6s linear infinite;
}

.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

/* ---------- Preloader ---------- */
.preloader {
  position: fixed; inset: 0; z-index: 9999;
  display: grid; place-items: center;
  background: var(--bg);
  transition: opacity .6s var(--ease), visibility .6s;
}
.preloader.hide { opacity: 0; visibility: hidden; }
.loader-ring {
  width: 90px; height: 90px; border-radius: 50%;
  border: 4px solid rgba(255,255,255,.08);
  border-top-color: var(--primary);
  border-right-color: var(--accent);
  animation: spin 1s linear infinite;
  grid-area: 1 / 1;
}
.loader-text { grid-area: 1 / 1; font-weight: 800; letter-spacing: 2px; font-size: .9rem; }

/* ---------- Background blobs ---------- */
.bg-blobs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blob {
  position: absolute; border-radius: 50%;
  filter: blur(90px); opacity: .45;
  animation: drift 18s ease-in-out infinite alternate;
}
.b1 { width: 420px; height: 420px; background: var(--primary); top: -120px; left: -100px; }
.b2 { width: 380px; height: 380px; background: var(--violet); bottom: -120px; right: -80px; animation-delay: -6s; }
.b3 { width: 280px; height: 280px; background: var(--accent); top: 40%; left: 55%; opacity: .2; animation-delay: -12s; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .85rem 1.7rem; border-radius: 50px;
  font-weight: 600; font-size: .95rem; font-family: inherit;
  border: none; cursor: pointer; position: relative; overflow: hidden;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), background .3s;
}
.btn:hover { transform: translateY(-3px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn-primary {
  background: var(--grad); background-size: 200% auto; color: #06101f;
  box-shadow: 0 8px 25px rgba(20, 184, 166, .35);
}
.btn-primary:hover { background-position: right center; box-shadow: 0 12px 30px rgba(20, 184, 166, .5); }
.btn-glass { background: var(--glass-strong); border: 1px solid var(--glass-border); color: var(--text); backdrop-filter: blur(10px); }
.btn-glass:hover { background: rgba(255,255,255,.16); }
.btn-sm { padding: .55rem 1.25rem; font-size: .88rem; }
.btn-block { width: 100%; }

/* ripple (added by JS) */
.ripple {
  position: absolute; border-radius: 50%; transform: scale(0);
  background: rgba(255,255,255,.5); animation: ripple .6s linear; pointer-events: none;
}

/* ---------- Header ---------- */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 1.1rem 0;
  transition: padding .3s var(--ease), background .3s, box-shadow .3s;
}
.header.scrolled {
  padding: .6rem 0;
  background: rgba(11, 16, 38, .7);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 30px rgba(0,0,0,.3);
  border-bottom: 1px solid var(--glass-border);
}
.nav { display: flex; align-items: center; justify-content: space-between; }

.logo { display: flex; align-items: center; gap: .6rem; font-weight: 800; letter-spacing: 1px; }
.logo-mark {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--grad); color: #06101f; font-size: 1.3rem;
  box-shadow: 0 6px 18px rgba(20,184,166,.4);
}
.logo-text em { font-style: normal; font-weight: 500; color: var(--accent); }

.nav-links { display: flex; align-items: center; gap: 1.8rem; }
.nav-links a:not(.btn) { position: relative; font-weight: 500; color: var(--muted); transition: color .3s; }
.nav-links a:not(.btn)::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 2px; width: 0;
  background: var(--grad); border-radius: 2px; transition: width .3s var(--ease);
}
.nav-links a:not(.btn):hover,
.nav-links a.active { color: var(--text); }
.nav-links a:not(.btn):hover::after,
.nav-links a.active::after { width: 100%; }

.menu-toggle { display: none; background: none; border: none; cursor: pointer; width: 32px; height: 24px; position: relative; z-index: 110; }
.menu-toggle span {
  position: absolute; left: 0; width: 100%; height: 3px; border-radius: 3px; background: var(--text);
  transition: transform .35s var(--ease), opacity .3s, top .35s var(--ease);
}
.menu-toggle span:nth-child(1) { top: 0; }
.menu-toggle span:nth-child(2) { top: 10px; }
.menu-toggle span:nth-child(3) { top: 20px; }
.menu-toggle.open span:nth-child(1) { top: 10px; transform: rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { top: 10px; transform: rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr;
  align-items: center; gap: 3rem; padding-top: 110px; padding-bottom: 3rem;
}
.badge {
  display: inline-block; padding: .4rem 1rem; border-radius: 50px; font-size: .85rem; font-weight: 500;
  background: rgba(20,184,166,.12); border: 1px solid rgba(20,184,166,.35); color: var(--primary);
  margin-bottom: 1.2rem;
}
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); line-height: 1.15; font-weight: 800; margin-bottom: 1rem; }
.hero-sub { font-size: clamp(1.1rem, 2.2vw, 1.4rem); font-weight: 600; margin-bottom: 1rem; min-height: 2em; }
.typed { color: var(--accent); }
.caret { color: var(--accent); animation: blink 1s step-end infinite; margin-left: 2px; }
.hero-desc { color: var(--muted); max-width: 540px; margin-bottom: 2rem; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.hero-visual { position: relative; height: 440px; display: grid; place-items: center; }
.hero-orb {
  width: 280px; height: 280px; border-radius: 50%; position: relative;
  background: conic-gradient(from 0deg, var(--primary), var(--violet), var(--accent), var(--primary));
  padding: 4px; animation: spin 14s linear infinite;
  box-shadow: 0 0 80px rgba(20,184,166,.35);
}
.orb-inner {
  width: 100%; height: 100%; border-radius: 50%; background: rgba(11,16,38,.88);
  display: grid; place-content: center; text-align: center;
  animation: spin 14s linear infinite reverse;
}
.orb-inner strong { font-size: 3rem; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.orb-inner small { color: var(--muted); }

.glass-card {
  position: absolute; z-index: 2; padding: .8rem 1.2rem; border-radius: 14px; font-weight: 600; font-size: .95rem;
  background: rgba(255,255,255,.08); border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: var(--shadow);
  display: flex; align-items: center; gap: .5rem;
}
.float-card { animation: float 5s ease-in-out infinite; }
.c1 { top: 8%; left: 2%; }
.c2 { top: 45%; right: -2%; animation-delay: -1.6s; }
.c3 { bottom: 6%; left: 12%; animation-delay: -3.2s; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; margin-bottom: 2rem; }
.stat { padding: 1.6rem 1rem; text-align: center; transition: transform .35s var(--ease); }
.stat:hover { transform: translateY(-6px); }
.stat strong { font-size: 2.4rem; font-weight: 800; color: var(--accent); display: inline; }
.stat span { color: var(--muted); font-weight: 500; margin-left: .2rem; }

/* ---------- Sections ---------- */
.section { padding: 5.5rem 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 3rem; }
.eyebrow {
  display: inline-block; text-transform: uppercase; letter-spacing: 3px; font-size: .78rem; font-weight: 600;
  color: var(--primary); margin-bottom: .6rem;
}
.section h2 { font-size: clamp(1.8rem, 3.6vw, 2.7rem); line-height: 1.2; font-weight: 800; margin-bottom: .8rem; }
.section-head p { color: var(--muted); }

/* About */
.about-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 2.5rem; align-items: center; }
.about-text p { color: var(--muted); margin-bottom: 1.4rem; font-size: 1.05rem; }
.check-list li { padding-left: 2rem; position: relative; margin-bottom: .7rem; }
.check-list li::before {
  content: "✓"; position: absolute; left: 0; top: 2px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: .75rem; font-weight: 700;
  background: rgba(20,184,166,.18); color: var(--primary);
}
.about-cards { display: grid; gap: 1.2rem; }
.mini-card, .feature, .contact-card { padding: 1.8rem; transition: transform .4s var(--ease), border-color .4s, background .4s; }
.mini-card:hover, .feature:hover, .contact-card:hover { transform: translateY(-8px); border-color: rgba(20,184,166,.5); background: var(--glass-strong); }
.icon { font-size: 2rem; display: inline-block; margin-bottom: .7rem; }
.mini-card h3, .feature h3, .contact-card h3 { font-size: 1.15rem; margin-bottom: .4rem; }
.mini-card p, .feature p, .contact-card p { color: var(--muted); font-size: .95rem; }

/* Subjects */
.search-wrap { max-width: 480px; margin: 0 auto 2.5rem; }
.search-wrap input {
  width: 100%; padding: .95rem 1.4rem; border-radius: 50px; font: inherit; color: var(--text);
  background: var(--glass); border: 1px solid var(--glass-border); outline: none;
  backdrop-filter: blur(10px); transition: border-color .3s, box-shadow .3s;
}
.search-wrap input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(20,184,166,.18); }
.search-wrap input::placeholder { color: var(--muted); }

.subjects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.4rem; }
.subject-card {
  padding: 1.6rem; display: flex; flex-direction: column; gap: .8rem; position: relative; overflow: hidden;
  transition: transform .4s var(--ease), border-color .4s, box-shadow .4s;
  transform-style: preserve-3d;
}
.subject-card::before {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .4s;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), rgba(20,184,166,.18), transparent 40%);
  pointer-events: none;
}
.subject-card:hover::before { opacity: 1; }
.subject-card:hover { border-color: rgba(20,184,166,.55); box-shadow: 0 18px 50px rgba(20,184,166,.18); }
.subject-icon {
  width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 1.7rem;
  background: rgba(255,255,255,.08); border: 1px solid var(--glass-border);
  transition: transform .5s var(--ease);
}
.subject-card:hover .subject-icon { transform: rotate(-8deg) scale(1.1); }
.subject-card h3 { font-size: 1.15rem; }
.subject-card p { color: var(--muted); font-size: .9rem; flex: 1; }
.subject-meta { font-size: .78rem; color: var(--accent); font-weight: 500; }
.subject-card .btn { margin-top: .4rem; }
.subject-links {
  position: relative; z-index: 1; padding: .8rem .9rem; border-radius: 12px;
  background: rgba(255,255,255,.04); border: 1px dashed var(--glass-border);
}
.subject-links-title { display: block; font-size: .8rem; font-weight: 600; color: var(--primary); margin-bottom: .35rem; }
.subject-links li + li { margin-top: .3rem; }
.subject-links a { font-size: .85rem; color: var(--text); line-height: 1.4; transition: color .3s; }
.subject-links a:hover { color: var(--accent); text-decoration: underline; }
.subject-card.hidden { display: none; }
.no-result { text-align: center; color: var(--muted); margin-top: 1.5rem; }

/* Features */
.features-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem; }
.feature { text-align: center; }

/* Sign up */
.signup-wrap { display: grid; grid-template-columns: .9fr 1.1fr; gap: 3rem; padding: 3rem; }
.signup-info p { color: var(--muted); margin-bottom: 1.4rem; }

.signup-form { display: flex; flex-direction: column; gap: 1.1rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field { position: relative; }
.field input, .field select {
  width: 100%; padding: 1.25rem 1rem .5rem; border-radius: 12px; font: inherit; font-size: .95rem;
  color: var(--text); background: rgba(255,255,255,.05); border: 1px solid var(--glass-border);
  outline: none; transition: border-color .3s, box-shadow .3s, background .3s; appearance: none;
}
.field select option { background: var(--bg-2); color: var(--text); }
.field select {
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 55%, calc(100% - 15px) 55%;
  background-size: 5px 5px; background-repeat: no-repeat; cursor: pointer;
}
.field label {
  position: absolute; left: 1rem; top: .95rem; color: var(--muted); font-size: .95rem; pointer-events: none;
  transition: all .25s var(--ease);
}
.field input:focus, .field select:focus { border-color: var(--primary); background: rgba(255,255,255,.08); box-shadow: 0 0 0 4px rgba(20,184,166,.15); }
.field input:focus + label,
.field input:not(:placeholder-shown) + label,
.field select:focus + label,
.field select:valid + label { top: .35rem; font-size: .72rem; color: var(--primary); }
.field .error { display: block; color: var(--error); font-size: .78rem; min-height: 1em; margin-top: .25rem; padding-left: .3rem; }
.field.invalid input, .field.invalid select { border-color: var(--error); animation: shake .4s; }

.btn .spinner {
  display: none; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(6,16,31,.3); border-top-color: #06101f; animation: spin .8s linear infinite;
}
.btn.loading .spinner { display: inline-block; }
.btn.loading .btn-label { opacity: .7; }
.btn:disabled { cursor: not-allowed; opacity: .8; }
.form-msg { text-align: center; font-size: .92rem; min-height: 1.4em; }
.form-msg.success { color: var(--success); }
.form-msg.error { color: var(--error); }

/* Contact */
.contact-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem; text-align: center; }
.contact-card a { color: var(--primary); overflow-wrap: anywhere; }

/* ---------- Admin page ---------- */
.admin-hero { padding-top: 140px; }
.admin-card { display: grid; grid-template-columns: auto 1fr; gap: 3rem; align-items: center; padding: 3rem; }
.admin-photo-wrap { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.admin-photo-ring {
  width: 230px; height: 230px; border-radius: 50%; padding: 5px; position: relative;
  background: conic-gradient(from 0deg, var(--primary), var(--violet), var(--accent), var(--primary));
  box-shadow: 0 0 60px rgba(20,184,166,.35);
  animation: glow 4s ease-in-out infinite;
}
.admin-photo { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 5px solid var(--bg); }
.admin-role {
  padding: .4rem 1.1rem; border-radius: 50px; font-weight: 600; font-size: .9rem;
  background: rgba(245,185,66,.14); border: 1px solid rgba(245,185,66,.4); color: var(--accent);
}
.admin-info h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); line-height: 1.15; font-weight: 800; margin-bottom: .5rem; }
.admin-edu { font-weight: 600; color: var(--primary); margin-bottom: 1rem; font-size: 1.05rem; }
.admin-intro { color: var(--muted); margin-bottom: 1.4rem; font-size: 1.02rem; }
.admin-tags { display: flex; flex-wrap: wrap; gap: .6rem; }
.admin-tags span {
  padding: .4rem .9rem; border-radius: 50px; font-size: .85rem;
  background: var(--glass-strong); border: 1px solid var(--glass-border);
  transition: transform .3s var(--ease), border-color .3s;
}
.admin-tags span:hover { transform: translateY(-3px); border-color: var(--primary); }
.admin-exp .counter { color: var(--accent); }

.vision { text-align: center; padding: 3.5rem 2.5rem; max-width: 900px; margin-inline: auto; }
.vision blockquote { font-size: clamp(1.15rem, 2.4vw, 1.5rem); font-weight: 600; line-height: 1.6; margin: .8rem 0 1.2rem; }
.vision-by { color: var(--muted); }

@keyframes glow { 0%, 100% { box-shadow: 0 0 40px rgba(20,184,166,.3); } 50% { box-shadow: 0 0 80px rgba(245,185,66,.4); } }

@media (max-width: 760px) {
  .admin-card { grid-template-columns: 1fr; text-align: center; padding: 2rem 1.4rem; gap: 2rem; }
  .admin-tags { justify-content: center; }
  .admin-photo-ring { width: 190px; height: 190px; }
  .admin-hero { padding-top: 110px; }
}

/* Footer */
.footer { border-top: 1px solid var(--glass-border); padding: 2rem 0; background: rgba(0,0,0,.15); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.footer p { color: var(--muted); font-size: .9rem; }

/* Back to top */
.back-top {
  position: fixed; right: 1.4rem; bottom: 1.4rem; z-index: 90; width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.3rem; font-weight: 700; color: #06101f;
  background: var(--grad); box-shadow: 0 8px 25px rgba(20,184,166,.4);
  opacity: 0; visibility: hidden; transform: translateY(20px); transition: all .4s var(--ease);
}
.back-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-top:hover { transform: translateY(-4px); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 2rem; z-index: 200; transform: translate(-50%, 150%);
  padding: .9rem 1.5rem; border-radius: 12px; font-weight: 500; font-size: .92rem;
  background: rgba(18,26,58,.92); border: 1px solid var(--glass-border); backdrop-filter: blur(12px);
  box-shadow: var(--shadow); max-width: 90%;
  opacity: 0; visibility: hidden;
  transition: transform .5s var(--ease), opacity .4s, visibility .4s;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Keyframes ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-18px); } }
@keyframes drift { 0% { transform: translate(0, 0) scale(1); } 100% { transform: translate(80px, 60px) scale(1.15); } }
@keyframes shine { to { background-position: 200% center; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: repeat(2, 1fr); }
  .signup-wrap { grid-template-columns: 1fr; gap: 2rem; }
}

@media (max-width: 860px) {
  .menu-toggle { display: block; }
  .nav-links {
    position: fixed; inset: 0 0 0 auto; width: min(300px, 80%); height: 100vh;
    flex-direction: column; justify-content: center; gap: 2rem;
    background: rgba(11,16,38,.92); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid var(--glass-border);
    transform: translateX(100%); transition: transform .5s var(--ease);
  }
  .nav-links.open { transform: translateX(0); }
  .nav-links a:not(.btn) { font-size: 1.1rem; }

  .hero { grid-template-columns: 1fr; text-align: center; padding-top: 120px; min-height: auto; }
  .hero-desc { margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .hero-visual { height: 360px; }
  .hero-orb { width: 220px; height: 220px; }

  .stats { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .section { padding: 4rem 0; }
  .features-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .signup-wrap { padding: 1.6rem; }
  .stat strong { font-size: 2rem; }
  .glass-card { font-size: .82rem; padding: .6rem .9rem; }
  .c2 { right: 0; }
  .footer-inner { flex-direction: column; text-align: center; }
}

/* Respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
