:root {
  --bg-deep: #09070d;
  --bg-panel: rgba(15, 10, 24, 0.82);
  --bg-panel-strong: rgba(26, 14, 35, 0.92);
  --purple-1: #6b1b6e;
  --purple-2: #8a2aac;
  --purple-3: #b35be1;
  --silver-1: #efeff5;
  --silver-2: #d5d0dc;
  --silver-3: rgba(219, 200, 236, 0.25);
  --text-soft: rgba(255, 255, 255, 0.78);
  --danger: #ff7c7a;
  --success: #77f6ba;
  --border: rgba(255, 255, 255, 0.12);
  --shadow: 0 0 32px rgba(181, 91, 225, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Inter", sans-serif;
  background: var(--bg-deep);
  color: var(--silver-1);
}

body {
  min-height: 100vh;
  isolation: isolate;
  background:
    radial-gradient(ellipse at 50% 20%, rgba(107, 27, 110, 0.25), transparent 50%),
    linear-gradient(160deg, #100a16, var(--bg-deep) 60%);
}

body::before,
body::after {
  position: fixed;
  inset: -20%;
  content: "";
  pointer-events: none;
}

body::before {
  z-index: -1;
  opacity: 0.58;
  background-image:
    radial-gradient(1.5px 1.5px at 8% 18%, rgba(255, 255, 255, 0.9) 50%, transparent 100%),
    radial-gradient(2px 2px at 22% 72%, rgba(213, 160, 255, 0.85) 50%, transparent 100%),
    radial-gradient(1px 1px at 37% 35%, rgba(255, 255, 255, 0.8) 50%, transparent 100%),
    radial-gradient(1.5px 1.5px at 54% 84%, rgba(196, 128, 255, 0.9) 50%, transparent 100%),
    radial-gradient(2px 2px at 69% 22%, rgba(255, 255, 255, 0.8) 50%, transparent 100%),
    radial-gradient(1px 1px at 83% 58%, rgba(222, 181, 255, 0.9) 50%, transparent 100%),
    radial-gradient(1.5px 1.5px at 94% 38%, rgba(255, 255, 255, 0.75) 50%, transparent 100%);
  background-size: 290px 270px, 360px 330px, 230px 310px, 410px 370px, 330px 290px, 270px 390px, 380px 340px;
  animation: star-drift 70s linear infinite, star-twinkle 5s ease-in-out infinite alternate;
}

body::after {
  z-index: -2;
  opacity: 0.52;
  background:
    radial-gradient(ellipse at 15% 45%, rgba(117, 48, 158, 0.16), transparent 34%),
    radial-gradient(ellipse at 86% 60%, rgba(95, 45, 145, 0.14), transparent 32%);
  animation: glow-drift 24s ease-in-out infinite alternate;
}

@keyframes star-drift {
  to {
    transform: translate3d(35px, -28px, 0);
  }
}

@keyframes star-twinkle {
  from {
    opacity: 0.34;
  }
  to {
    opacity: 0.7;
  }
}

@keyframes glow-drift {
  to {
    transform: translate3d(2%, -1%, 0) scale(1.04);
  }
}

@media (prefers-reduced-motion: reduce) {
  body::before,
  body::after {
    animation: none;
  }
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.page-shell {
  position: relative;
  min-height: 100vh;
}

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 88px 20px 40px;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: min(100%, 860px);
  gap: clamp(14px, 2.2vh, 24px);
}

.school-logo {
  display: block;
  width: clamp(150px, 24vw, 250px);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 24px rgba(181, 91, 225, 0.45));
}

.title-glow {
  margin: 0;
  font-family: "Cinzel", serif;
  font-size: clamp(4.5rem, 11vw, 9rem);
  line-height: 1;
  letter-spacing: 0.02em;
  font-weight: 700;
  color: #efe6f3;
  text-shadow: 0 0 26px rgba(199, 120, 236, 0.9), 0 0 42px rgba(139, 54, 183, 0.7);
}

.subtitle {
  margin-top: 0;
  font-family: "Cinzel", serif;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(1.2rem, 1.9vw, 3rem);
  text-shadow: 0 0 18px rgba(181, 91, 225, 0.7);
}

.tagline {
  max-width: 650px;
  margin: 0;
  font-size: clamp(1.05rem, 1.4vw, 1.6rem);
  line-height: 1.6;
  color: var(--text-soft);
  text-shadow: 0 0 18px rgba(0, 0, 0, 0.82);
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 0.9rem 1.6rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.primary-button {
  background: linear-gradient(135deg, rgba(107, 27, 110, 0.96), rgba(170, 83, 192, 0.92));
  color: var(--silver-1);
  box-shadow: 0 0 18px rgba(181, 91, 225, 0.45);
  min-width: 220px;
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 26px rgba(181, 91, 225, 0.65);
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
  padding: 20px;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.modal-panel {
  position: relative;
  width: min(100%, 720px);
  background: rgba(12, 8, 17, 0.94);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 22px;
  box-shadow: 0 18px 50px rgba(7, 3, 14, 0.84), 0 0 28px rgba(181, 91, 225, 0.28);
  padding: clamp(1.2rem, 2vw, 2rem);
}

.small-panel {
  width: min(100%, 440px);
}

.dashboard-panel {
  width: min(100%, 1100px);
  max-height: 90vh;
  overflow: auto;
}

.close-button {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: rgba(255,255,255,0.06);
  color: var(--silver-1);
  font-size: 2rem;
  line-height: 1;
}

h2,
h3 {
  margin: 0 0 1rem;
}

#registrationTitle,
#adminTitle,
#dashboardTitle {
  font-size: clamp(1.8rem, 2vw, 2.4rem);
  margin-bottom: 1.2rem;
}

form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  color: var(--silver-2);
}

label {
  font-size: 0.95rem;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 0.95rem;
  color: var(--silver-1);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(199, 120, 236, 0.9);
  box-shadow: 0 0 0 3px rgba(181, 91, 225, 0.2);
}

textarea {
  resize: vertical;
  min-height: 110px;
}

.privacy-note {
  margin: 0;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.68);
  text-align: center;
}

.form-error {
  min-height: 1.2rem;
  color: var(--danger);
  font-size: 0.88rem;
  font-weight: 600;
}

.submit-button {
  width: 100%;
  margin-top: 0.2rem;
}

.success-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 260px;
  padding: 32px 20px 16px;
}

.success-state h3 {
  font-size: clamp(2.2rem, 4vw, 3rem);
  margin-bottom: 0.6rem;
  color: var(--success);
}

.success-state p {
  font-size: 1.15rem;
  color: var(--silver-2);
}

.hidden {
  display: none !important;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.eyebrow {
  margin: 0 0 0.25rem;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(90px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1.1rem;
}

.stat-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.8rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-height: 88px;
}

.stat-card span {
  color: var(--silver-2);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-card strong {
  font-size: clamp(1.5rem, 2vw, 2rem);
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.toolbar input {
  max-width: 420px;
  flex: 1;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,0.02);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 0.8rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  vertical-align: top;
}

th {
  background: rgba(255,255,255,0.03);
  color: var(--silver-2);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

tbody tr:hover {
  background: rgba(255,255,255,0.02);
}

.delete-button {
  background: rgba(255,124,122,0.12);
  color: #ffd9d7;
  border: 1px solid rgba(255,124,122,0.38);
  border-radius: 10px;
  padding: 0.5rem 0.7rem;
  font-weight: 700;
}

@media (max-width: 720px) {
  .hero {
    padding: 82px 18px 32px;
  }

  .hero-inner {
    gap: 18px;
  }

  .school-logo {
    width: clamp(138px, 38vw, 190px);
  }

  .title-glow {
    letter-spacing: 0.08em;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar input,
  .toolbar .secondary-button {
    width: 100%;
    max-width: none;
  }

}

@media (min-width: 721px) and (max-height: 700px) {
  .hero {
    padding: 58px 18px 24px;
  }

  .hero-inner {
    gap: 12px;
  }

  .school-logo {
    width: clamp(120px, 17vh, 185px);
  }

  .title-glow {
    font-size: clamp(3.5rem, 11vh, 6rem);
  }
}

@media (max-width: 480px) {
  .title-glow {
    font-size: clamp(3.9rem, 19vw, 6rem);
  }

  .subtitle {
    letter-spacing: 0.18em;
  }

  .modal-panel {
    padding: 1.2rem 1rem 1rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
}
