/* ============================================================
   Sapthagiri High School E/M — Design System (v3 + CMS)
   ============================================================ */

:root {
  --maroon: #8a1618;
  --maroon-dark: #6d1012;
  --orange: #f37021;
  --orange-dark: #d95c10;
  --ink: #1b2030;
  --muted: #5b6472;
  --line: #e7e9ee;
  --bg: #ffffff;
  --bg-soft: #f6f7fb;
  --gold: #f6b210;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 12px 34px rgba(20, 20, 40, .09);
  --shadow-soft: 0 6px 18px rgba(20, 20, 40, .06);
  --container: 1140px;
  --header-h: 72px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --head: "Poppins", "Segoe UI", system-ui, sans-serif;
  --te: "Noto Sans Telugu", "Inter", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 18px; }
section { padding: 56px 0; }
h1, h2, h3, h4 { font-family: var(--head); line-height: 1.18; color: var(--ink); font-weight: 700; letter-spacing: -.01em; }
h2.section-title { font-size: clamp(1.55rem, 4.5vw, 2.25rem); font-weight: 800; }
.section-head { text-align: center; max-width: 700px; margin: 0 auto 36px; }
.section-head p { color: var(--muted); margin-top: 10px; }
.te { font-family: var(--te); font-weight: 500; }
.eyebrow { display: inline-block; font-size: .76rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--orange); margin-bottom: 8px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 22px; border-radius: 999px; font-weight: 600; font-size: .95rem; font-family: var(--font); cursor: pointer; border: 2px solid transparent; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; white-space: nowrap; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: var(--orange); color: #fff; box-shadow: 0 10px 22px rgba(243,112,33,.34); }
.btn-primary:hover { background: var(--orange-dark); }
.btn-maroon { background: var(--maroon); color: #fff; }
.btn-maroon:hover { background: var(--maroon-dark); }
.btn-ghost { background: #fff; color: var(--maroon); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--maroon); }
.btn-white { background: #fff; color: var(--maroon); }
.btn-lg { padding: 16px 28px; font-size: 1rem; }

/* Top strip */
.topbar { background: var(--maroon-dark); color: #fff; font-size: .84rem; }
.topbar .container { display: flex; align-items: center; gap: 20px; min-height: 40px; }
.topbar a, .topbar span { color: #fff; opacity: .95; display: inline-flex; align-items: center; gap: 6px; }
.topbar a:hover { opacity: 1; }
.topbar .tb-spacer { flex: 1; }
.topbar .tb-wa { font-weight: 600; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.97); backdrop-filter: saturate(180%) blur(8px); border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); }
.brand { display: flex; align-items: center; }
.brand-logo { height: 50px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links a { padding: 9px 13px; border-radius: 999px; font-weight: 500; font-size: .93rem; color: var(--ink); transition: background .15s ease, color .15s ease; }
.nav-links a:hover { background: var(--bg-soft); color: var(--maroon); }
.nav-links a.active { color: var(--maroon); font-weight: 600; }
.nav-cta { margin-left: 8px; color: #fff !important; }
.nav-cta:hover { color: #fff !important; background: var(--orange-dark) !important; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 10px; margin-right: -6px; }
.nav-toggle span { width: 24px; height: 2.5px; background: var(--maroon); border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* Announcement bar (CMS-driven) */
.notice-bar { background: #fff6e9; border-bottom: 1px solid #f6e0c4; color: #7a4a12; overflow: hidden; }
.notice-bar .container { display: flex; align-items: center; gap: 12px; min-height: 42px; }
.notice-bar .tag { background: var(--orange); color: #fff; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.notice-bar .ticker { flex: 1; overflow: hidden; white-space: nowrap; }
.notice-bar .ticker .run { display: inline-block; padding-left: 100%; animation: ticker 26s linear infinite; font-weight: 500; font-size: .9rem; }
.notice-bar .ticker .run span { margin: 0 26px; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-100%); } }

/* Hero */
.hero { position: relative; background: linear-gradient(135deg, rgba(109,16,18,.95), rgba(138,22,24,.86)), url("../images/hero.jpg") center/cover no-repeat, var(--maroon); color: #fff; padding: 66px 0 74px; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -120px; top: -120px; width: 340px; height: 340px; background: radial-gradient(circle, rgba(243,112,33,.35), transparent 70%); border-radius: 50%; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; }
.hero .badge { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); padding: 7px 15px; border-radius: 999px; font-size: .8rem; font-weight: 600; margin-bottom: 18px; }
.hero h1 { font-size: clamp(2.05rem, 6vw, 3.25rem); color: #fff; font-weight: 800; }
.hero h1 .accent { color: var(--gold); }
.hero .te-tag { display: block; font-size: clamp(1rem, 3.4vw, 1.25rem); color: #ffd98a; margin-top: 12px; font-weight: 500; }
.hero p.lead { margin: 14px 0 26px; font-size: 1.06rem; opacity: .95; max-width: 540px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-card { background: #fff; color: var(--ink); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.hero-card h3 { color: var(--maroon); margin-bottom: 6px; font-size: 1.05rem; }
.hero-card .result-big { font-size: 3rem; font-weight: 800; color: var(--orange); line-height: 1; font-family: var(--head); }
.hero-card .result-sub { color: var(--muted); font-size: .9rem; }
.hero-stats { display: flex; gap: 16px; margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; }
.hero-stats div { flex: 1; }
.hero-stats strong { display: block; font-size: 1.4rem; color: var(--maroon); font-family: var(--head); font-weight: 700; }
.hero-stats span { font-size: .76rem; color: var(--muted); }

/* Marquee */
.strip { background: var(--orange); color: #fff; padding: 12px 0; font-weight: 600; overflow: hidden; white-space: nowrap; }
.strip .track { display: inline-block; animation: scroll 24s linear infinite; }
.strip .track span { margin: 0 24px; }
@keyframes scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Cards */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-soft); transition: transform .18s ease, box-shadow .18s ease; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card .ico { width: 54px; height: 54px; border-radius: 15px; display: grid; place-items: center; font-size: 1.5rem; background: #fff3ea; color: var(--orange); margin-bottom: 14px; }
.card h3 { font-size: 1.1rem; margin-bottom: 6px; }
.card p { color: var(--muted); font-size: .93rem; }
.bg-soft { background: var(--bg-soft); }

/* News cards (CMS) */
.news-card { background:#fff; border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow-soft); transition:transform .18s ease, box-shadow .18s ease; }
.news-card:hover { transform:translateY(-4px); box-shadow:var(--shadow); }
.news-card .date { display:inline-block; background:#fff3ea; color:var(--orange); font-size:.76rem; font-weight:700; padding:4px 10px; border-radius:999px; margin-bottom:10px; }
.news-card .body { padding:22px; }
.news-card h3 { font-size:1.08rem; margin-bottom:6px; }
.news-card p { color:var(--muted); font-size:.92rem; }

/* Stats band */
.stats-band { background: var(--maroon); color: #fff; }
.stats-band .grid-4 { text-align: center; }
.stats-band .stat strong { font-size: 2.4rem; color: var(--gold); display: block; font-family: var(--head); font-weight: 800; }
.stats-band .stat span { opacity: .9; font-size: .9rem; }

/* Toppers */
.topper { text-align: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 16px; box-shadow: var(--shadow-soft); }
.topper .ring { width: 82px; height: 82px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--orange) 0 100%, var(--line) 0); color: #fff; font-weight: 800; font-size: 1.1rem; font-family: var(--head); border: 4px solid #fff; box-shadow: 0 0 0 2px var(--orange); }
.topper .marks { color: var(--orange); font-weight: 800; font-size: 1.4rem; font-family: var(--head); }
.topper .name { font-weight: 600; }
.topper .out { color: var(--muted); font-size: .8rem; }

/* Split */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.split img { border-radius: var(--radius); box-shadow: var(--shadow); }
.checklist { list-style: none; margin-top: 16px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.checklist li::before { content: "✓"; color: #fff; background: var(--orange); min-width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 800; margin-top: 3px; }

/* Gallery */
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.gallery-grid .g-item { aspect-ratio: 4/3; border-radius: var(--radius-sm); overflow: hidden; background: linear-gradient(135deg,#f0e4d8,#f7ede1); position: relative; cursor: pointer; }
.gallery-grid .g-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.gallery-grid .g-item:hover img { transform: scale(1.06); }
.g-item .cap { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(transparent, rgba(0,0,0,.72)); color: #fff; padding: 20px 12px 10px; font-size: .82rem; font-weight: 500; }

/* Page banner */
.page-banner { background: linear-gradient(135deg, var(--maroon-dark), var(--maroon)); color: #fff; padding: 48px 0; text-align: center; }
.page-banner h1 { color: #fff; font-size: clamp(1.7rem, 5vw, 2.5rem); font-weight: 800; }
.breadcrumb { opacity: .85; font-size: .9rem; margin-top: 8px; }
.breadcrumb a { color: var(--gold); }

/* Forms */
.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-soft); }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 6px; }
.field input, .field select, .field textarea { width: 100%; padding: 13px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); font-size: .95rem; font-family: inherit; transition: border-color .15s ease, box-shadow .15s ease; background: #fff; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(243,112,33,.12); }
.field textarea { min-height: 110px; resize: vertical; }
.form-note { font-size: .84rem; color: var(--muted); margin-top: 4px; }
.form-msg { padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; font-weight: 600; display: none; }
.form-msg.ok { display: block; background: #e8f7ee; color: #1a7f43; }
.form-msg.err { display: block; background: #fdecec; color: #c0392b; }

/* Contact info */
.info-row { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 22px; }
.info-row .ico { min-width: 46px; height: 46px; border-radius: 12px; background: #fff3ea; color: var(--orange); display: grid; place-items: center; font-size: 1.2rem; }
.info-row h4 { margin-bottom: 2px; }
.info-row p { color: var(--muted); font-size: .93rem; }

/* CTA band */
.cta-band { background: linear-gradient(135deg, var(--orange), var(--orange-dark)); color: #fff; text-align: center; border-radius: var(--radius); padding: 46px 24px; box-shadow: var(--shadow); }
.cta-band h2 { color: #fff; font-size: clamp(1.55rem, 4vw, 2.1rem); font-weight: 800; }
.cta-band .te-tag { display:block; color:#ffe6c7; font-size:1.05rem; margin-top:8px; }
.cta-band p { opacity: .96; margin: 10px 0 22px; }

/* Login gateway */
.login-wrap { min-height: calc(100vh - var(--header-h)); display: grid; place-items: center; background: var(--bg-soft); padding: 40px 18px; }
.login-card { width: 100%; max-width: 440px; background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 34px; box-shadow: var(--shadow); text-align: center; }
.login-card .lock { width: 66px; height: 66px; margin: 0 auto 16px; border-radius: 20px; background: var(--maroon); color: #fff; display: grid; place-items: center; font-size: 1.9rem; }
.login-card h1 { color: var(--maroon); font-size: 1.6rem; }
.login-card p.sub { color: var(--muted); margin: 8px 0 22px; }
.login-steps { text-align: left; background: var(--bg-soft); border-radius: var(--radius-sm); padding: 16px 18px 16px 20px; margin-bottom: 22px; }
.login-steps li { margin: 0 0 8px 18px; font-size: .92rem; color: var(--muted); }
.login-back { display: inline-block; margin-top: 18px; color: var(--muted); font-size: .9rem; }
.login-back:hover { color: var(--maroon); }

/* ===== ADMIN HUB ===== */
.admin-body { background: var(--bg-soft); min-height: 100vh; }
.admin-top { background: var(--maroon); color:#fff; }
.admin-top .container { display:flex; align-items:center; justify-content:space-between; min-height:64px; gap:12px; }
.admin-top .brand-mini { display:flex; align-items:center; gap:10px; font-family:var(--head); font-weight:700; }
.admin-top .brand-mini img { height:34px; background:#fff; border-radius:8px; padding:3px 6px; }
.admin-top a.exit { color:#fff; opacity:.9; font-size:.9rem; }
.admin-top a.exit:hover { opacity:1; }
.admin-hello { padding: 34px 0 10px; }
.admin-hello h1 { font-size: clamp(1.5rem,4vw,2rem); }
.admin-hello p { color: var(--muted); margin-top:6px; }
.hub-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:20px; padding: 20px 0 50px; }
.hub-card { background:#fff; border:1px solid var(--line); border-radius:var(--radius); padding:26px; box-shadow:var(--shadow-soft); transition:transform .18s ease, box-shadow .18s ease; display:flex; flex-direction:column; }
.hub-card:hover { transform:translateY(-4px); box-shadow:var(--shadow); }
.hub-card .ico { width:56px; height:56px; border-radius:16px; display:grid; place-items:center; font-size:1.6rem; margin-bottom:14px; }
.hub-card .ico.a { background:#fff3ea; color:var(--orange); }
.hub-card .ico.b { background:#eaf3ff; color:#2b6fd6; }
.hub-card .ico.c { background:#eafbf0; color:#1a9e4b; }
.hub-card .ico.d { background:#f3ecff; color:#7a45d1; }
.hub-card h3 { font-size:1.12rem; margin-bottom:6px; }
.hub-card p { color:var(--muted); font-size:.92rem; flex:1; }
.hub-card .go { margin-top:16px; font-weight:600; color:var(--maroon); }
.hub-note { background:#fff6e9; border:1px solid #f6e0c4; color:#7a4a12; border-radius:var(--radius); padding:16px 18px; font-size:.9rem; margin-bottom: 30px; }

/* Footer */
.site-footer { background: #14171f; color: #c7ccd6; padding: 50px 0 90px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 30px; }
.site-footer h4 { color: #fff; margin-bottom: 14px; font-size: 1rem; }
.site-footer a { color: #c7ccd6; font-size: .92rem; }
.site-footer a:hover { color: var(--orange); }
.footer-links { list-style: none; display: grid; gap: 9px; }
.footer-brand img { height: 46px; background: #fff; padding: 6px 10px; border-radius: 10px; margin-bottom: 14px; }
.footer-brand p { font-size: .9rem; opacity: .85; }
.social { display: flex; gap: 10px; margin-top: 14px; }
.social a { width: 38px; height: 38px; border-radius: 10px; background: #222834; display: grid; place-items: center; }
.social a:hover { background: var(--orange); color: #fff; }
.footer-bottom { border-top: 1px solid #262b36; margin-top: 34px; padding-top: 18px; text-align: center; font-size: .85rem; opacity: .8; }

/* Floating WhatsApp (desktop) */
.fab-wa { position: fixed; right: 18px; bottom: 18px; z-index: 60; width: 56px; height: 56px; border-radius: 50%; background: #25d366; color: #fff; display: grid; place-items: center; font-size: 1.6rem; box-shadow: 0 8px 20px rgba(37,211,102,.45); }
.fab-wa:hover { transform: scale(1.06); }
.mobile-bar { display: none; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.9); z-index: 100; display: none; place-items: center; padding: 20px; }
.lightbox.open { display: grid; }
.lightbox img { max-width: 92vw; max-height: 86vh; border-radius: 10px; }
.lightbox .close { position: absolute; top: 18px; right: 24px; color: #fff; font-size: 2.4rem; cursor: pointer; }

/* Reveal */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }

/* Responsive */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hub-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .topbar .tb-hide-mobile { display: none; }
  .topbar .container { justify-content: space-between; gap: 10px; }
  .nav-links { position: fixed; top: var(--header-h); left: 0; right: 0; background: #fff; flex-direction: column; align-items: stretch; gap: 0; padding: 10px 14px 20px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); transform: translateY(-150%); transition: transform .3s cubic-bezier(.22,1,.36,1); max-height: calc(100vh - var(--header-h)); overflow-y: auto; }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: 14px 14px; border-radius: 12px; font-size: 1.02rem; }
  .nav-links a:hover, .nav-links a.active { background: var(--bg-soft); }
  .nav-cta { margin: 10px 0 0; text-align: center; padding: 15px; font-size: 1.05rem; }
  .nav-toggle { display: flex; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hub-grid { grid-template-columns: 1fr; }
  section { padding: 42px 0; }
  .hero { padding: 44px 0 52px; }
  .hero-actions .btn { flex: 1; }
  .hero-card { padding: 22px; }
  .brand-logo { height: 40px; }
  .mobile-bar { display: grid; grid-template-columns: repeat(3, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(0,0,0,.08); padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); }
  .mobile-bar a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: .72rem; font-weight: 600; color: var(--muted); padding: 6px 4px; border-radius: 12px; }
  .mobile-bar a .mb-ico { font-size: 1.3rem; line-height: 1; }
  .mobile-bar a.call { color: var(--maroon); }
  .mobile-bar a.wa { color: #1a9e4b; }
  .mobile-bar a.apply { color: #fff; background: var(--orange); }
  .fab-wa { display: none; }
}
@media (max-width: 430px) {
  .footer-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr 1fr; }
  .brand-logo { height: 36px; }
  .hero h1 { font-size: 1.95rem; }
  .topbar { font-size: .8rem; }
}
