/* ============================================================
   EduManage Pro – Enterprise Design System v3.0
   Premium School ERP | Cost: ₹10L+
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── DESIGN TOKENS ───────────────────────────────────────── */
:root {
  /* Brand */
  --brand-50:  #eff6ff;
  --brand-100: #dbeafe;
  --brand-200: #bfdbfe;
  --brand-400: #60a5fa;
  --brand-500: #3b82f6;
  --brand-600: #2563eb;
  --brand-700: #1d4ed8;
  --brand-800: #1e40af;
  --brand-900: #1e3a8a;

  /* Sidebar (deep navy) */
  --sidebar-bg:        #0f172a;
  --sidebar-border:    rgba(255,255,255,0.06);
  --sidebar-text:      #94a3b8;
  --sidebar-text-hover:#e2e8f0;
  --sidebar-active-bg: rgba(59,130,246,0.15);
  --sidebar-active:    #60a5fa;
  --sidebar-label:     #475569;

  /* Surface */
  --bg-body:    #f0f4f8;
  --bg-surface: #ffffff;
  --bg-muted:   #f8fafc;
  --bg-hover:   #f1f5f9;

  /* Text */
  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-muted:     #94a3b8;
  --text-white:     #ffffff;

  /* Semantic */
  --success:        #10b981;
  --success-light:  #d1fae5;
  --success-dark:   #065f46;
  --danger:         #ef4444;
  --danger-light:   #fee2e2;
  --danger-dark:    #991b1b;
  --warning:        #f59e0b;
  --warning-light:  #fef3c7;
  --warning-dark:   #78350f;
  --info:           #3b82f6;
  --info-light:     #dbeafe;
  --info-dark:      #1e40af;
  --purple:         #8b5cf6;
  --purple-light:   #ede9fe;
  --purple-dark:    #4c1d95;

  /* Borders */
  --border:       #e2e8f0;
  --border-focus: #3b82f6;

  /* Shadows */
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / .05);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);
  --shadow-2xl:0 25px 50px -12px rgb(0 0 0 / .25);
  --shadow-brand: 0 4px 14px 0 rgba(37,99,235,.35);

  /* Radii */
  --r-sm:  6px;
  --r-md:  10px;
  --r-lg:  14px;
  --r-xl:  20px;
  --r-2xl: 28px;
  --r-full:9999px;

  /* Transition */
  --ease: cubic-bezier(.4,0,.2,1);
  --t:    all .2s var(--ease);
}

/* ── RESET & BASE ────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0; padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

html { font-size: 15px; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

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

h1, h2, h3, h4, h5 {
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.25;
  color: var(--text-primary);
}

/* ── SCROLLBAR ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── UTILITY CLASSES ─────────────────────────────────────── */
.flex        { display: flex; }
.flex-col    { display: flex; flex-direction: column; }
.items-center{ align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: .25rem; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: .75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.w-full { width: 100%; }
.text-sm  { font-size: .8125rem; }
.text-xs  { font-size: .75rem; }
.font-600 { font-weight: 600; }
.font-700 { font-weight: 700; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.hidden { display: none; }

/* ── ANIMATIONS ──────────────────────────────────────────── */
@keyframes fadeIn    { from{opacity:0} to{opacity:1} }
@keyframes slideUp   { from{opacity:0;transform:translateY(16px)} to{opacity:1;transform:translateY(0)} }
@keyframes slideIn   { from{opacity:0;transform:translateX(-20px)} to{opacity:1;transform:translateX(0)} }
@keyframes pulse     { 0%,100%{opacity:1} 50%{opacity:.5} }
@keyframes spin      { to{transform:rotate(360deg)} }
@keyframes shimmer   {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}
@keyframes float {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-8px); }
}
@keyframes gradMove {
  0%  { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100%{ background-position: 0% 50%; }
}

.animate-fade-in  { animation: fadeIn  .4s var(--ease) both; }
.animate-slide-up { animation: slideUp .45s var(--ease) both; }
.animate-float    { animation: float 3s ease-in-out infinite; }

/* ── SKELETON ────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite linear;
  border-radius: var(--r-sm);
}

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .625rem 1.25rem;
  border-radius: var(--r-md);
  font-size: .8125rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--t);
  white-space: nowrap;
  letter-spacing: .01em;
}

.btn i { font-size: .875rem; }

.btn-primary {
  background: var(--brand-600);
  color: #fff;
  box-shadow: var(--shadow-brand);
}
.btn-primary:hover {
  background: var(--brand-700);
  box-shadow: 0 6px 20px rgba(37,99,235,.45);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: white;
  color: var(--text-secondary);
  border-color: var(--border);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: #cbd5e1;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 4px 12px rgba(239,68,68,.3);
}
.btn-danger:hover {
  background: #dc2626;
  box-shadow: 0 6px 16px rgba(239,68,68,.4);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-sm { padding: .4rem .875rem; font-size: .75rem; }
.btn-lg { padding: .875rem 1.75rem; font-size: .9375rem; }
.btn-icon {
  width: 36px; height: 36px;
  padding: 0;
  border-radius: var(--r-md);
}

/* spinner inside btn */
.btn .spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: none;
}
.btn.loading span { display: none; }
.btn.loading .spinner { display: block; }

/* ── INPUT FIELDS ────────────────────────────────────────── */
.input-group { display: flex; flex-direction: column; gap: .375rem; }
.input-group label {
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.input-field {
  width: 100%;
  padding: .625rem .875rem;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  font-size: .875rem;
  font-family: inherit;
  color: var(--text-primary);
  background: white;
  transition: var(--t);
  outline: none;
}
.input-field::placeholder { color: var(--text-muted); }
.input-field:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
.input-field:hover:not(:focus) { border-color: #94a3b8; }

select.input-field { cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .75rem center;
  padding-right: 2.25rem;
}

textarea.input-field { resize: vertical; min-height: 100px; }

/* ── BADGES ──────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .25rem .7rem;
  border-radius: var(--r-full);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.badge-success { background: var(--success-light); color: var(--success-dark); }
.badge-danger  { background: var(--danger-light);  color: var(--danger-dark); }
.badge-warning { background: var(--warning-light); color: var(--warning-dark); }
.badge-info    { background: var(--info-light);    color: var(--info-dark); }
.badge-purple  { background: var(--purple-light);  color: var(--purple-dark); }
.badge-neutral { background: #f1f5f9; color: var(--text-secondary); }

.badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: .7;
}

/* ── MESSAGE BOX ─────────────────────────────────────────── */
.message-box {
  border-radius: var(--r-md);
  padding: .875rem 1.25rem;
  font-size: .875rem;
  font-weight: 500;
  display: none;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.25rem;
}
.message-box.show { display: flex; }
.message-box.success { background: var(--success-light); color: var(--success-dark); border: 1px solid #a7f3d0; }
.message-box.error   { background: var(--danger-light);  color: var(--danger-dark);  border: 1px solid #fca5a5; }

/* ── LOGIN PAGE ──────────────────────────────────────────── */
.login-wrapper {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
}

/* Left branding panel */
.login-brand {
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem;
  position: relative;
  overflow: hidden;
}

.login-brand::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59,130,246,.2) 0%, transparent 70%);
  top: -150px; left: -100px;
}
.login-brand::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139,92,246,.15) 0%, transparent 70%);
  bottom: -100px; right: -100px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: .875rem;
  margin-bottom: 3rem;
  position: relative;
  z-index: 1;
}

.brand-logo-icon {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, var(--brand-500), #8b5cf6);
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: white;
  box-shadow: 0 8px 24px rgba(59,130,246,.4);
}

.brand-logo-text h2 {
  color: white;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -.03em;
}
.brand-logo-text span {
  color: var(--sidebar-text);
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.brand-headline {
  position: relative;
  z-index: 1;
  margin-bottom: 2.5rem;
}
.brand-headline h1 {
  font-size: 2.8rem;
  font-weight: 900;
  color: white;
  line-height: 1.1;
  letter-spacing: -.04em;
  margin-bottom: 1rem;
}
.brand-headline h1 span {
  background: linear-gradient(90deg, var(--brand-400), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-headline p {
  color: var(--sidebar-text);
  font-size: 1rem;
  line-height: 1.7;
  max-width: 420px;
}

.brand-features {
  display: flex;
  flex-direction: column;
  gap: .875rem;
  position: relative;
  z-index: 1;
}

.brand-feature {
  display: flex;
  align-items: center;
  gap: .875rem;
  padding: 1rem 1.25rem;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--r-lg);
  transition: var(--t);
}
.brand-feature:hover {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.12);
}

.brand-feature-icon {
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  flex-shrink: 0;
}

.brand-feature-text h4 { color: #e2e8f0; font-size: .875rem; font-weight: 600; }
.brand-feature-text p  { color: var(--sidebar-text); font-size: .78rem; margin-top: .1rem; }

/* Right form panel */
.login-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2.5rem;
  background: white;
  overflow-y: auto;
}

.login-card {
  width: 100%;
  max-width: 420px;
  animation: slideUp .6s var(--ease) both;
}

.login-card-header {
  margin-bottom: 2.5rem;
}
.login-card-header .badge-pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .875rem;
  background: var(--info-light);
  color: var(--info-dark);
  border-radius: var(--r-full);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.login-card-header h1 {
  font-size: 1.875rem;
  font-weight: 800;
  margin-bottom: .375rem;
}
.login-card-header p { color: var(--text-secondary); font-size: .9rem; }

.login-form { display: flex; flex-direction: column; gap: 1.125rem; }

.input-with-icon { position: relative; }
.input-with-icon i {
  position: absolute;
  left: .9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: .875rem;
  pointer-events: none;
}
.input-with-icon .input-field { padding-left: 2.4rem; }

.login-submit {
  width: 100%;
  padding: .8rem;
  font-size: .9375rem;
  margin-top: .5rem;
  border-radius: var(--r-lg);
  position: relative;
}

.login-footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
}
.login-footer p { color: var(--text-muted); font-size: .8125rem; line-height: 1.7; }
.login-footer a { color: var(--brand-600); font-weight: 600; }
.login-footer a:hover { text-decoration: underline; }

/* Trust indicators */
.trust-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}
.trust-item {
  display: flex;
  align-items: center;
  gap: .375rem;
  font-size: .72rem;
  color: var(--text-muted);
  font-weight: 500;
}
.trust-item i { color: var(--success); font-size: .75rem; }

@media (max-width: 900px) {
  .login-wrapper { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-form-panel { padding: 2rem 1.5rem; }
}

/* ── MODAL OVERLAY ───────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s var(--ease);
  padding: 1.5rem;
}
.modal-overlay.active,
.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  background: white;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-2xl);
  width: 100%;
  max-width: 520px;
  transform: scale(.95) translateY(10px);
  transition: transform .3s var(--ease);
  overflow: hidden;
}
.modal-overlay.active .modal-container,
.modal-overlay.show .modal-container {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 1.75rem;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 1.0625rem; }
.modal-close {
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  background: var(--bg-hover);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--t);
}
.modal-close:hover { background: var(--danger-light); color: var(--danger); }

.modal-body { padding: 1.75rem; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: .75rem;
  padding: 1.25rem 1.75rem;
  background: var(--bg-muted);
  border-top: 1px solid var(--border);
}

/* ── GLASS CARD ──────────────────────────────────────────── */
.glass-card {
  background: rgba(255,255,255,.7);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.5);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
}

/* Glass container alias (legacy) */
.glass-container { @extend .glass-card; }
