:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --ink: #101828;
  --muted: #667085;
  --line: #d9e2ec;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-solid: #ffffff;
  --blue: #1769ff;
  --blue-dark: #0b4ec4;
  --green: #16a163;
  --orange: #f59f00;
  --red: #e5484d;
  --shadow: 0 24px 70px rgba(35, 48, 70, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(145deg, rgba(23, 105, 255, 0.12), transparent 36%),
    linear-gradient(315deg, rgba(22, 161, 99, 0.10), transparent 32%),
    var(--bg);
  color: var(--ink);
}

a {
  color: var(--blue-dark);
}

button,
input,
select,
textarea {
  font: inherit;
}

.ctf-page {
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 0;
}

.logo,
.topnav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo {
  color: var(--ink);
  font-weight: 850;
  text-decoration: none;
}

.logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, #1769ff 0 50%, #16a163 50%),
    linear-gradient(180deg, #ffcf00 0 50%, #ff4053 50%);
  box-shadow: 0 10px 20px rgba(23, 105, 255, 0.18);
}

.topnav {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topnav a,
.ghost-button,
.ghost-link {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 8px 12px;
  color: #344054;
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
}

.ghost-button {
  cursor: pointer;
}

.user-pill {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
  gap: 42px;
  align-items: center;
  min-height: calc(100vh - 92px);
  padding: 28px 0 64px;
}

.auth-copy h1,
.workspace h1,
.success-hero h1 {
  margin: 14px 0 16px;
  max-width: 680px;
  font-size: clamp(42px, 6vw, 74px);
  line-height: 0.96;
  letter-spacing: 0;
}

.auth-copy p {
  max-width: 620px;
  margin: 0;
  color: #344054;
  font-size: 20px;
  line-height: 1.55;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 0 10px;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}

.signal-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
}

.signal-row span {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  padding: 8px 10px;
  color: #344054;
  font-size: 13px;
  font-weight: 720;
}

.auth-card,
.form-panel,
.table-panel,
.result-panel,
.success-hero {
  border: 1px solid rgba(217, 226, 236, 0.94);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 26px;
  backdrop-filter: blur(16px);
}

.auth-card h2,
.panel-title h2,
.result-panel h2,
.empty-state h3,
.empty-state h2 {
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 1.1;
}

.muted,
.form-note,
.empty-state p,
.success-box p {
  color: var(--muted);
}

.form-grid {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.form-grid label {
  color: #344054;
  font-size: 13px;
  font-weight: 850;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  font-size: 15px;
}

.form-grid textarea {
  padding-top: 12px;
  resize: vertical;
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(23, 105, 255, 0.14);
  outline: none;
}

.primary-button,
.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  padding: 0 18px;
  font-size: 16px;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
}

.primary-button {
  width: 100%;
  margin-top: 10px;
}

.primary-link.full {
  width: 100%;
}

.primary-button:hover,
.primary-link:hover {
  background: var(--blue-dark);
}

.form-note {
  margin: 16px 0 0;
  font-size: 14px;
}

.alert {
  margin-top: 16px;
  border: 1px solid #ffd3a6;
  border-radius: 8px;
  background: #fff7ed;
  padding: 12px;
  color: #9a4d00;
  font-size: 14px;
  line-height: 1.45;
}

.workspace {
  padding: 42px 0 76px;
}

.workspace.narrow {
  width: min(760px, 100%);
  margin: 0 auto;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.workspace h1 {
  font-size: clamp(38px, 5vw, 62px);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.stat-grid article {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.stat-grid span,
.request-meta span,
.panel-title span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.stat-grid strong {
  display: block;
  margin-top: 5px;
  font-size: 20px;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.request-list {
  display: grid;
  gap: 10px;
}

.request-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 66px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px 14px;
  color: var(--ink);
  text-decoration: none;
}

.request-row span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 8px;
  padding: 0 10px;
  background: #eef4f9;
  color: #344054;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.status-slot_available,
.status-booked {
  background: #e6f7ed;
  color: #087443;
}

.status-no_slots {
  background: #fff4df;
  color: #8a5200;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 28px;
  text-align: center;
}

.empty-state.compact {
  margin: 18px 0;
  text-align: left;
}

.request-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.request-meta div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.request-meta strong {
  display: block;
  margin-top: 5px;
}

.success-box {
  margin: 18px 0;
  border: 1px solid #bce8cf;
  border-radius: 8px;
  background: #effaf4;
  padding: 18px;
}

.request-summary {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  color: #344054;
  font-weight: 750;
}

.success-hero {
  text-align: center;
}

.success-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-weight: 900;
}

.success-hero h1 {
  margin-left: auto;
  margin-right: auto;
  font-size: clamp(38px, 5vw, 58px);
}

code {
  display: inline-flex;
  max-width: 100%;
  overflow-wrap: anywhere;
  border-radius: 8px;
  background: #e9eef5;
  padding: 6px 9px;
  color: #243447;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

@media (max-width: 820px) {
  .ctf-page {
    width: min(100% - 28px, 760px);
  }

  .topbar,
  .section-head,
  .request-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .auth-layout,
  .stat-grid,
  .request-meta {
    grid-template-columns: 1fr;
  }

  .auth-layout {
    gap: 28px;
    min-height: auto;
    padding-top: 18px;
  }

  .auth-copy h1 {
    font-size: 44px;
  }

  .auth-copy p {
    font-size: 17px;
  }

  .auth-card,
  .form-panel,
  .table-panel,
  .result-panel,
  .success-hero {
    padding: 20px;
  }
}
