/* ==========================================
           CSS VARIABLES (Design Tokens)
           ========================================== */
:root {
  /* Color palette - Blue, Dark Violet, Yellow, White */
  --bg: #f8fafc;
  --surface: #ffffff;
  --muted: #6b7280;
  --text: #1f2937;
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --primary-light: #60a5fa;
  --secondary: #8b5cf6;
  --secondary-dark: #7c3aed;
  --secondary-light: #a78bfa;
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --accent-light: #fbbf24;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #06b6d4;

  /* Semantic colors */
  --border-color: rgba(31, 41, 55, 0.08);
  --border-light: rgba(255, 255, 255, 0.08);
  --hover-overlay: rgba(59, 130, 246, 0.05);
  --focus-ring: rgba(59, 130, 246, 0.15);

  /* Spacing & sizing */
  --gap-xs: 0.4rem;
  --gap-sm: 0.8rem;
  --gap: 1.2rem;
  --gap-lg: 1.6rem;
  --radius: 0.5rem;
  --radius-sm: 0.25rem;
  --radius-lg: 0.75rem;
  --card-padding: 1rem;

  /* Typography */
  --font-sans: 'Inter', 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --base-size: 14px;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --line-height: 1.5;

  /* Elevation */
  --shadow-sm: 0 2px 6px rgba(31, 41, 55, 0.06);
  --shadow-md: 0 6px 20px rgba(31, 41, 55, 0.08);
  --shadow-lg: 0 10px 30px rgba(59, 130, 246, 0.08);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
  --transition-slow: 0.3s ease;

  /* Z-index layers */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal: 5040;
  --z-popover: 5050;
  --z-tooltip: 5060;
  --z-toast: 5070;
}

/* ==========================================
           BASE STYLES & RESETS
           ========================================== */
* { 
  box-sizing: border-box; 
}

html, body { 
  height: 100%; 
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Keep selection disabled globally but allow in content */
html, body { 
  user-select: none;
  overflow-x: auto;
  overflow-y: auto; 
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: var(--base-size);
  line-height: var(--line-height);
  margin: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Allow selection where it's expected */
.content, 
.card, 
input, 
textarea, 
select { 
  user-select: text; 
}

/* Accessible focus for interactive elements */
button:focus:not(.btn),
input:focus:not(.form-control),
select:focus:not(.form-select),
textarea:focus:not(.form-control) {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

/* ==========================================
           LAYOUT & CONTAINERS
           ========================================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--gap);
}

.content {
  margin-left: 0;
  padding: 1.5rem;
  transition: var(--transition-slow) ease;
  font-size: var(--text-xs);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ==========================================
           NAVIGATION COMPONENTS
           ========================================== */
.site-header {
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}

.site-nav { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  gap: 1rem; 
  padding: 0.5rem 1rem; 
}

.nav-list { 
  display: flex; 
  gap: 1.25rem; 
  align-items: center; 
  margin: 0; 
  padding: 0; 
  list-style: none; 
}

/* Desktop Navigation */
#nav {
  display: flex;
  gap: 25px;
  align-items: center;
}

/* NAV BUTTON (modern style) */
#navcontrol {
  display: none;
  font-size: 1.8rem;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
}

/* hide mobile toggle on desktop */
.nav-toggle { 
  display: none; 
  border: 0; 
  background: transparent; 
  font-size: 1.4rem; 
  cursor: pointer; 
  color: var(--text);
}

/* MOBILE: slide-in right menu */
@media (max-width: 900px) {
  #nav {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 260px;
    background: var(--surface);
    box-shadow: -2px 0 12px rgba(0,0,0,0.15);
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 100px;
    transform: translateX(100%);
    transition: transform 0.28s ease;
    z-index: 2000;
  }

  #nav[data-state="visible"] {
    transform: translateX(0);
  }

  #navcontrol {
    display: block;
  }

  .nav-list {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 270px;
    max-width: 85%;
    background: var(--surface);
    box-shadow: -8px 0 30px rgba(0,0,0,0.12);
    flex-direction: column;
    padding: 80px 20px;
    gap: 1rem;
    transform: translateX(100%);
    transition: transform .28s cubic-bezier(.2,.9,.2,1);
    z-index: 1200;
  }

  .nav-list.open {
    transform: translateX(0);
  }

  .nav-toggle { display: block; }

  /* make links large and tappable */
  .nav-list .nav-link { 
    font-size: 1.05rem; 
    padding: 10px 6px; 
    display: block; 
    color: var(--text);
    text-decoration: none;
  }
}

/* Small polish */
.nav-list .nav-link { 
  text-decoration: none; 
  color: var(--text);
  transition: color var(--transition-fast);
}

.nav-list .nav-link:hover {
  color: var(--primary);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-name {
  font-weight: 600;
  color: var(--text);
}

/* ==========================================
           BUTTONS
           ========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--gap-sm);
  padding: 0.45rem 0.9rem;
  border-radius: calc(var(--radius) - 0.1rem);
  font-weight: 600;
  font-size: var(--text-sm);
  line-height: 1;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  box-shadow: none;
  text-decoration: none;
}

.btn:active { 
  transform: translateY(1px); 
}

.btn:focus {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.btn[disabled],
.btn.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn-secondary {
  background: var(--secondary);
  border-color: var(--secondary);
  color: #fff;
}

.btn-secondary:hover {
  background: var(--secondary-dark);
  border-color: var(--secondary-dark);
}

.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #1f2937;
}

.btn-accent:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.btn-success {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.btn-outline:hover { 
  background: var(--hover-overlay); 
  border-color: var(--primary);
}

.btn-ghost {
  background: transparent;
  border: 1px dashed transparent;
  color: var(--text);
}

.btn-ghost:hover {
  background: var(--hover-overlay);
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: var(--text-xs);
  border-radius: calc(var(--radius) - 0.2rem);
}

.btn-lg {
  padding: 0.75rem 1.25rem;
  font-size: var(--text-lg);
}

.btn-block { 
  display: flex; 
  width: 100%; 
}

.btn-icon {
  padding: 0.45rem;
  border-radius: var(--radius-sm);
  width: 36px;
  height: 36px;
  justify-content: center;
}

.btn-primary-custom {
  background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
  border: none;
  border-radius: var(--radius);
  padding: 0.75rem 2rem;
  font-weight: 600;
  transition: all var(--transition-base);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
  color: #fff;
}

.btn-primary-custom:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
  color: #fff;
}

.action-btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}

/* ==========================================
           HERO SECTION
           ========================================== */
.hero {
  display: flex;
  align-items: center;
  padding: 2rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
  gap: 2rem;
}

.hero img {
  max-width: 50%;
  height: auto;
  border-radius: var(--radius);
}

.hero .text {
  flex: 1;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--text);
}

.hero p {
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 2rem;
  color: var(--muted);
}

.cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .hero {
    flex-direction: column;
    text-align: center;
  }
  
  .hero img {
    max-width: 100%;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .cta {
    justify-content: center;
  }
}

/* ==========================================
           FEATURES SECTION
           ========================================== */
.features {
  padding: 4rem 1rem;
  background: var(--surface);
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 3rem;
  color: var(--text);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.feature {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  border: 1px solid var(--border-color);
}

.feature:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.feature h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text);
}

.feature p {
  color: var(--muted);
  line-height: 1.6;
}

.feature .icon {
  border-radius: 50%;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  background: var(--hover-overlay);
  color: var(--primary);
}

/* ==========================================
           ADMISSIONS SECTION
           ========================================== */
.admissions {
  padding: 4rem 1rem;
  background: #eef2ff;
  text-align: center;
}

.admissions .section-title {
  margin-bottom: 1.5rem;
}

.admissions p {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  color: var(--muted);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.wave {
  display: block;
  width: 100%;
  height: auto;
}

/* ==========================================
           ABOUT SECTION
           ========================================== */
.about {
  padding: 4rem 1rem;
  text-align: center;
  background: var(--surface);
}

.about p {
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 2rem;
  color: var(--muted);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* ==========================================
           SIGNUP SECTION
           ========================================== */
.signup {
  padding: 4rem 1rem;
  background: var(--bg);
}

.signup-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.signup-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  border: 1px solid var(--border-color);
}

.signup-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.signup-card h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text);
}

.signup-card p {
  color: var(--muted);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

/* ==========================================
           CTA SECTION
           ========================================== */
.cta-section {
  padding: 4rem 1rem;
  text-align: center;
  background: linear-gradient(135deg, var(--primary-dark), var(--secondary-dark));
  color: white;
}

.cta-section h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.cta-section p {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  opacity: 0.9;
}

/* ==========================================
           FOOTER
           ========================================== */
footer {
  background-color: #1f2937;
  color: #f9fafb;
  padding: 60px 0 20px;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-column h3 {
  font-size: 1.3rem;
  margin-bottom: 25px;
  position: relative;
  padding-bottom: 10px;
  color: #fff;
}

.footer-column h3::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 3px;
  background-color: var(--accent);
}

.footer-column p {
  margin-bottom: 20px;
  opacity: 0.8;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 12px;
}

.footer-links a {
  color: #d1d5db;
  text-decoration: none;
  transition: var(--transition-base);
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-links a:hover {
  color: var(--accent-light);
  transform: translateX(5px);
}

.contact-info {
  list-style: none;
  padding: 0;
  margin: 0;
}

.contact-info li {
  margin-bottom: 15px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #d1d5db;
}

.contact-info i {
  color: var(--accent);
  margin-top: 5px;
}

.social-links {
  display: flex;
  gap: 15px;
  margin-top: 20px;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: #f9fafb;
  transition: var(--transition-base);
  text-decoration: none;
}

.social-links a:hover {
  background-color: var(--accent);
  transform: translateY(-3px);
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.9rem;
  color: #9ca3af;
}

/* ==========================================
           LOGIN OVERLAY
           ========================================== */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.overlay.show {
  opacity: 1;
  visibility: visible;
}

.overlay-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.overlay-panel {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  width: 90%;
  max-width: 450px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.overlay.show .overlay-panel {
  transform: scale(1);
}

.overlay-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--muted);
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.overlay-close:hover {
  background: var(--bg);
  color: var(--danger);
}

.overlay-content {
  text-align: center;
}

.overlay-logo {
  margin-bottom: 1rem;
}

.overlay-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.overlay-sub {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 2rem;
}

.overlay-form {
  text-align: left;
}

.field {
  display: block;
  margin-bottom: 1.5rem;
}

.label-text {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text);
}

.field input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: var(--text-base);
  transition: all var(--transition-base);
  background: var(--surface);
}

.field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.2rem var(--focus-ring);
  outline: none;
}

.overhead-text {
  background: rgba(0, 0, 0, 0.5);
  z-index: 3;
}

.position-relative {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: 10px;
  top: 70%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  border: none;
}

.row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.remember {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--text-sm);
  color: var(--text);
}

.forgot {
  color: var(--primary);
  text-decoration: none;
  font-size: var(--text-sm);
}

.forgot:hover {
  text-decoration: underline;
}

.divider {
  position: relative;
  text-align: center;
  margin: 1.5rem 0;
}

.divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border-color);
}

.divider span {
  background: white;
  padding: 0 1rem;
  color: var(--muted);
  font-size: var(--text-sm);
}

.signup-row {
  text-align: center;
  margin-bottom: 1.5rem;
}

.muted {
  color: var(--muted);
}

.muted-center {
  text-align: center;
  color: var(--muted);
  font-size: var(--text-sm);
}

.small {
  font-size: var(--text-sm);
}

.loader {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 0.5rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.d-none {
  display: none;
}

.overlay-open {
  overflow: hidden;
}

/* ==========================================
           UTILITY CLASSES
           ========================================== */
.shadow {
  box-shadow: var(--shadow-sm) !important;
}

.text-dark {
  color: var(--text) !important;
}

.text-primary {
  color: var(--primary) !important;
}

.text-secondary {
  color: var(--secondary) !important;
}

.text-accent {
  color: var(--accent) !important;
}

.bg-primary {
  background-color: var(--primary) !important;
}

.bg-secondary {
  background-color: var(--secondary) !important;
}

.bg-accent {
  background-color: var(--accent) !important;
}

.bg-warning-subtle {
  background-color: rgba(245, 158, 11, 0.1) !important;
}

.bg-danger-subtle {
  background-color: rgba(239, 68, 68, 0.1) !important;
}

.bg-success-subtle {
  background-color: rgba(16, 185, 129, 0.1) !important;
}

.d-flex {
  display: flex !important;
}

.align-items-center {
  align-items: center !important;
}

.gap-2 {
  gap: 0.5rem !important;
}

.h5 {
  font-size: 1.25rem !important;
}

.mb-0 {
  margin-bottom: 0 !important;
}

.m-0 {
  margin: 0 !important;
}

.p-2 {
  padding: 0.5rem !important;
}

.px-3 {
  padding-left: 1rem !important;
  padding-right: 1rem !important;
}

.py-5 {
  padding-top: 3rem !important;
  padding-bottom: 3rem !important;
}

.pt-5 {
  padding-top: 3rem !important;
}

.mt-5 {
  margin-top: 3rem !important;
}

.ps-5 {
  padding-left: 3rem !important;
}

.w-100 {
  width: 100% !important;
}

.mx-auto {
  margin-left: auto !important;
  margin-right: auto !important;
}

.text-center {
  text-align: center !important;
}

.ripple-btn {
  position: relative;
  overflow: hidden;
  transform: translate3d(0, 0, 0);
}

.ripple-btn:after {
  content: "";
  display: block;
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, #fff 10%, transparent 10.01%);
  background-repeat: no-repeat;
  background-position: 50%;
  transform: scale(10, 10);
  opacity: 0;
  transition: transform .5s, opacity 1s;
}

.ripple-btn:active:after {
  transform: scale(0, 0);
  opacity: .2;
  transition: 0s;
}

.display-6 {
  font-size: 2rem !important;
}

.fw-light {
  font-weight: 300 !important;
}

.container-fluid {
  width: 100%;
  padding-right: var(--gap);
  padding-left: var(--gap);
  margin-right: auto;
  margin-left: auto;
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin-right: calc(var(--gap) * -0.5);
  margin-left: calc(var(--gap) * -0.5);
}

.col-sm-4 {
  flex: 0 0 33.333333%;
  max-width: 33.333333%;
}

.col-sm-10 {
  flex: 0 0 83.333333%;
  max-width: 83.333333%;
}

.col-12 {
  flex: 0 0 100%;
  max-width: 100%;
}

@media (max-width: 576px) {
  .col-sm-4,
  .col-sm-10 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}