@import url("https://fonts.googleapis.com/css2?family=Kanit:ital,wght@1,700;1,800;1,900&display=swap");

:root {
  --background: #050505;
  --background-soft: #ce6a6a;
  --surface: #111111;
  --surface-2: #171717;
  --text: #ffffff;
  --muted: #a9a9a9;
  --border: #2b2b2b;
  --border-strong: #444444;
  --red: #df1421;
  --red-dark: #a70d16;
  --gold: #d3a81e;
  --green: #81c900;
  --danger: #ff4953;
}

h1,
h2,
h3,
.event-label,
.section-label,
.basket-heading h2,
.session-details h3 {
  font-family: "Kanit", Arial, Helvetica, sans-serif;
  font-style: italic;
  font-weight: 900;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    linear-gradient(rgba(0, 0, 0, 0.94), rgba(0, 0, 0, 0.94)),
    repeating-linear-gradient(
      135deg,
      #050505 0,
      #050505 16px,
      #090909 16px,
      #090909 32px
    );
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

/* =====================================================
   HERO
===================================================== */

.page-header {
  position: relative;
  min-height: 430px;
  display: flex;
  align-items: end;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.18),
      rgba(0, 0, 0, 0.44) 48%,
      rgba(0, 0, 0, 0.96)
    ),
    url("../images/hero.jpg") center center / cover no-repeat;
  border-bottom: 7px solid var(--red);
}

.page-header::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(
      100deg,
      rgba(223, 20, 33, 0.24),
      transparent 38%
    );
}

.page-header::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 36%;
  height: 7px;
  pointer-events: none;
  background: var(--gold);
}

.header-content {
  position: relative;
  z-index: 2;
  width: min(1220px, calc(100% - 40px));
  margin: 0 auto;
  padding: 82px 0 52px;
}

.event-label,
.section-label {
  margin: 0 0 12px;
  font-size: 0.76rem;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.event-label {
  display: inline-block;
  padding: 8px 13px;
  color: #fff;
  background: var(--red);
  border-left: 4px solid #fff;
}

.page-header h1 {
  max-width: 940px;
  margin: 0;
  font-size: clamp(2.8rem, 6vw, 5.8rem);
  line-height: 0.91;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: -0.025em;
  text-shadow: 0 5px 22px rgba(0, 0, 0, 0.9);
}

.booking-hero-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
}

.booking-hero-bottom p {
  margin: 0;
  color: #ececec;
  font-size: 1rem;
  font-weight: 700;
}

.session-list-link {
  flex-shrink: 0;
  padding: 12px 17px;
  color: #fff;
  background: var(--red);
  border: 1px solid var(--red);
  border-radius: 0;
  font-size: 0.78rem;
  font-weight: 900;
  font-style: italic;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition:
    background 0.15s ease,
    transform 0.15s ease;
}

.session-list-link:hover {
  transform: translateY(-1px);
  background: #f0212e;
}

/* =====================================================
   PAGE
===================================================== */

.page-container {
  width: min(1220px, calc(100% - 40px));
  margin: 42px auto 72px;
}

.card {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
}

.card h2,
.section-heading h2 {
  margin-top: 0;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

/* =====================================================
   DRIVER DETAILS
===================================================== */

.driver-section {
  position: relative;
  margin-bottom: 38px;
  padding: 24px 26px 26px;
  overflow: hidden;
  border-left: 6px solid var(--red);
}

.driver-section::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 170px;
  height: 100%;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.025) 0,
      rgba(255, 255, 255, 0.025) 9px,
      transparent 9px,
      transparent 18px
    );
}

.driver-section h2 {
  margin-bottom: 20px;
}

.form-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

label {
  display: grid;
  gap: 8px;
  color: #fff;
  font-size: 0.86rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.035em;
}

input {
  width: 100%;
  padding: 14px 15px;
  color: #fff;
  background: #090909;
  border: 1px solid var(--border-strong);
  border-radius: 0;
  outline: none;
}

input::placeholder {
  color: #777;
}

input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(223, 20, 33, 0.16);
}

/* =====================================================
   BOOKING LAYOUT
===================================================== */

.booking-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 355px;
  align-items: start;
  gap: 30px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 16px;
  padding: 19px 0 17px;
  background: transparent;
  border-left: 0;
  border-bottom: 3px solid var(--red);
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: clamp(1.5rem, 2.6vw, 2.25rem);
}

.section-label {
  color: var(--gold);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.filter-button {
  padding: 9px 14px;
  color: #fff;
  background: #101010;
  border: 1px solid var(--border-strong);
  border-radius: 0;
  font-size: 0.78rem;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}

.filter-button:hover {
  border-color: var(--red);
}

.filter-button.active {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
  box-shadow: none;
}

/* =====================================================
   SESSION CARDS
===================================================== */

.sessions-grid {
  display: grid;
  gap: 9px;
}

.session-card {
  position: relative;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 15px 17px;
  overflow: hidden;
  color: #fff;
  background: #101010;
  border: 1px solid var(--border);
  border-left: 5px solid #343434;
  border-radius: 0;
  box-shadow: none;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    transform 0.15s ease;
}

.session-card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 75px;
  height: 100%;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.018) 0,
      rgba(255, 255, 255, 0.018) 8px,
      transparent 8px,
      transparent 16px
    );
}

.session-card:hover {
  transform: translateX(2px);
  background: #151515;
  border-color: #454545;
  border-left-color: var(--red);
}

.session-number {
  position: relative;
  z-index: 1;

  width: 90px;
  height: 90px;
  flex-shrink: 0;

  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.session-number-forward {
  background-image: url("../images/session-forward.png");
}

.session-number-reverse {
  background-image: url("../images/session-reverse.png");
}

.session-details {
  position: relative;
  z-index: 1;
}

.session-details h3 {
  margin: 0 0 7px;
  font-size: 1.03rem;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
}

.session-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 0.88rem;
}

.session-meta span {
  position: relative;
}

.session-meta span:not(:last-child)::after {
  content: "•";
  position: absolute;
  right: -10px;
  color: #555;
}

.spaces-available {
  color: var(--green);
  font-weight: 900;
}

.spaces-available.sold-out {
  color: var(--danger);
}

.add-button {
  position: relative;
  z-index: 1;
  min-width: 124px;
  padding: 11px 15px;
  color: #fff;
  background: var(--red);
  border: 1px solid var(--red);
  border-radius: 0;
  font-size: 0.8rem;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  box-shadow: none;
  transition:
    background 0.15s ease,
    transform 0.15s ease;
}

.add-button:hover {
  transform: translateY(-1px);
  background: #f0212e;
}

.add-button.selected {
  color: #fff;
  background: #343434;
  border-color: #555;
  box-shadow: none;
}

.add-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

/* =====================================================
   BASKET
===================================================== */

.basket {
  position: sticky;
  top: 20px;
  padding: 23px;
  overflow: hidden;
  background: #0d0d0d;
  border-top: 6px solid var(--red);
}

.basket::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 115px;
  height: 78px;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.025) 0,
      rgba(255, 255, 255, 0.025) 8px,
      transparent 8px,
      transparent 16px
    );
}

.basket-heading {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid #2b2b2b;
}

.basket-heading h2 {
  margin: 0;
}

.basket-count {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  color: #fff;
  background: var(--red);
  border-radius: 0;
  font-weight: 900;
}

.basket-items {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 9px;
  min-height: 90px;
  margin: 16px 0 20px;
}

.empty-message {
  color: var(--muted);
}

.basket-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.basket-item p {
  margin: 0;
}

.basket-item small {
  color: var(--muted);
}

.remove-button {
  align-self: center;
  padding: 0;
  color: var(--danger);
  background: transparent;
  border: 0;
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.remove-button:hover {
  color: #fff;
}

/* =====================================================
   VOUCHERS
===================================================== */

.voucher-field {
  position: relative;
  z-index: 1;
  margin-top: 20px;
}

.voucher-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 8px;
}

.voucher-input-row input {
  min-width: 0;
}

.voucher-button {
  padding: 12px 16px;
  color: #fff;
  background: #202020;
  border: 1px solid #4a4a4a;
  border-radius: 0;
  font-size: 0.78rem;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
}

.voucher-button:hover {
  background: var(--red);
  border-color: var(--red);
}

.voucher-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.voucher-message {
  min-height: 20px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.voucher-message.success {
  color: var(--green);
}

.voucher-message.error {
  color: var(--danger);
}

/* =====================================================
   TOTAL / CHECKOUT
===================================================== */

.basket-total {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 22px 0 18px;
  padding-top: 18px;
  border-top: 2px solid var(--gold);
  font-size: 1.22rem;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
}

.checkout-button {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 15px;
  color: #fff;
  background: var(--red);
  border: 1px solid var(--red);
  border-radius: 0;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  box-shadow: none;
  transition:
    background 0.15s ease,
    transform 0.15s ease;
}

.checkout-button:hover {
  transform: translateY(-1px);
  background: #f0212e;
}

.form-message {
  position: relative;
  z-index: 1;
  min-height: 20px;
  margin-bottom: 0;
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 800;
}

/* =====================================================
   SUCCESS PAGE
===================================================== */

.success-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  background:
    linear-gradient(rgba(0, 0, 0, 0.94), rgba(0, 0, 0, 0.94)),
    repeating-linear-gradient(
      135deg,
      #050505 0,
      #050505 16px,
      #090909 16px,
      #090909 32px
    );
}

.success-card {
  width: min(680px, 100%);
  padding: 38px;
  color: #fff;
  background: #101010;
  border: 1px solid #333;
  border-top: 6px solid var(--red);
  border-radius: 0;
  box-shadow: none;
}

.success-icon {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  margin: 0 auto 20px;
  color: #fff;
  background: var(--green);
  border-radius: 0;
  font-size: 36px;
  font-weight: 900;
}

.success-eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-align: center;
}

.success-card h1 {
  margin: 0 0 14px;
  text-align: center;
  text-transform: uppercase;
  font-style: italic;
}

.success-card > p {
  text-align: center;
}

.booking-details {
  margin: 28px 0;
}

.booking-reference {
  padding: 18px;
  margin-bottom: 18px;
  background: #080808;
  border: 1px solid #3c3c3c;
  border-radius: 0;
  text-align: center;
}

.booking-reference span {
  display: block;
  margin-bottom: 6px;
  color: #aaa;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
}

.booking-reference strong {
  color: var(--gold);
  font-size: 1.25rem;
  overflow-wrap: anywhere;
}

.confirmation-email {
  margin-bottom: 20px;
  color: #bbb;
  text-align: center;
}

.confirmation-session {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid #333;
}

.confirmation-session p {
  margin: 4px 0 0;
  color: #aaa;
}

.confirmation-total {
  display: flex;
  justify-content: space-between;
  padding-top: 20px;
  color: var(--gold);
  font-size: 1.2rem;
  font-weight: 900;
}

.success-note {
  color: #aaa;
  font-size: 0.9rem;
}

.success-button {
  display: block;
  padding: 15px 20px;
  margin-top: 24px;
  color: #fff;
  background: var(--red);
  border-radius: 0;
  font-weight: 900;
  font-style: italic;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
}

.success-button:hover {
  background: #f0212e;
}

/* =====================================================
   ADMIN FOOTER
===================================================== */

.admin-login-footer {
  width: 100%;
  padding: 32px 0 10px;
  text-align: center;
}

.admin-login-link {
  color: #666;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-decoration: none;
  text-transform: uppercase;
}

.admin-login-link:hover {
  color: #fff;
}

/* =====================================================
   RESPONSIVE
===================================================== */

@media (max-width: 900px) {
  .booking-layout {
    grid-template-columns: 1fr;
  }

  .basket {
    position: static;
  }

  .page-header {
    min-height: 370px;
  }
}

@media (max-width: 700px) {
  .booking-hero-bottom {
    align-items: stretch;
    flex-direction: column;
  }

  .session-list-link {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 650px) {
  .page-container {
    width: min(100% - 20px, 1220px);
    margin-top: 24px;
  }

  .header-content {
    width: min(100% - 24px, 1220px);
    padding: 55px 0 34px;
  }

  .page-header {
    min-height: 330px;
  }

  .page-header h1 {
    font-size: clamp(2.15rem, 13vw, 3.8rem);
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .session-card {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 13px;
    padding: 14px;
  }

  .session-number {
    width: 52px;
    height: 52px;
  }

  .add-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .driver-section,
  .basket {
    padding: 20px;
  }
}

@media (max-width: 600px) {
  .success-card {
    padding: 28px 18px;
  }
}

/* =====================================================
   CHAMPIONSHIP ENTRY CHECK
===================================================== */

.driver-check-intro {
  margin: 0 0 22px;

  color: #b8b8b8;

  font-size: 0.95rem;
  line-height: 1.6;
}

.driver-check-button {
  margin-top: 18px;
}

.entry-offer {
  margin-top: 22px;
}

.entry-offer h2 {
  margin-bottom: 18px;
}

.entry-offer p {
  max-width: 760px;

  color: #b8b8b8;

  line-height: 1.6;
}

.entry-payment-button {
  display: inline-flex;

  align-items: center;
  justify-content: center;

  width: auto;

  margin-top: 14px;

  padding-right: 28px;
  padding-left: 28px;

  text-decoration: none;
}

.entry-payment-note {
  margin-top: 20px;

  padding-top: 16px;

  border-top: 1px solid #2a2a2a;

  font-size: 0.85rem;
}

.entry-confirmed-banner {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 18px;

  margin-bottom: 22px;

  padding: 16px 18px;

  background: #101010;

  border: 1px solid #2a2a2a;
  border-left: 5px solid #7fc000;
}

.entry-confirmed-banner strong {
  color: #7fc000;

  font-family:
    "Kanit",
    Arial,
    Helvetica,
    sans-serif;

  font-size: 0.85rem;
  font-style: italic;
  font-weight: 900;

  letter-spacing: 0.08em;
}

.entry-confirmed-banner span {
  color: white;

  font-weight: 700;
}

#driverName:disabled,
#driverEmail:disabled {
  opacity: 1;

  color: white;

  background: #151515;

  border-color: #3a3a3a;

  cursor: not-allowed;
}

.hidden {
  display: none !important;
}

@media (max-width: 650px) {
  .entry-confirmed-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .entry-payment-button {
    width: 100%;
  }

  .driver-check-button {
    width: 100%;
  }
}