:root {
  --bg: #0d0f14;
  --surface: #161920;
  --surface2: #1e2230;
  --border: #2a2f3f;
  --border-light: #343b52;
  --text: #e8eaf0;
  --text-muted: #8b92a8;
  --text-dim: #5a6075;
  --accent: #4f8ef7;
  --accent-hover: #3a7be5;
  --accent-glow: rgba(79, 142, 247, 0.18);
  --green: #22c55e;
  --green-bg: rgba(34, 197, 94, 0.12);
  --green-border: rgba(34, 197, 94, 0.25);
  --red: #f87171;
  --red-bg: rgba(248, 113, 113, 0.12);
  --red-border: rgba(248, 113, 113, 0.25);
  --orange: #fb923c;
  --orange-bg: rgba(251, 146, 60, 0.12);
  --orange-border: rgba(251, 146, 60, 0.25);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

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

html {
  scroll-behavior: smooth;
}

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

/* ── Layout ── */
.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 3rem 1.25rem 5rem;
}

/* ── Hero ── */
.hero {
  text-align: center;
  margin-bottom: 2.5rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent-glow);
  border: 1px solid rgba(79, 142, 247, 0.3);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 1.25rem;
}

h1 {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #ffffff 0%, #a8b8e8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.15;
  margin-bottom: 0.85rem;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 520px;
  margin: 0 auto;
}

/* ── Card / Panel ── */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}

.panel-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 1.25rem;
}

/* ── Form ── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group.full {
  grid-column: 1 / -1;
}

label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.hint {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-dim);
}

input[type="number"],
input[type="text"],
input[type="email"],
select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  font-size: 1rem;
  color: var(--text);
  font-family: inherit;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  -webkit-appearance: none;
}

input[type="number"]:focus,
input[type="text"]:focus,
input[type="email"]:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ── Validation errors ── */
input.field-error,
select.field-error {
  border-color: var(--red) !important;
  box-shadow: 0 0 0 3px var(--red-bg) !important;
}

.field-error-msg {
  font-size: 0.74rem;
  color: var(--red);
  margin-top: 0.15rem;
  animation: errorFadeIn 0.2s ease;
}

@keyframes errorFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fieldset-box.field-error {
  border-color: var(--red) !important;
  box-shadow: 0 0 0 3px var(--red-bg);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238b92a8' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.25rem;
}

/* MCAT fieldset */
.fieldset-box {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  grid-column: 1 / -1;
}

.fieldset-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.fieldset-hint {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.mcat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

/* Submit button */
.btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding: 0.75rem 2rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  box-shadow: none;
}

.btn-submit:hover {
  background: var(--accent-hover);
  box-shadow: none;
}

/* Modal styles */
.modal {
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
}

.modal[aria-hidden="false"] {
  display: flex;
}

.modal-content {
  background: var(--surface);
  color: var(--text);
  padding: 2rem 2.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.modal-content h4 {
  margin-bottom: 12px;
}

.modal-content p {
  margin-bottom: 1.25rem;
  font-size: 1rem;
  color: var(--text-muted);
}

.modal-content input[type="email"] {
  margin-bottom: 1rem;
  width: 100%;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}


.btn-submit:active {
  transform: scale(0.98);
}

.btn-submit .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}

.btn-submit.loading .spinner {
  display: block;
}

.btn-submit.loading .btn-text {
  display: none;
}

@media (max-width: 600px) {

  .modal {
    align-items: flex-start;
    padding-top: 100px;
  }

  .modal-content {
    top: 5%;
    transform: none;
    max-height: 70vh;
    overflow-y: auto;
    width: calc(100% - 32px);
    margin: 0 auto;
  }

}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Results ── */
#results-section {
  display: none;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

#results-section.visible {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.results-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.results-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 0.85rem;
  transition: border-color 0.2s, transform 0.2s;
  animation: cardIn 0.4s ease both;
}

.result-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-card:nth-child(1) {
  animation-delay: 0.05s;
}

.result-card:nth-child(2) {
  animation-delay: 0.10s;
}

.result-card:nth-child(3) {
  animation-delay: 0.15s;
}

.result-card:nth-child(4) {
  animation-delay: 0.20s;
}

.result-card:nth-child(5) {
  animation-delay: 0.25s;
}

.result-card:nth-child(6) {
  animation-delay: 0.30s;
}

.result-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.65rem;
}

.result-card-header h3 {
  font-size: 1rem;
  font-weight: 700;
}

.badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.badge-eligible {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid var(--green-border);
}

.badge-not-eligible {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid var(--red-border);
}

.badge-competitive {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid var(--green-border);
}

.result-card.eligible {
  border-left: 3px solid var(--green);
}

.result-card.not-eligible {
  border-left: 3px solid var(--red);
}

.result-card.competitive {
  border-left: 3px solid var(--green);
}

.explanation {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ── Email divider in form ── */
.email-divider {
  grid-column: 1 / -1;
  border: none;
  border-top: 1px solid var(--border);
  margin: 0.5rem 0;
}

/* ── Disclaimer ── */
.disclaimer {
  margin-top: 2rem;
  font-size: 0.78rem;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.7;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Responsive ── */
@media (max-width: 540px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-group.full {
    grid-column: 1;
  }

  .mcat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Subtle background texture ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 40% at 50% -10%, rgba(79, 142, 247, 0.08) 0%, transparent 70%),
    radial-gradient(ellipse 50% 30% at 90% 100%, rgba(139, 92, 246, 0.06) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.container {
  position: relative;
  z-index: 1;
}

.warning-warning {
  font-size: 0.88rem;
  color: rgb(221, 114, 0);
  line-height: 1.65;
}