:root {
  --navy: #0f2942;
  --blue: #276aa8;
  --blue-dark: #174c7e;
  --soft: #eef5f9;
  --paper: #fffefd;
  --ink: #142235;
  --muted: #667484;
  --line: #d7e3ec;
  --gold: #d8aa2d;
}

* { box-sizing: border-box; }

body.public-page {
  min-height: 100svh;
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(15, 41, 66, .94), rgba(39, 106, 168, .76) 280px, rgba(245, 248, 251, 0) 520px),
    repeating-linear-gradient(90deg, rgba(15, 41, 66, .035) 0 1px, transparent 1px 80px),
    #f4f7fa;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.announcement-shell {
  width: min(980px, calc(100% - 28px));
  margin: 0 auto;
  padding: clamp(14px, 3vh, 28px) 0 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.school-header {
  padding: 8px 0 clamp(16px, 3vh, 24px);
  color: #fff;
}

.school-logo {
  width: clamp(130px, 17vh, 176px);
  height: clamp(130px, 17vh, 176px);
  object-fit: contain;
  margin: 0 auto 12px;
  display: block;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  filter: drop-shadow(0 16px 24px rgba(5, 18, 32, .28));
}

.school-header h1 {
  margin: 0;
  font-size: clamp(1.32rem, 2.9vw, 1.95rem);
  font-weight: 820;
  letter-spacing: 0;
  text-wrap: balance;
  color: rgba(255, 255, 255, .94);
}

.school-header h2 {
  margin: 5px 0 6px;
  font-size: clamp(1.4rem, 3.25vw, 2.05rem);
  color: #ffffff;
  font-weight: 850;
  text-wrap: balance;
}

.school-tagline {
  margin: 5px 0 2px;
  color: #f4cf5b;
  font-size: clamp(1.48rem, 3.55vw, 2.22rem);
  font-weight: 880;
  letter-spacing: .02em;
  line-height: 1.1;
  text-shadow: 0 12px 28px rgba(5, 18, 32, .24);
}

.year {
  color: rgba(255, 255, 255, .78);
  margin: 0;
  font-size: clamp(1rem, 2.1vw, 1.18rem);
  font-weight: 650;
}

.search-panel,
.input-card,
.result-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 254, 253, .96);
  box-shadow: 0 24px 64px rgba(19, 34, 53, .14);
  backdrop-filter: blur(8px);
}

.search-panel {
  padding: clamp(14px, 3vw, 24px);
  margin-top: -4px;
}

.input-card {
  position: relative;
  overflow: hidden;
  padding: clamp(16px, 3vw, 24px);
}

.input-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--gold), var(--blue));
}

.instruction {
  font-size: 1.08rem;
  color: var(--muted);
  margin-bottom: 16px;
  line-height: 1.5;
  font-weight: 500;
  text-align: center;
}

.form-label {
  color: var(--navy);
  font-weight: 800;
  display: block;
  text-align: center;
}

.form-control {
  border-color: #cddde9;
  min-height: 52px;
  border-radius: 999px;
  padding-left: 20px;
  padding-right: 20px;
  text-align: center;
  box-shadow: none;
}

.form-control::placeholder {
  color: #8a98a8;
  font-size: .92rem;
  font-weight: 400;
  opacity: 1;
}

.form-control:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 .22rem rgba(39, 106, 168, .14);
}

.btn-primary {
  position: relative;
  isolation: isolate;
  min-height: 52px;
  width: auto;
  flex: 0 0 auto;
  padding: 0 30px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, 0)),
    linear-gradient(135deg, #2f78b6, #174c7e 62%, #123b65);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  font-size: .96rem;
  font-weight: 800;
  color: #fff;
  overflow: hidden;
  letter-spacing: .01em;
  box-shadow:
    0 16px 30px rgba(23, 76, 126, .28),
    inset 0 1px 0 rgba(255, 255, 255, .28),
    inset 0 -1px 0 rgba(4, 20, 36, .18);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease, background .18s ease;
}

.btn-primary::before {
  content: "";
  position: absolute;
  top: -70%;
  left: -35%;
  width: 42%;
  height: 240%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .26), transparent);
  transform: rotate(18deg);
  transition: left .5s ease;
  z-index: 0;
}

.btn-primary::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, .13);
  pointer-events: none;
  z-index: 1;
}

.btn-primary:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, 0)),
    linear-gradient(135deg, #377fbd, #185487 62%, #123f6a);
  transform: translateY(-1px);
  box-shadow:
    0 20px 38px rgba(23, 76, 126, .34),
    inset 0 1px 0 rgba(255, 255, 255, .32),
    inset 0 -1px 0 rgba(4, 20, 36, .20);
}

.btn-primary:hover::before {
  left: 105%;
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow:
    0 9px 20px rgba(23, 76, 126, .24),
    inset 0 2px 6px rgba(4, 20, 36, .16);
}

.input-group .btn-primary {
  border-radius: 999px !important;
  margin-left: 10px !important;
}

.input-group .form-control {
  border-radius: 999px !important;
}

.loading-box {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: var(--muted);
}

.result-card {
  padding: clamp(20px, 4vw, 34px);
  border-top: 5px solid var(--blue);
  border-left: 1px solid var(--line);
}

.result-card.accepted { border-top-color: #20975a; }
.result-card.rejected { border-top-color: #cf4d5c; }
.result-card h3 { font-weight: 800; color: var(--navy); }

.result-list {
  margin: 22px 0;
  border-top: 1px solid var(--line);
}

.result-list div {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.result-list dt { color: var(--muted); font-weight: 700; }
.result-list dd { margin: 0; font-weight: 700; }

.official-note {
  background: #f3f7f9;
  border: 1px solid #e0ebf2;
  border-radius: 8px;
  padding: 16px 18px;
  color: var(--muted);
}

.proof-action {
  display: flex;
  justify-content: center;
  margin: 2px 0 18px;
}

.btn-print-proof {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding-inline: 28px;
  text-decoration: none;
  font-size: .94rem;
}

.official-note p { margin: 0 0 4px; }
.official-note p:last-child { margin-bottom: 0; }

.public-footer {
  text-align: center;
  padding: 10px 12px 16px;
  color: var(--navy);
  font-size: .92rem;
  font-weight: 750;
  letter-spacing: .01em;
}

.public-footer::before {
  content: "";
  display: block;
  width: 52px;
  height: 3px;
  margin: 0 auto 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--blue));
}

.alert {
  border-radius: 8px;
  border: 0;
  box-shadow: 0 14px 30px rgba(31, 47, 70, .08);
}

.swal2-popup.spmb-alert {
  width: min(390px, calc(100% - 32px));
  padding: 26px 24px 24px;
  border: 1px solid rgba(215, 227, 236, .95);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 254, 253, .98), rgba(247, 251, 253, .98));
  box-shadow: 0 28px 70px rgba(7, 25, 43, .22);
  font-family: "Segoe UI", Arial, sans-serif;
}

.swal2-popup.spmb-alert::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(90deg, var(--gold), var(--blue));
}

.spmb-alert-title {
  color: var(--navy);
  font-size: 1.35rem;
  font-weight: 850;
  letter-spacing: 0;
}

.spmb-alert-text {
  color: var(--muted) !important;
  font-size: .96rem !important;
  line-height: 1.55;
  margin-top: 8px !important;
}

.spmb-alert-confirm {
  min-height: 44px;
  min-width: 118px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--blue), var(--blue-dark));
  color: #fff;
  font-weight: 750;
  box-shadow: 0 12px 24px rgba(23, 76, 126, .24);
  transition: transform .18s ease, box-shadow .18s ease;
}

.spmb-alert-confirm:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(23, 76, 126, .30);
}

.swal2-icon.swal2-success {
  border-color: #219b62 !important;
  color: #219b62 !important;
}

.swal2-icon.swal2-info,
.swal2-icon.swal2-warning {
  border-color: var(--blue) !important;
  color: var(--blue) !important;
}

.swal2-icon.swal2-error {
  border-color: #cf4d5c !important;
  color: #cf4d5c !important;
}

@media (max-width: 640px) {
  .announcement-shell {
    width: min(100% - 18px, 980px);
    padding-top: 10px;
  }

  .school-header {
    padding-bottom: 12px;
  }

  .school-logo {
    width: 128px;
    height: 128px;
    margin-bottom: 8px;
  }

  .school-header h1 {
    font-size: 1.15rem;
  }

  .school-header h2 {
    font-size: 1.24rem;
  }

  .school-tagline {
    font-size: 1.36rem;
    margin-top: 6px;
  }

  .year {
    font-size: .98rem;
  }

  .search-panel,
  .input-card {
    padding: 14px;
  }

  .instruction {
    font-size: 1rem;
    margin-bottom: 12px;
  }

  .form-control,
  .btn-primary {
    min-height: 46px;
  }

  .form-text {
    font-size: .78rem;
  }

  .public-footer {
    padding: 7px 10px 9px;
    font-size: .82rem;
  }

  .input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .input-group .form-control {
    width: 100%;
    border-radius: 999px !important;
  }
  .input-group .btn {
    width: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 12px;
    border-radius: 999px !important;
  }
  .result-list div { grid-template-columns: 1fr; gap: 4px; }
}
