:root {
  --ink: #08243a;
  --text: #17232d;
  --muted: #5e6c78;
  --line: #dce6ee;
  --accent: #ee002e;
  --accent-dark: #c70027;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #eef5fb;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

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

button,
input,
select {
  font: inherit;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  color: var(--ink);
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.08;
  font-weight: 800;
}

h2 {
  color: var(--ink);
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.08;
  font-weight: 800;
}

.container {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}

.form-page {
  position: relative;
  min-height: 100vh;
  padding: 28px 16px 48px;
  overflow: hidden;
  background:
    linear-gradient(116deg, transparent 0 55%, rgba(238, 0, 46, 0.08) 55% 55.45%, transparent 55.45%),
    linear-gradient(116deg, rgba(8, 36, 58, 0.045) 0 18%, transparent 18%),
    repeating-linear-gradient(90deg, rgba(8, 36, 58, 0.035) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(0deg, rgba(8, 36, 58, 0.028) 0 1px, transparent 1px 72px),
    linear-gradient(180deg, #fbfdff 0%, #eef5ff 48%, #f7fbff 100%);
}

.form-page::before,
.form-page::after {
  content: "";
  position: fixed;
  inset: auto;
  pointer-events: none;
}

.form-page::before {
  top: 0;
  left: 0;
  width: 100vw;
  height: 180px;
  background:
    linear-gradient(90deg, rgba(238, 0, 46, 0.78) 0 5px, transparent 5px 100%),
    repeating-linear-gradient(116deg, transparent 0 42px, rgba(7, 88, 168, 0.07) 42px 43px, transparent 43px 88px);
  opacity: 0.5;
}

.form-page::after {
  right: 0;
  bottom: -8px;
  width: min(460px, 62vw);
  height: min(360px, 42vh);
  background:
    repeating-linear-gradient(0deg, rgba(8, 36, 58, 0.045) 0 1px, transparent 1px 16px),
    repeating-linear-gradient(90deg, rgba(238, 0, 46, 0.055) 0 1px, transparent 1px 16px);
  clip-path: polygon(30% 0, 100% 0, 100% 100%, 0 100%);
  opacity: 0.58;
}

.application-card,
.admin-card,
.success-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 30px;
  box-shadow: 0 24px 60px rgba(8, 36, 58, 0.08);
}

.form-page .application-card {
  position: relative;
  z-index: 1;
  width: min(100%, 1160px);
  max-width: 1160px;
  margin: 0 auto;
  border-radius: 0 0 8px 8px;
  padding: 32px 40px 44px;
  box-shadow: 0 26px 80px rgba(8, 36, 58, 0.12);
}

.form-page .application-card h1 {
  margin-bottom: 12px;
  font-size: 30px;
  line-height: 1.08;
}

.form-intro,
.small {
  color: var(--muted);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 16px;
  margin-top: 24px;
}

.field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.field.full {
  grid-column: 1 / -1;
}

.field span,
.confirm-box span {
  color: var(--text);
  font-weight: 850;
}

input,
select {
  width: 100%;
  min-height: 50px;
  border: 1px solid #c7d6e1;
  border-radius: 10px;
  padding: 0 14px;
  color: var(--ink);
  background: #ffffff;
  outline: none;
  font-weight: 650;
}

input:focus,
select:focus {
  border-color: #0758a8;
  box-shadow: 0 0 0 4px rgba(7, 88, 168, 0.12);
}

.terms-box {
  margin-top: 26px;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: #f8fbfd;
}

.terms-heading {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 20px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.terms-heading h2 {
  margin-bottom: 0;
  font-size: 18px;
  line-height: 1.2;
}

.terms-pdf-viewer {
  height: min(78vh, 760px);
  min-height: 620px;
  background: #ffffff;
}

.terms-pdf-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.confirm-box {
  display: flex;
  gap: 12px;
  margin: 22px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
}

.confirm-box input {
  width: 18px;
  min-width: 18px;
  min-height: 18px;
  margin-top: 4px;
  accent-color: var(--accent);
}

.btn {
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid transparent;
  font-weight: 850;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(238, 0, 46, 0.2);
}

.btn-primary:hover {
  background: var(--accent-dark);
}

.btn-outline {
  background: #ffffff;
  color: var(--ink);
  border-color: var(--line);
}

.submit-btn {
  width: min(320px, 100%);
}

.error-box,
.error-text {
  color: #b00020;
  font-weight: 800;
}

.success-wrap,
.admin-wrap {
  min-height: 100vh;
  padding: 52px 0;
  background:
    linear-gradient(135deg, rgba(238, 0, 46, 0.12) 0 1px, transparent 1px 48px),
    linear-gradient(45deg, rgba(7, 88, 168, 0.08) 0 1px, transparent 1px 38px),
    linear-gradient(120deg, #f8fbff 0%, #eaf2ff 48%, #ffffff 100%);
}

.success-wrap {
  position: relative;
  overflow: hidden;
}

.success-stage {
  position: relative;
  z-index: 1;
}

.success-card {
  max-width: 760px;
  margin: 0 auto;
}

.simple-success {
  position: relative;
  overflow: hidden;
  min-height: 340px;
  display: grid;
  align-content: center;
  padding: 54px 46px;
  border-color: rgba(199, 214, 225, 0.9);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.86)),
    linear-gradient(120deg, rgba(238, 0, 46, 0.08), rgba(7, 88, 168, 0.1));
  box-shadow: 0 30px 90px rgba(8, 36, 58, 0.14);
}

.simple-success h1 {
  max-width: 650px;
  margin-bottom: 0;
  font-size: clamp(38px, 5vw, 62px);
}

.success-check {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  border-radius: 22px;
  background: var(--accent);
  box-shadow: 0 18px 38px rgba(238, 0, 46, 0.28);
  transform: rotate(-5deg);
}

.success-check span {
  width: 34px;
  height: 18px;
  border-left: 6px solid #ffffff;
  border-bottom: 6px solid #ffffff;
  transform: rotate(-45deg) translate(2px, -2px);
}

.eyebrow {
  margin: 0 0 10px;
  color: #0758a8;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  display: inline-block;
  width: 24px;
  height: 2px;
  margin-right: 10px;
  vertical-align: middle;
  background: var(--accent);
}

.success-burst {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.success-burst span {
  position: absolute;
  width: 8px;
  height: 22px;
  border-radius: 999px;
  background: var(--accent);
  animation: confettiFloat 3.2s ease-in-out infinite;
}

.success-burst span:nth-child(1) { top: 6%; left: 70%; background: #0758a8; transform: rotate(18deg); }
.success-burst span:nth-child(2) { top: 11%; left: 82%; width: 10px; height: 10px; background: #00c966; }
.success-burst span:nth-child(3) { top: 24%; left: 88%; background: #ee002e; transform: rotate(62deg); }
.success-burst span:nth-child(4) { top: 35%; left: 76%; width: 26px; height: 7px; background: #08243a; transform: rotate(-24deg); }
.success-burst span:nth-child(5) { top: 8%; left: 21%; width: 22px; height: 7px; background: #ee002e; transform: rotate(36deg); }
.success-burst span:nth-child(6) { top: 19%; left: 10%; background: #0758a8; transform: rotate(-42deg); }
.success-burst span:nth-child(7) { top: 34%; left: 18%; width: 10px; height: 10px; background: #00c966; }
.success-burst span:nth-child(8) { top: 29%; left: 8%; width: 24px; height: 7px; background: #08243a; transform: rotate(18deg); }
.success-burst span:nth-child(9) { top: 48%; left: 84%; width: 9px; height: 9px; background: #f5c542; }
.success-burst span:nth-child(10) { top: 54%; left: 69%; width: 22px; height: 7px; background: #ee002e; transform: rotate(-38deg); }
.success-burst span:nth-child(11) { top: 58%; left: 24%; background: #0758a8; transform: rotate(28deg); }
.success-burst span:nth-child(12) { top: 45%; left: 12%; width: 11px; height: 11px; background: #00c966; }
.success-burst span:nth-child(13) { top: 14%; left: 38%; width: 24px; height: 7px; background: #08243a; transform: rotate(47deg); }
.success-burst span:nth-child(14) { top: 16%; left: 58%; width: 10px; height: 10px; background: #f5c542; }
.success-burst span:nth-child(15) { top: 70%; left: 62%; width: 24px; height: 7px; background: #0758a8; transform: rotate(20deg); }
.success-burst span:nth-child(16) { top: 72%; left: 34%; background: #ee002e; transform: rotate(-18deg); }
.success-burst span:nth-child(17) { top: 82%; left: 48%; width: 10px; height: 10px; background: #00c966; }
.success-burst span:nth-child(18) { top: 76%; left: 78%; width: 22px; height: 7px; background: #08243a; transform: rotate(-22deg); }
.success-burst span:nth-child(19) { top: 67%; left: 8%; width: 22px; height: 7px; background: #f5c542; transform: rotate(32deg); }
.success-burst span:nth-child(20) { top: 4%; left: 49%; background: #ee002e; transform: rotate(-34deg); }

@keyframes confettiFloat {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 10px; }
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
}

.admin-table th,
.admin-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: var(--ink);
  font-size: 13px;
  text-transform: uppercase;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.login-form {
  max-width: 430px;
  display: grid;
  gap: 14px;
}

@media (max-width: 640px) {
  .container {
    width: min(100% - 24px, 1180px);
  }

  .application-card,
  .admin-card,
  .success-card {
    padding: 22px;
  }

  .form-page .application-card {
    padding: 24px 18px 32px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .terms-pdf-viewer {
    height: 620px;
    min-height: 620px;
  }

  .admin-table {
    display: block;
    overflow-x: auto;
  }
}
