/* ==========================================================================
   MASAGANA HIGH SCHOOL SIS - INTEGRATED STYLESHEET
   ========================================================================== */

:root {
  /* Color Palette - Core */
  --maroon-900: #4b0e1f;
  --maroon-700: #6e1830;
  --maroon-600: #8a2140;
  --gold-500: #c9973e;
  --gold-300: #e4c57f;
  --cream-50: #f8f3e8;
  --cream-100: #f0e8d8;
  --ink-900: #241a12;
  --ink-600: #5b5044;
  --ink-400: #8b8073;
  --line: #ded2b8;
  --error-red: #d32f2f;

  /* Color Palette - Portal & Profile */
  --maroon-deep: #5c0f1b;
  --maroon: #7a1b2b;
  --maroon-mid: #8e2236;
  --maroon-bright: #a13447;
  --cream: #fbf1de;
  --cream-dark: #f0e4c8;
  --paper: #fffcf6;
  --ink: #2b1b12;
  --ink-soft: #5a3e34;
  --gold: #d9a632;
  --gold-soft: #e8cb87;
  --gold-pale: #f5e9c3;
  --leaf: #3f7d44;

  /* Elevation Shadows */
  --shadow-md: 0 8px 28px -8px rgba(42, 10, 16, 0.22);
  --shadow-lg: 0 18px 48px -14px rgba(42, 10, 16, 0.38);
}

@view-transition {
  navigation: auto;
}

/* ==========================================================================
   Base Styles & Reset
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  overscroll-behavior-y: none;
  font-size: 16px;
}

body {
  font-family: 'Public Sans', 'Inter', system-ui, sans-serif;
  background: var(--cream-50);
  color: var(--ink-900);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.portal-page {
  font-family: 'Inter', sans-serif;
  color: var(--ink);
  background: var(--cream);
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
}

:focus-visible {
  outline: 2px solid var(--maroon-600);
  outline-offset: 3px;
}

svg {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  max-width: 100%;
  max-height: 100%;
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1,
h2,
h3,
.serif-font,
.display {
  font-family: 'Fraunces', 'Source Serif 4', serif;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.portal-page h1,
.portal-page h2,
.portal-page h3,
.portal-page .display {
  font-family: 'Source Serif 4', serif;
  letter-spacing: -0.015em;
  line-height: 1.12;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-300);
  font-weight: 600;
  display: block;
  margin-bottom: 12px;
}

.portal-page .eyebrow {
  font-family: 'Spectral SC', serif;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.7rem;
  color: var(--gold);
  font-weight: 500;
}

.caveat {
  font-family: 'Caveat', cursive;
  font-weight: 700;
}

.italic {
  font-style: italic;
}

/* ==========================================================================
   Containers & Utility Components
   ========================================================================== */

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.btn {
  padding: 12px 22px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
  border: none;
  font-family: inherit;
  text-align: center;
  min-height: 40px;
}

.btn-gold {
  background: var(--gold-500);
  color: var(--maroon-900);
}

.btn-gold:hover {
  background: var(--gold-300);
}

.btn-line {
  border: 1px solid rgba(228, 197, 127, 0.5);
  color: var(--cream-50);
}

.btn-line:hover {
  background: rgba(228, 197, 127, 0.1);
}

.btn-full {
  width: 100%;
  padding: 12px;
  font-size: 14.5px;
}

/* Banig Background Patterns */
.banig {
  background-image:
    repeating-linear-gradient(60deg, rgba(43, 27, 18, 0.04) 0 1.5px, transparent 1.5px 20px),
    repeating-linear-gradient(-60deg, rgba(43, 27, 18, 0.04) 0 1.5px, transparent 1.5px 20px);
}

.banig-light {
  background-image:
    repeating-linear-gradient(60deg, rgba(255, 255, 255, 0.05) 0 1.5px, transparent 1.5px 20px),
    repeating-linear-gradient(-60deg, rgba(255, 255, 255, 0.05) 0 1.5px, transparent 1.5px 20px);
}

/* ==========================================================================
   Landing & Navigation Header Styles
   ========================================================================== */

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  gap: 12px;
}
#mainNav { padding: 7px 0 !important }

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border: 1.5px solid var(--maroon-700);
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.brand-name {
  font-size: 13.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
  line-height: 1.3;
}

.brand-name span {
  display: block;
  font-size: 10.5px;
  color: var(--gold-500);
  text-transform: none;
  font-weight: 400;
  font-family: 'Public Sans', sans-serif;
}

.badge {
  font-size: 11.5px;
  text-transform: uppercase;
  border: 1px solid var(--gold-500);
  color: var(--maroon-700);
  background: var(--cream-100);
  padding: 6px 12px;
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  text-align: center;
  transition: background 0.15s;
}

.badge:hover {
  background: #e8dfc8;
  border-color: var(--maroon-700);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-500);
  flex-shrink: 0;
}

/* ==========================================================================
   Landing Hero Section
   ========================================================================== */

.hero {
  position: relative;
  background: var(--maroon-900);
  color: var(--cream-50);
  overflow: hidden;
}

.crest-field {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  opacity: 0.14;
  pointer-events: none;
  transform: translateX(18%);
}

.hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
  padding: 64px 0 56px;
}

h1.headline {
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.15;
  margin-bottom: 16px;
}

.hero p.sub {
  font-size: 15px;
  line-height: 1.7;
  color: var(--cream-100);
  max-width: 440px;
  margin-bottom: 26px;
}

.cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-foot {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 32px;
  border-top: 1px solid rgba(228, 197, 127, 0.28);
  padding: 20px 0 24px;
  font-size: 12px;
  color: var(--gold-300);
  flex-wrap: wrap;
}

.hero-foot strong {
  display: block;
  color: var(--cream-50);
  font-size: 18px;
}

/* Hero Interface Mockup */
.mock {
  background: var(--cream-50);
  color: var(--ink-900);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 25px 50px -15px rgba(0, 0, 0, 0.45);
  border: 1px solid var(--line);
}

.mock-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--cream-100);
  border-bottom: 1px solid var(--line);
}

.mock-bar span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line);
}

.mock-url {
  margin-left: 8px;
  font-size: 11px;
  color: var(--ink-400);
  background: #fff;
  border: 1px solid var(--line);
  padding: 3px 10px;
  border-radius: 3px;
}

.mock-body {
  padding: 20px;
}

.mock-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0 10px;
}

.mock-card {
  background: var(--cream-100);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
}

.mock-card .k {
  font-size: 10px;
  color: var(--ink-400);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.mock-card .v {
  font-size: 19px;
  font-weight: 600;
  color: var(--maroon-700);
}

.mock-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--cream-100);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 12px;
}

.mock-row .p {
  font-size: 10px;
  color: var(--maroon-700);
  background: rgba(201, 151, 62, 0.18);
  padding: 2px 8px;
  border-radius: 3px;
  font-weight: 600;
}

/* ==========================================================================
   Features Section
   ========================================================================== */

section {
  padding: 56px 0;
  border-bottom: 1px solid var(--line);
}

.section-head {
  max-width: 560px;
  margin-bottom: 38px;
}

.section-head .eyebrow {
  color: var(--maroon-700);
}

.section-head h2 {
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.2;
  margin-bottom: 12px;
}

.section-head p {
  color: var(--ink-600);
  font-size: 15px;
  line-height: 1.65;
}

.features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.feature {
  background: var(--cream-50);
  padding: 24px 20px;
}

.feature .num {
  font-size: 12.5px;
  color: var(--gold-500);
  margin-bottom: 12px;
  font-weight: 700;
}

.feature h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

.feature p {
  font-size: 13px;
  color: var(--ink-600);
  line-height: 1.6;
}

/* ==========================================================================
   Authentication Styles (Login / Register)
   ========================================================================== */

.auth-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  min-height: calc(100vh - 180px);
  padding: 30px 0;
}

.auth-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 16px 36px -12px rgba(0, 0, 0, 0.08);
  width: 100%;
}

.auth-tabs {
  display: flex;
  border-bottom: 2px solid var(--line);
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.tab-btn {
  background: none;
  border: none;
  padding: 8px 4px 10px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-400);
  cursor: pointer;
  position: relative;
  transition: color 0.15s;
}

.tab-btn.active {
  color: var(--maroon-900);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--maroon-700);
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
}

.form-group {
  margin-bottom: 16px;
  width: 100%;
}

.form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-900);
  margin-bottom: 5px;
}

.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: inherit;
  font-size: 13.5px;
  background: var(--cream-50);
  color: var(--ink-900);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus {
  outline: none;
  border-color: var(--maroon-600);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(138, 33, 64, 0.12);
}

.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-wrapper .form-input {
  padding-right: 40px;
}

.btn-toggle-pw {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-600);
  border-radius: 4px;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.error-msg {
  display: block;
  font-size: 11.5px;
  color: var(--error-red);
  margin-top: 4px;
  min-height: 15px;
  font-weight: 500;
}

/* ==========================================================================
   Portal Global Components
   ========================================================================== */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(92, 15, 27, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(232, 203, 135, 0.14);
}

.nav.scrolled {
  box-shadow: 0 4px 24px -4px rgba(40, 6, 12, 0.45);
}

.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  height: 58px;
}

.account-burger-btn {
  background: rgba(251, 241, 222, 0.1);
  border: 1px solid rgba(232, 203, 135, 0.25);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}

.account-burger-btn:hover {
  background: rgba(251, 241, 222, 0.2);
}

.nav-crest {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  background: radial-gradient(circle at 30% 28%, var(--gold-soft), var(--gold) 55%, #8a6c25);
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-school-name {
  color: #fff;
  font-family: 'Source Serif 4', serif;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.2;
  flex-grow: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-school-name span {
  display: block;
  font-family: 'Spectral SC', serif;
  font-size: 0.62rem;
  color: var(--gold-soft);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: 0.2rem;
}

.nav-link {
  color: rgba(251, 241, 222, 0.8);
  font-size: 0.84rem;
  font-weight: 500;
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.nav-link:hover {
  color: #fff;
  background: rgba(251, 241, 222, 0.1);
}

.nav-cta {
  background: var(--gold);
  color: var(--maroon-deep);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.45rem 1rem;
  border-radius: 7px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Drawer UI */
.account-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 3, 6, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.account-drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.account-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 290px;
  max-width: 85vw;
  background: var(--maroon-deep);
  color: #fff;
  z-index: 201;
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  box-shadow: 8px 0 32px rgba(0, 0, 0, 0.45);
  border-right: 1px solid rgba(232, 203, 135, 0.2);
}

.account-drawer.active {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0.8rem 1rem 0.2rem;
}

.drawer-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: rgba(251, 241, 222, 0.85);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.user-profile-card {
  display: block;
  padding: 0.4rem 1rem 0.6rem;
  text-align: center;
  text-decoration: none;
  color: inherit;
  border-radius: 10px;
  margin: 0 0.5rem;
}

.user-pfp-wrapper {
  width: 60px;
  height: 60px;
  margin: 0 auto 0.5rem;
  border-radius: 50%;
  padding: 2px;
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
}

.user-pfp {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.user-info .user-name {
  font-family: 'Source Serif 4', serif;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.1rem;
}

.user-info .user-email {
  display: block;
  font-size: 0.74rem;
  color: var(--gold-soft);
  word-break: break-all;
  margin-bottom: 0.3rem;
}

.user-info .user-desc {
  font-size: 0.74rem;
  color: rgba(251, 241, 222, 0.8);
  line-height: 1.35;
  background: rgba(0, 0, 0, 0.22);
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  border: 1px solid rgba(251, 241, 222, 0.08);
  text-align: left;
}

.drawer-divider {
  height: 1px;
  background: rgba(232, 203, 135, 0.15);
  margin: 0.4rem 1rem;
}

.drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0 0.75rem;
  margin-bottom: 0.8rem;
  overflow-y: auto;
}

.drawer-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.8rem;
  color: rgba(251, 241, 222, 0.85);
  font-size: 0.86rem;
  font-weight: 500;
  border-radius: 8px;
  transition: background 0.15s;
}

.drawer-link:hover {
  background: rgba(251, 241, 222, 0.1);
  color: #fff;
}

.drawer-footer {
  margin-top: auto;
  padding: 0.75rem;
  border-top: 1px solid rgba(232, 203, 135, 0.15);
  background: rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   Portal Page Specific Layout
   ========================================================================== */

.portal-page .hero {
  min-height: 90vh;
  position: relative;
  background:
    radial-gradient(ellipse 80% 60% at 50% 100%, rgba(217, 166, 50, 0.14) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(122, 27, 43, 0.3) 0%, transparent 50%),
    linear-gradient(160deg, var(--maroon-deep) 0%, #5a1223 50%, #3a0b10 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  padding: 100px 2rem 60px;
  overflow: hidden;
}

.sunburst {
  position: absolute;
  width: 620px;
  height: 620px;
  border-radius: 50%;
  background: conic-gradient(
    rgba(217, 166, 50, 0.09) 0deg, transparent 15deg,
    rgba(217, 166, 50, 0.09) 30deg, transparent 45deg,
    rgba(217, 166, 50, 0.09) 60deg, transparent 75deg,
    rgba(217, 166, 50, 0.09) 90deg, transparent 105deg,
    rgba(217, 166, 50, 0.09) 120deg, transparent 135deg,
    rgba(217, 166, 50, 0.09) 150deg, transparent 165deg,
    rgba(217, 166, 50, 0.09) 180deg, transparent 195deg,
    rgba(217, 166, 50, 0.09) 210deg, transparent 225deg,
    rgba(217, 166, 50, 0.09) 240deg, transparent 255deg,
    rgba(217, 166, 50, 0.09) 270deg, transparent 285deg,
    rgba(217, 166, 50, 0.09) 300deg, transparent 315deg,
    rgba(217, 166, 50, 0.09) 330deg, transparent 345deg,
    rgba(217, 166, 50, 0.09) 360deg
  );
  animation: spin 80s linear infinite;
  pointer-events: none;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.rice-hero {
  position: absolute;
  bottom: 0;
  opacity: 0.18;
  pointer-events: none;
  display: flex;
  gap: 6px;
}

.rice-hero.left { left: -12px; bottom: -20px; }
.rice-hero.right { right: -12px; bottom: -20px; transform: scaleX(-1); }

.rice-stk { width: 28px; height: 160px; }

.hero-crest {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  position: relative;
  z-index: 2;
  background: radial-gradient(circle at 32% 28%, var(--gold-soft), var(--gold) 55%, #8a6c25);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.4rem;
}

.hero-crest svg { width: 38px; height: 38px; }

.portal-page .hero h1 {
  font-size: clamp(2rem, 5vw, 3.8rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 0.9rem;
}

.portal-page .hero h1 em { color: var(--gold-soft); font-style: normal; }

.hero-desc {
  font-size: clamp(0.92rem, 1.8vw, 1.05rem);
  line-height: 1.65;
  color: rgba(251, 241, 222, 0.75);
  max-width: 520px;
  margin: 0 auto 0.6rem;
}

.hero-motto {
  font-family: 'Source Serif 4', serif;
  font-style: italic;
  color: var(--gold-soft);
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  margin-bottom: 2rem;
}

.hero-btns {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
}

.btn-hero-primary {
  background: var(--gold);
  color: var(--maroon-deep);
  font-weight: 700;
  padding: 0.8rem 1.6rem;
  border-radius: 8px;
  font-size: 0.92rem;
  transition: transform 0.12s;
  text-align: center;
}

.btn-hero-primary:hover { transform: translateY(-2px); }

.btn-hero-ghost {
  background: rgba(251, 241, 222, 0.1);
  color: #fff;
  font-weight: 600;
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  font-size: 0.92rem;
  border: 1.5px solid rgba(251, 241, 222, 0.25);
  transition: background 0.15s;
  text-align: center;
}

.hero-wave {
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  pointer-events: none;
  z-index: 2;
  width: 100%;
}

/* Stats Counter Bar */
.stats-strip {
  background: var(--maroon);
  color: #fff;
  padding: 2rem 1.5rem;
  position: relative;
  z-index: 3;
}

.stats-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.stat-item {
  text-align: center;
  padding: 0.8rem 0.6rem;
  border-right: 1px solid rgba(251, 241, 222, 0.14);
}
.stat-item:last-child { border-right: none; }

.stat-n {
  font-family: 'Source Serif 4', serif;
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--gold-soft);
  line-height: 1;
}

.stat-lbl {
  font-size: 0.75rem;
  color: rgba(251, 241, 222, 0.65);
  margin-top: 0.3rem;
}

.stat-fil {
  font-family: 'Caveat', cursive;
  font-size: 0.9rem;
  color: var(--gold);
}

/* Sections Global */
.portal-page .section { padding: 4.5rem 0; }
.section-alt { background: var(--paper); }

.section-header {
  text-align: center;
  margin-bottom: 2.8rem;
}

.section-header h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 700;
  margin-top: 0.4rem;
}

.section-header p {
  font-size: 0.94rem;
  color: var(--ink-soft);
  max-width: 500px;
  margin: 0.6rem auto 0;
  line-height: 1.65;
}

.parol-rule {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 0.8rem auto 0;
  max-width: 200px;
}

.parol-rule::before,
.parol-rule::after {
  content: '';
  flex: 1;
  height: 1.5px;
  background: var(--gold-soft);
  border-radius: 2px;
}

.parol-star { color: var(--gold); font-size: 0.65rem; }

/* About Section */
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3.5rem;
  align-items: center;
}

.about-text h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  margin: 0.4rem 0 1rem;
}

.about-text p {
  font-size: 0.94rem;
  color: var(--ink-soft);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.about-visual {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(160deg, var(--maroon-deep), var(--maroon));
  aspect-ratio: 4/3;
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
}

.about-school-badge {
  text-align: center;
  color: #fff;
  padding: 1.2rem;
}

.about-school-badge .caveat {
  font-size: 2.2rem;
  color: var(--gold);
  display: block;
}

.about-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.2rem;
}

.about-tag {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.25rem 0.7rem;
  border-radius: 99px;
  background: var(--gold-pale);
  color: var(--maroon-deep);
  border: 1px solid var(--gold-soft);
}

/* Services Grid */
.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.svc-card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.5rem 1.2rem;
  transition: transform 0.15s, border-color 0.15s;
}
.svc-card:hover { transform: translateY(-2px); border-color: var(--gold-500); }

.svc-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  margin-bottom: 0.9rem;
  background: linear-gradient(160deg, var(--maroon-bright), var(--maroon-deep));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.svc-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.2rem; }
.svc-card .svc-fil { font-family: 'Caveat', cursive; font-size: 0.85rem; color: var(--gold); display: block; margin-bottom: 0.5rem; }
.svc-card p { font-size: 0.81rem; color: var(--ink-soft); line-height: 1.55; }

.svc-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.8rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--maroon-bright);
}

/* Announcements Section */
.ann-section {
  background: var(--maroon-deep);
  color: #fff;
  position: relative;
}

.ann-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.ann-card {
  background: rgba(251, 241, 222, 0.06);
  border: 1px solid rgba(251, 241, 222, 0.14);
  border-radius: 12px;
  padding: 1.2rem;
}

.ann-date-row { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.75rem; }
.ann-date-box {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  text-align: center;
  background: rgba(217, 166, 50, 0.2);
  border: 1px solid rgba(217, 166, 50, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ann-date-box .d { font-family: 'Source Serif 4', serif; font-weight: 700; font-size: 1rem; color: var(--gold-soft); line-height: 1; }
.ann-date-box .m { font-size: 0.55rem; color: rgba(251, 241, 222, 0.6); text-transform: uppercase; }

.ann-tag { font-size: 0.64rem; font-weight: 600; text-transform: uppercase; padding: 0.15rem 0.5rem; border-radius: 99px; }
.ann-tag-gold { background: rgba(217, 166, 50, 0.2); color: var(--gold-soft); }
.ann-tag-maroon { background: rgba(232, 203, 135, 0.1); color: rgba(251, 241, 222, 0.75); }
.ann-tag-leaf { background: rgba(63, 125, 68, 0.25); color: #7dc987; }

.ann-card h3 { font-size: 0.92rem; font-weight: 600; margin-bottom: 0.3rem; color: #fff; }
.ann-card p { font-size: 0.8rem; color: rgba(251, 241, 222, 0.6); line-height: 1.5; }

.ann-all-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 1.8rem;
  color: var(--gold-soft);
  font-size: 0.85rem;
  font-weight: 600;
}

/* School Life Gallery Grid */
.life-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.life-card {
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  aspect-ratio: 4/3;
  display: flex;
  align-items: flex-end;
  box-shadow: var(--shadow-sm);
}

.life-card.tall { grid-row: span 2; aspect-ratio: unset; min-height: 280px; }
.life-bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.life-grad { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(40, 8, 14, 0.75) 0%, transparent 55%); }

.life-label { position: relative; z-index: 1; padding: 0.9rem; font-size: 0.82rem; font-weight: 600; color: #fff; }
.life-label .life-fil { font-family: 'Caveat', cursive; font-size: 1rem; color: var(--gold-soft); display: block; line-height: 1; }

.lc-1 { background: linear-gradient(160deg, #6b1a28, #3d0c14); }
.lc-2 { background: linear-gradient(160deg, #2f6840, #1a3d24); }
.lc-3 { background: linear-gradient(160deg, #8a6c25, #4a3a0e); }
.lc-4 { background: linear-gradient(160deg, #1a4a6e, #0e2a44); }
.lc-5 { background: linear-gradient(160deg, #5a1c60, #2d0c32); }

/* Enrollment Banner */
.enroll-banner {
  background: linear-gradient(120deg, var(--gold) 0%, #c8902a 100%);
  padding: 2.8rem 1.5rem;
  text-align: center;
}

.enroll-banner-inner { max-width: 600px; margin: 0 auto; }
.enroll-banner .caveat { font-size: 1.3rem; color: var(--maroon-deep); display: block; margin-bottom: 0.2rem; }
.enroll-banner h2 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); color: var(--maroon-deep); font-weight: 700; margin-bottom: 0.5rem; }
.enroll-banner p { color: rgba(43, 27, 18, 0.75); font-size: 0.92rem; margin-bottom: 1.5rem; line-height: 1.55; }
.btn-enroll { background: var(--maroon-deep); color: #fff; font-weight: 700; padding: 0.8rem 1.8rem; border-radius: 8px; font-size: 0.92rem; display: inline-block; }

/* Footer Section */
.footer-top {
  background: var(--maroon-deep);
  color: #fff;
  padding: 3.8rem 0 2.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
}

.footer-brand .school-nm { font-family: 'Source Serif 4', serif; font-weight: 700; font-size: 1.1rem; color: #fff; }
.footer-brand .school-loc { font-size: 0.72rem; color: var(--gold-soft); font-family: 'Spectral SC', serif; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.8rem; }
.footer-brand p { font-size: 0.82rem; color: rgba(251, 241, 222, 0.58); line-height: 1.65; max-width: 280px; }

.footer-col h4 { font-size: 0.68rem; font-family: 'Spectral SC', serif; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gold); margin-bottom: 0.8rem; }
.footer-col a { display: block; font-size: 0.82rem; color: rgba(251, 241, 222, 0.65); margin-bottom: 0.4rem; }
.footer-col address { font-style: normal; font-size: 0.82rem; color: rgba(251, 241, 222, 0.65); line-height: 1.65; }

.social-row { display: flex; gap: 0.5rem; margin-top: 1rem; }
.social-btn { width: 32px; height: 32px; border-radius: 6px; background: rgba(251, 241, 222, 0.08); display: flex; align-items: center; justify-content: center; color: #fff; }

.footer-bottom {
  background: #3a0b10;
  color: rgba(251, 241, 222, 0.45);
  font-size: 0.74rem;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.footer-bottom a { color: var(--gold-soft); }

.back-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 90;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--maroon);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.back-top.show { opacity: 1; transform: translateY(0); pointer-events: auto; }

.portal-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.9rem 1.5rem;
  background: var(--gold-pale);
  border-top: 1px solid var(--gold-soft);
  font-size: 0.84rem;
  color: var(--maroon-deep);
  flex-wrap: wrap;
  text-align: center;
}

.portal-strip a {
  background: var(--maroon-deep);
  color: #fff;
  font-weight: 600;
  font-size: 0.8rem;
  padding: 0.4rem 1rem;
  border-radius: 6px;
}

/* ==========================================================================
   Responsive Breakpoints & Media Queries
   ========================================================================== */

@media (max-width: 960px) {
  .nav-links { display: none; }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}

@media (max-width: 880px) {
  .hero-inner, .auth-container { grid-template-columns: 1fr; gap: 28px; padding: 36px 0; }
  .features { grid-template-columns: 1fr 1fr; }
  .wrap, .container { padding: 0 1rem; }
}

@media (max-width: 860px) {
  .ann-grid { grid-template-columns: 1fr; }
}

@media (max-width: 840px) {
  .about-grid { grid-template-columns: 1fr; gap: 2.2rem; }
}

@media (max-width: 760px) {
  .stats-inner { grid-template-columns: repeat(2, 1fr); }
  .life-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .nav-inner { padding: 0 0.8rem; gap: 0.5rem; }
  .nav-school-name { font-size: 0.82rem; }
  .nav-school-name span { font-size: 0.54rem; }
  .nav-cta { display: none; }
}

@media (max-width: 600px) {
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; text-align: center; }
  .social-row { justify-content: center; }
  .footer-brand p { margin: 0 auto; }
  .footer-bottom { flex-direction: column; justify-content: center; }
}

@media (max-width: 560px) {
  .services-grid { grid-template-columns: 1fr; }
}