/* ═══════════════════════════════
   RESET & BASE
═══════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html, body { height: 100%; }

body {
  font-family: 'Poppins', sans-serif;
  background: 
    radial-gradient(ellipse at 20% 50%, rgba(139,10,10,0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(100,0,0,0.1) 0%, transparent 55%),
    #f5f5f5;
  min-height: 100vh;
  padding-top: 64px;
  display: flex;
  flex-direction: column;
}

/* ═══════════════════════════════
   SITE HEADER
═══════════════════════════════ */
.site-header {
  background: #8b0a0a;
  border-bottom: 3px solid #5c0000;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  width: 100%;
}
.header-inner {
  max-width: none;
  margin: 0;
  padding: 0 24px 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
}
.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
  min-width: 0;
}
.header-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  justify-content: flex-end;
}

.nav-dropdown {
  position: relative;
  flex: 0 0 auto;
}

.nav-link {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 20px;
  transition: all 0.25s ease;
  border: 1px solid transparent;
}
.nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.15);
}
.nav-dropdown-toggle {
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  background: transparent;
}

.nav-dropdown-toggle::after {
  content: '▾';
  font-size: 0.65rem;
  margin-left: 6px;
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: max-content;
  min-width: 0;
  max-width: calc(100vw - 24px);
  background: #fff;
  border: 1px solid rgba(139,10,10,0.14);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(38, 10, 10, 0.16);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  z-index: 10000;
}

.nav-dropdown-menu-browse {
  width: 158px;
}

.nav-dropdown-menu-about {
  width: 176px;
}

.nav-dropdown:last-of-type .nav-dropdown-menu {
  left: auto;
  right: 0;
}

.header-nav .nav-dropdown .nav-dropdown-menu.nav-dropdown-menu-about {
  left: 0;
  right: auto;
}

.nav-dropdown.open .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown-item {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  color: #5c0000;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-dropdown-item:hover {
  background: #fff4f2;
  color: #8b0a0a;
}

.header-nav > .nav-link:last-child {
  background: #fff;
  color: #8b0a0a;
  font-weight: 600;
}
.header-nav > .nav-link:last-child:hover {
  background: #f0f0f0;
  transform: translateY(-1px);
}
.header-logo { width: 42px; height: 42px; flex-shrink: 0; }
.brand-text-wrap { min-width: 0; }
.brand-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-campus {
  font-size: 0.6rem;
  color: rgba(255,255,255,0.75);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 600px) {
  body {
    padding-top: 56px;
  }
  .site-header {
    height: 56px;
  }
  .header-inner {
    padding: 0 16px;
    height: 56px;
    justify-content: space-between;
  }
  .header-logo { width: 36px; height: 36px; }
  .brand-title { font-size: 0.85rem; }
  .brand-campus { font-size: 0.58rem; }
  .header-nav { display: none; }
}

/* ═══════════════════════════════
   MAIN WRAPPER
═══════════════════════════════ */
.main-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

/* ═══════════════════════════════
   AUTH CARD
═══════════════════════════════ */
.auth-card {
  width: 100%;
  max-width: 780px;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 18px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.4);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
}
@media (min-width: 641px) {
  .auth-card { max-height: calc(100vh - 140px); }
  .card-form { overflow: hidden; }
  .card-form-scroll {
    overflow-y: auto;
    height: 100%;
    scrollbar-width: thin;
    scrollbar-color: rgba(200,100,100,0.5) transparent;
  }
  .card-form-scroll::-webkit-scrollbar { width: 4px; }
  .card-form-scroll::-webkit-scrollbar-track { background: transparent; }
  .card-form-scroll::-webkit-scrollbar-thumb { background: rgba(200,100,100,0.45); border-radius: 4px; }
}
@media (max-width: 640px) {
  .auth-card {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    border-radius: 14px;
    max-width: 420px;
    max-height: none;
  }
  .card-form { overflow: visible; grid-row: 2; }
  .card-form-scroll { overflow-y: visible; }
  .card-overlay { grid-column: 1; grid-row: 1; }
}

/* ═══════════════════════════════
   OVERLAY PANEL
═══════════════════════════════ */
.card-overlay {
  background: linear-gradient(160deg, #8b0a0a 0%, #5c0000 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
  grid-column: 2;
  grid-row: 1;
}
.card-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='36' height='36' viewBox='0 0 36 36' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='4' cy='4' r='1' fill='%23ffffff' fill-opacity='0.05'/%3E%3C/svg%3E");
  pointer-events: none;
}
.overlay-logo {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: #fff;
  padding: 6px;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}
.overlay-text { position: relative; z-index: 1; }
.card-overlay h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
  margin-bottom: 6px;
}
.ov-sub { font-size: 0.8rem; color: rgba(255,255,255,0.7); line-height: 1.5; }
.overlay-tagline { font-size: 0.72rem; color: rgba(255,255,255,0.45); font-style: italic; margin-top: 3px; }
.overlay-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  margin-top: 14px;
}
.overlay-badge {
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 20px;
  padding: 3px 11px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.82);
}
.overlay-back-btn {
  margin-top: 18px;
  background: rgba(255,255,255,0.13);
  border: 1px solid rgba(255,255,255,0.26);
  border-radius: 20px;
  padding: 7px 18px;
  color: #fff;
  font-size: 0.76rem;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s;
  text-decoration: none;
  display: inline-block;
}
.overlay-back-btn:hover { background: rgba(255,255,255,0.24); }

@media (max-width: 640px) {
  .card-overlay {
    flex-direction: column;
    gap: 6px;
    text-align: center;
    padding: 18px 16px;
    align-items: center;
    justify-content: center;
  }
  .card-overlay .overlay-logo { width: 52px; height: 52px; margin-bottom: 4px; }
  .card-overlay h2 { font-size: 0.92rem; margin-bottom: 1px; }
  .card-overlay .ov-sub { font-size: 0.72rem; }
  .card-overlay .overlay-tagline,
  .card-overlay .overlay-badges,
  .card-overlay .overlay-back-btn { display: none; }
}

/* ═══════════════════════════════
   FORM PANEL
═══════════════════════════════ */
.card-form {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.card-form-scroll { padding: 32px 28px; }
@media (max-width: 640px) { .card-form-scroll { padding: 22px 18px; } }
@media (max-width: 380px) { .card-form-scroll { padding: 18px 14px; } }

/* ═══════════════════════════════
   FORM TYPOGRAPHY
═══════════════════════════════ */
.form-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 4px;
}
.form-sub {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.5);
  margin-bottom: 20px;
  line-height: 1.5;
}
.field-label {
  display: block;
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  margin-bottom: 5px;
  margin-top: 14px;
}
.field-label:first-of-type { margin-top: 0; }

/* ═══════════════════════════════
   INPUTS
═══════════════════════════════ */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"] {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  background: #fff;
  border: 1.5px solid #ddc8c8;
  font-family: 'Poppins', sans-serif;
  font-size: 0.86rem;
  color: #333;
  transition: border-color 0.22s, box-shadow 0.22s;
  outline: none;
  display: block;
}
input:focus {
  border-color: #5c0000;
  box-shadow: 0 0 0 3px rgba(128,0,0,0.14);
}
input::placeholder { color: #bbb; }

.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 40px; }
.pass-eye {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #bbb;
  padding: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  margin: 0;
  border-radius: 0;
}
.pass-eye:hover { color: #5c0000; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 380px) { .field-row { grid-template-columns: 1fr; gap: 0; } }

/* ═══════════════════════════════
   BUTTONS
═══════════════════════════════ */
.btn-submit {
  width: 100%;
  background: #a32424;
  color: #fff;
  border: none;
  border-radius: 25px;
  padding: 11px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.22s;
  margin-top: 18px;
  display: block;
}
.btn-submit:hover { background: #830404; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,0.25); }
.btn-submit:active { transform: none; box-shadow: none; }

.btn-ghost {
  width: 100%;
  background: rgba(255,255,255,0.09);
  color: rgba(255,255,255,0.85);
  border: 1.5px solid rgba(255,255,255,0.22);
  border-radius: 25px;
  padding: 10px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s;
  margin-top: 10px;
  display: block;
  text-align: center;
  text-decoration: none;
}
.btn-ghost:hover { background: rgba(255,255,255,0.17); border-color: rgba(255,255,255,0.4); }

.role-btn {
  width: 100%;
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.9);
  border: 1.5px solid rgba(255,255,255,0.16);
  border-radius: 11px;
  padding: 12px 14px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.87rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  text-decoration: none;
}
.role-btn svg { width: 17px; height: 17px; flex-shrink: 0; }
.role-btn:hover { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.4); transform: translateY(-1px); }

.forgot-btn {
  background: none;
  border: none;
  font-family: 'Poppins', sans-serif;
  font-size: 0.76rem;
  color: rgba(255,255,255,0.42);
  cursor: pointer;
  padding: 6px 0 0;
  display: inline-block;
  transition: color 0.2s;
}
.forgot-btn:hover { color: rgba(255,255,255,0.75); }

.link-btn {
  background: none;
  border: none;
  font-family: 'Poppins', sans-serif;
  font-size: inherit;
  color: #ffbbbb;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  transition: color 0.2s;
  display: inline;
}
.link-btn:hover { color: #fff; }

/* ═══════════════════════════════
   ALERTS
═══════════════════════════════ */
.alert {
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  margin-bottom: 14px;
  display: flex;
  align-items: flex-start;
  gap: 7px;
  line-height: 1.45;
}
.alert svg { flex-shrink: 0; margin-top: 1px; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #b8ddc5; }
.alert-error   { background: #f8d7da; color: #721c24; border: 1px solid #f0bec3; }

/* ═══════════════════════════════
   MISC COMPONENTS
═══════════════════════════════ */
.section-sep {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.28);
  margin: 18px 0 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(255,255,255,0.09);
}
.section-sep:first-of-type { margin-top: 4px; }

.form-divider {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 14px 0;
  font-size: 0.67rem;
  color: rgba(255,255,255,0.28);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.form-divider::before, .form-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.1);
}

.footer-text {
  font-size: 0.76rem;
  color: rgba(255,255,255,0.38);
  margin-top: 14px;
  text-align: center;
  line-height: 1.7;
}

.strength-wrap { margin: 5px 0 4px; }
.strength-track { height: 3px; background: rgba(255,255,255,0.12); border-radius: 2px; overflow: hidden; }
.strength-fill  { height: 100%; width: 0; border-radius: 2px; transition: all 0.28s; }
.strength-lbl   { font-size: 0.66rem; color: rgba(255,255,255,0.35); margin-top: 3px; }

.role-route-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.rr-cell {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 9px 10px;
  text-align: center;
}
.rr-role { font-size: 0.72rem; font-weight: 700; color: #ffbbbb; margin-bottom: 2px; }
.rr-dest { font-size: 0.65rem; color: rgba(255,255,255,0.4); }

.logo-section {
  margin-bottom: 16px;
}

.university-logo-img {
  width: 86px;
  height: auto;
  display: block;
}

@media (max-width: 640px) {
  .logo-section { margin-bottom: 8px; }
  .university-logo-img { width: 52px; }
}

@media (max-width: 480px) {
  .auth-card { max-width: 100%; margin: 0 8px; }
  .card-form-scroll { padding: 20px 16px; }
  .form-title { font-size: 1.25rem; }
  .form-sub { font-size: 0.72rem; }
  .field-label { font-size: 0.62rem; margin-top: 12px; }
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="tel"] { padding: 12px 12px; font-size: 0.9rem; }
  .btn-submit { padding: 14px; font-size: 0.92rem; }
  .footer-text { font-size: 0.72rem; }
  .logo-section { margin-bottom: 8px; }
  .university-logo-img { width: 52px; }
}

@media (max-width: 380px) {
  .auth-card { margin: 0 4px; border-radius: 10px; }
  .card-form-scroll { padding: 16px 12px; }
  .form-title { font-size: 1.15rem; }
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="tel"] { padding: 10px 10px; font-size: 0.88rem; }
  .logo-section { margin-bottom: 6px; }
  .university-logo-img { width: 44px; }
}

@media (max-width: 320px) {
  .card-form-scroll { padding: 14px 10px; }
  .form-title { font-size: 1.05rem; }
  .btn-submit { padding: 12px; font-size: 0.86rem; }
  .university-logo-img { width: 38px; }
}
