@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --navy:       #0c1a2e;
  --navy-mid:   #152744;
  --navy-light: #1e3a5f;
  --gold:       #c9a225;
  --gold-light: #e8c94a;
  --gold-pale:  #f5e8b0;
  --white:      #ffffff;
  --off-white:  #f7f8fc;
  --text:       #1a202c;
  --text-muted: #64748b;
  --border:     #dde3ed;
  --red:        #c53030;
  --green:      #276749;
  --shadow-sm:  0 2px 8px rgba(12,26,46,0.10);
  --shadow-md:  0 6px 24px rgba(12,26,46,0.14);
  --shadow-lg:  0 16px 48px rgba(12,26,46,0.18);
  --radius:     10px;
  --radius-lg:  16px;
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--off-white);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

/* ── UTILITY ── */
.heading { font-family: 'Playfair Display', serif; }
.gold { color: var(--gold); }
.navy { color: var(--navy); }

/* ── PORTAL NAVBAR ── */
.portal-nav {
  background: var(--navy);
  padding: 0 28px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
  border-bottom: 2px solid var(--gold);
}
.portal-nav .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.portal-nav .brand img { height: 36px; object-fit: contain; }
.portal-nav .brand-text {
  font-family: 'Playfair Display', serif;
  font-size: 15px;
  color: var(--white);
  letter-spacing: 0.3px;
  line-height: 1.2;
}
.portal-nav .brand-text span {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  color: var(--gold-light);
  font-weight: 400;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.portal-nav .nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.portal-nav .user-pill {
  background: rgba(255,255,255,0.1);
  color: var(--white);
  font-size: 13px;
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.2);
}
.portal-nav .user-pill i { margin-right: 6px; color: var(--gold-light); }

/* ── AUTH LAYOUT ── */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
}
.auth-panel {
  width: 420px;
  flex-shrink: 0;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  position: relative;
  overflow: hidden;
}
.auth-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      45deg,
      rgba(201,162,37,0.04) 0px,
      rgba(201,162,37,0.04) 1px,
      transparent 1px,
      transparent 28px
    );
}
.auth-panel::after {
  content: '';
  position: absolute;
  bottom: -80px;
  right: -80px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  border: 40px solid rgba(201,162,37,0.08);
}
.auth-panel-logo {
  width: 90px;
  height: 90px;
  object-fit: contain;
  position: relative;
  z-index: 1;
  margin-bottom: 24px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}
.auth-panel-title {
  font-family: 'Playfair Display', serif;
  color: var(--white);
  font-size: 22px;
  text-align: center;
  line-height: 1.3;
  position: relative;
  z-index: 1;
  margin-bottom: 10px;
}
.auth-panel-sub {
  color: rgba(255,255,255,0.5);
  font-size: 12px;
  text-align: center;
  letter-spacing: 0.5px;
  position: relative;
  z-index: 1;
  line-height: 1.6;
}
.auth-panel-divider {
  width: 48px;
  height: 2px;
  background: var(--gold);
  margin: 20px auto;
  position: relative;
  z-index: 1;
}
.auth-panel-badge {
  background: rgba(201,162,37,0.15);
  border: 1px solid rgba(201,162,37,0.3);
  color: var(--gold-light);
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
  margin-top: 8px;
}

.auth-form-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
}
.auth-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  color: var(--navy);
  margin-bottom: 6px;
}
.auth-card-sub {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 32px;
}

/* ── FORM ELEMENTS ── */
.form-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: block;
}
.form-control, .form-select {
  font-family: 'DM Sans', sans-serif;
  height: 44px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 0 14px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
  width: 100%;
}
.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,162,37,0.15);
}
.form-control::placeholder { color: #b0bec5; }
textarea.form-control { height: auto; padding: 12px 14px; }
.form-group { margin-bottom: 18px; }

/* ── BUTTONS ── */
.btn {
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 14px;
  border-radius: 8px;
  padding: 11px 22px;
  border: none;
  cursor: pointer;
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  line-height: 1;
}
.btn-primary {
  background: var(--navy);
  color: var(--white);
}
.btn-primary:hover { background: var(--navy-light); transform: translateY(-1px); box-shadow: var(--shadow-sm); color: #fff; }
.btn-gold {
  background: var(--gold);
  color: var(--navy);
}
.btn-gold:hover { background: var(--gold-light); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(201,162,37,0.35); color: var(--navy); }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--navy); color: var(--navy); background: rgba(12,26,46,0.04); }
.btn-danger-outline {
  background: transparent;
  border: 1.5px solid #feb2b2;
  color: var(--red);
}
.btn-danger-outline:hover { background: #fff5f5; color: var(--red); }
.btn-sm { padding: 6px 14px; font-size: 12px; border-radius: 6px; }
.btn-xs { padding: 4px 10px; font-size: 11px; border-radius: 5px; }
.btn-block { width: 100%; justify-content: center; }
.btn-success-sm {
  background: var(--green);
  color: #fff;
}
.btn-success-sm:hover { background: #2f855a; color: #fff; }
.btn-warning-sm {
  background: #d69e2e;
  color: #fff;
}
.btn-warning-sm:hover { background: #b7791f; color: #fff; }
.btn-info-sm {
  background: #2b6cb0;
  color: #fff;
}
.btn-info-sm:hover { background: #2c5282; color: #fff; }

/* ── ALERTS ── */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert-danger { background: #fff5f5; border: 1px solid #fed7d7; color: #c53030; }
.alert-success { background: #f0fff4; border: 1px solid #c6f6d5; color: #276749; }
.alert-info    { background: #ebf8ff; border: 1px solid #bee3f8; color: #2c5282; }
.alert-warning { background: #fffbeb; border: 1px solid #fef3c7; color: #92400e; }

/* ── CARD ── */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  background: var(--navy);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 2px solid var(--gold);
}
.card-header h5 {
  font-family: 'Playfair Display', serif;
  color: var(--white);
  font-size: 16px;
  margin: 0;
}
.card-header .card-icon {
  width: 32px;
  height: 32px;
  background: rgba(201,162,37,0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-light);
  font-size: 15px;
}
.card-body { padding: 24px; }

/* ── TABLES ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table thead tr {
  background: var(--navy);
  color: #fff;
}
.data-table thead th {
  padding: 11px 14px;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
  border: none;
}
.data-table thead th:first-child { border-radius: 0; }
.data-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.data-table tbody tr:hover { background: #f0f4ff; }
.data-table tbody td {
  padding: 10px 14px;
  vertical-align: middle;
  border: none;
}
.data-table tbody tr:last-child { border-bottom: none; }
.data-table .gold-row td { background: rgba(201,162,37,0.06); }

/* Mark entry table */
.marks-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.marks-table th, .marks-table td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: center;
  vertical-align: middle;
}
.marks-table thead { background: var(--navy-mid); color: #fff; font-size: 12px; }
.marks-table thead th { border-color: var(--navy-light); }
.marks-table tbody tr:nth-child(even) { background: #f8fafc; }
.marks-table input.form-control {
  height: 34px;
  padding: 0 8px;
  text-align: center;
  font-size: 13px;
  border-radius: 6px;
  min-width: 60px;
}

/* ── BADGES ── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
}
.badge-pass { background: #c6f6d5; color: #276749; }
.badge-fail { background: #fed7d7; color: #c53030; }
.badge-gold { background: var(--gold-pale); color: #78581c; }

/* ── PAGE HEADER ── */
.page-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 20px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.page-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  color: var(--navy);
}
.page-header p { color: var(--text-muted); font-size: 13px; margin: 2px 0 0; }

/* ── SECTION TITLE ── */
.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  color: var(--navy);
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::before {
  content: '';
  width: 4px;
  height: 20px;
  background: var(--gold);
  border-radius: 2px;
  display: inline-block;
}

/* ── TOGGLE PASSWORD ── */
.pass-wrap { position: relative; }
.pass-wrap .form-control { padding-right: 44px; }
.pass-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--text-muted);
  font-size: 15px;
  transition: color .2s;
  line-height: 1;
  background: none;
  border: none;
  padding: 0;
}
.pass-toggle:hover { color: var(--navy); }

/* ── DIVIDERS ── */
.auth-link { font-size: 13px; color: var(--text-muted); margin-top: 20px; text-align: center; }
.auth-link a { color: var(--navy-light); font-weight: 600; text-decoration: none; }
.auth-link a:hover { color: var(--gold); }

/* ── INSTITUTE HEADER (inside forms) ── */
.inst-header {
  text-align: center;
  padding: 20px 0 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.inst-header img { height: 64px; object-fit: contain; margin-bottom: 10px; display: block; margin: 0 auto 10px; }
.inst-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.inst-header p { font-size: 12px; color: var(--text-muted); margin-top: 4px; font-style: italic; }

/* ── SUMMARY ROW ── */
.summary-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.summary-table th, .summary-table td {
  border: 1px solid var(--border);
  padding: 9px 14px;
  text-align: center;
}
.summary-table thead { background: var(--navy); color: #fff; }

/* ── DASHBOARD CARDS ── */
.dash-card {
  display: block;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  text-decoration: none;
  color: var(--text);
  transition: all .25s;
  position: relative;
  overflow: hidden;
}
.dash-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform .25s;
  transform-origin: left;
}
.dash-card:hover { border-color: var(--gold); transform: translateY(-3px); box-shadow: var(--shadow-md); color: var(--text); }
.dash-card:hover::before { transform: scaleX(1); }
.dash-card .dash-icon {
  width: 56px; height: 56px;
  background: var(--off-white);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  margin-bottom: 18px;
  transition: background .25s;
}
.dash-card:hover .dash-icon { background: var(--gold-pale); }
.dash-card h3 { font-family: 'Playfair Display', serif; font-size: 18px; color: var(--navy); margin-bottom: 6px; }
.dash-card p { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.dash-card .dash-arrow { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); color: var(--border); font-size: 20px; transition: all .25s; }
.dash-card:hover .dash-arrow { color: var(--gold); right: 16px; }

/* ── SEARCH PAGE ── */
.search-hero {
  background: var(--navy);
  padding: 48px 24px 36px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.search-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(45deg, rgba(201,162,37,0.04) 0, rgba(201,162,37,0.04) 1px, transparent 1px, transparent 28px);
}
.search-hero img { height: 64px; object-fit: contain; margin-bottom: 14px; position: relative; z-index: 1; }
.search-hero h1 { font-family: 'Playfair Display', serif; color: #fff; font-size: 26px; position: relative; z-index: 1; }
.search-hero p { color: rgba(255,255,255,0.55); font-size: 13px; position: relative; z-index: 1; margin-top: 6px; }
.search-box-wrap { background: #fff; max-width: 580px; margin: -24px auto 0; border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow-lg); position: relative; z-index: 2; }

/* ── COLLAPSE TOGGLE ── */
.collapse-toggle {
  background: none;
  border: 1.5px solid var(--border);
  color: var(--navy);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all .2s;
  font-family: 'DM Sans', sans-serif;
}
.collapse-toggle:hover { border-color: var(--gold); background: var(--gold-pale); }

/* ── MAIN CONTENT WRAP ── */
.main-wrap { max-width: 1100px; margin: 0 auto; padding: 28px 20px 60px; }
.form-wrap { max-width: 900px; margin: 0 auto; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .auth-panel { display: none; }
  .auth-form-area { padding: 32px 20px; }
  .main-wrap { padding: 16px 12px 40px; }
  .portal-nav { padding: 0 16px; }
}

/* ── FOOTER BAR ── */
.portal-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.4);
  text-align: center;
  font-size: 11px;
  padding: 14px;
  border-top: 1px solid rgba(201,162,37,0.2);
  letter-spacing: 0.3px;
}
