:root {
  color-scheme: light;
  --navy: #15365b;
  --blue: #35659a;
  --gold: #d6aa48;
  --ink: #26374c;
  --muted: #69798d;
  --line: #e1e7ef;
  --bg: #f3f6fa;
  --white: #fff;
  --shadow: 0 14px 32px rgb(21 54 91 / 9%);
}

* {
  box-sizing: border-box;
}

body {
  position: relative;
  isolation: isolate;
  margin: 0;
  background:
    radial-gradient(ellipse at 12% 0, rgb(225 235 247 / 56%), transparent 34rem),
    var(--bg);
  color: var(--ink);
  font: 15px/1.55 Inter, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background: url("vut-logo.jpeg") no-repeat center / max(180vw, 150vh) auto;
  content: "";
  opacity: 0.05;
  mix-blend-mode: multiply;
  pointer-events: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

:focus-visible {
  outline: 3px solid rgb(49 93 143 / 32%);
  outline-offset: 3px;
}

.hidden {
  display: none !important;
}

.topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 34px;
  padding: 0 max(24px, calc((100vw - 1140px) / 2));
  background: var(--white);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 12px rgb(21 54 91 / 3%);
}

.brand {
  color: var(--navy);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.035em;
  text-decoration: none;
  white-space: nowrap;
}

.brand span {
  color: var(--blue);
}

nav {
  display: flex;
  flex: 1;
  gap: 6px;
  align-self: stretch;
}

.nav-button,
.tab {
  border: 0;
  background: none;
  color: var(--muted);
  font-weight: 650;
  cursor: pointer;
}

.nav-button {
  padding: 10px 14px;
}

.nav-button.active {
  color: var(--navy);
  box-shadow: inset 0 -2px var(--gold);
}

main {
  max-width: 1140px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.section-heading,
.panel-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
}

.section-heading {
  position: relative;
  padding-bottom: 22px;
}

.section-heading::after {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 52px;
  height: 3px;
  border-radius: 3px;
  background: var(--gold);
  content: "";
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.13em;
}

h1,
h2,
h3 {
  margin: 0.1em 0;
  color: var(--navy);
  line-height: 1.2;
}

h1 {
  font-size: clamp(34px, 4vw, 42px);
  letter-spacing: -0.05em;
}

h2 {
  font-size: 20px;
  letter-spacing: -0.02em;
}

p {
  color: var(--muted);
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search:focus-within {
  border-color: #9cacc0;
  box-shadow: 0 0 0 3px rgb(49 93 143 / 8%);
}

.search input {
  width: 210px;
  margin: 0;
  padding: 2px 0;
  border: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
}

.sport-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 18px;
}

.sport-card,
.application-list,
.panel-heading,
.admin-tabs,
.filters {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.sport-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  padding: 24px;
  border-color: #e0e6ee;
  box-shadow: 0 5px 16px rgb(21 54 91 / 5%);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.sport-card::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), rgb(214 170 72 / 22%));
  content: "";
}

.sport-card:hover {
  transform: translateY(-3px);
  border-color: #cbd7e5;
  box-shadow: var(--shadow);
}

.sport-card h2 {
  margin: 0;
}

.sport-card p {
  min-height: 45px;
  margin: 0;
}

.card-top,
.application-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.period,
small {
  color: var(--muted);
  font-size: 12px;
}

.badge {
  padding: 4px 9px;
  border-radius: 999px;
  background: #eef1f5;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.badge.open,
.badge.approved {
  background: #e2f1e8;
  color: #246143;
}

.badge.pending {
  background: #fbf1d8;
  color: #795b1b;
}

.badge.declined,
.badge.closed {
  background: #f7e7e7;
  color: #8d3c3c;
}

.badge.draft,
.badge.waitlisted {
  background: #eaf0f7;
  color: var(--blue);
}

dl {
  display: flex;
  gap: 24px;
  margin: 0;
}

dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

dd {
  margin: 3px 0 0;
  color: var(--navy);
  font-weight: 700;
}

details {
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

summary {
  color: var(--navy);
  font-weight: 650;
  cursor: pointer;
}

.button {
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.button:not(:disabled):active {
  transform: translateY(1px);
}

.button.gold {
  background: var(--navy);
  color: var(--white);
}

.button.gold:hover:not(:disabled) {
  background: #224b78;
}

.button.outline {
  border-color: #d4dce6;
  background: var(--white);
  color: var(--navy);
}

.button.outline:hover:not(:disabled) {
  border-color: #aebdce;
  background: #f9fafb;
}

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.notice {
  margin-bottom: 20px;
  padding: 13px 16px;
  border-radius: 9px;
  background: #e4f2e9;
  color: #286044;
}

.notice.error {
  background: #f7e7e7;
  color: #8d3c3c;
}

.login-error {
  margin: 12px 0;
  color: #8d3c3c;
}

.empty {
  padding: 45px;
  border: 1px dashed #cbd4df;
  border-radius: 12px;
  background: var(--white);
  text-align: center;
}

.admin-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
  padding: 5px;
}

.tab {
  padding: 9px 14px;
  border-radius: 8px;
}

.tab.active {
  background: var(--navy);
  color: var(--white);
}

.panel-heading {
  margin-bottom: 12px;
  padding: 20px;
}

.panel-heading p {
  margin: 0.35em 0 0;
}

.filters {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
}

.filters input,
.filters select {
  flex: 1;
}

.application-list {
  overflow: hidden;
}

.application-row {
  width: 100%;
  padding: 15px 18px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--white);
  text-align: left;
  cursor: pointer;
  transition: background-color 150ms ease;
}

.application-row:hover {
  background: #f8fafc;
}

.application-row strong,
.application-row small {
  display: block;
}

.application-row:last-child {
  border: 0;
}

dialog {
  width: min(700px, calc(100vw - 28px));
  max-height: min(88vh, 900px);
  overflow: auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  box-shadow: 0 20px 70px rgb(6 25 54 / 24%);
}

dialog::backdrop {
  background: rgb(6 25 54 / 45%);
  backdrop-filter: blur(2px);
}

.close {
  position: absolute;
  top: 9px;
  right: 13px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 28px;
  cursor: pointer;
}

dialog h3 {
  margin-top: 24px;
  font-size: 15px;
}

.form-grid,
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.form-grid label,
.login-form > label,
.sport-form > label,
.review-form > label {
  display: block;
  margin: 12px 0;
  color: var(--navy);
  font-weight: 650;
}

.optional {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

input,
select,
textarea {
  width: 100%;
  margin-top: 5px;
  padding: 9px 10px;
  border: 1px solid #d3dce6;
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #8fa4bd;
  outline: 0;
  box-shadow: 0 0 0 3px rgb(49 93 143 / 9%);
}

textarea {
  min-height: 72px;
  resize: vertical;
}

.checkbox {
  display: block;
  margin: 15px 0;
  color: var(--ink);
}

.checkbox input {
  width: auto;
  margin-right: 8px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.info-grid {
  padding: 14px;
  border-radius: 9px;
  background: #f5f7f9;
}

.info-grid p {
  margin: 0;
}

.info-grid b {
  display: block;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

@media (max-width: 650px) {
  body::before {
    background-position: center;
    background-size: max(180vw, 150vh) auto;
  }

  .topbar {
    min-height: 64px;
    gap: 6px;
    padding: 0 10px;
  }

  .brand {
    font-size: 16px;
  }

  .topbar nav {
    display: flex;
    justify-content: flex-end;
  }

  .nav-button {
    padding: 9px 6px;
  }

  .topbar > .button {
    padding: 8px 10px;
    font-size: 13px;
    white-space: nowrap;
  }

  main {
    padding: 30px 14px 56px;
  }

  .section-heading,
  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel-heading {
    width: 100%;
  }

  .section-heading {
    padding-bottom: 18px;
  }

  .form-grid,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .search,
  .search input {
    width: 100%;
  }

  .filters {
    flex-direction: column;
  }

  .sport-grid {
    grid-template-columns: 1fr;
  }

  .sport-card {
    padding: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
