/*
 * doritos-contest.css
 * Self-contained styles for the Doritos Keycodes Contest.
 * Fully independent of the Drupal active theme — owns <html>, <body>, all layout.
 *
 * BEM naming: .dkc-[block]__[element]--[modifier]
 */

/* ═══════════════════════════════════════════════════════════════
   Reset / Base
   ═══════════════════════════════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body.doritos-kc {
  font-family: 'Arial', 'Helvetica Neue', Helvetica, sans-serif;
  background-color: #1a1a1a;  /* TODO: Replace with Doritos brand BG */
  color: #ffffff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: underline; }
a:hover { opacity: 0.85; }

/* ═══════════════════════════════════════════════════════════════
   Header
   ═══════════════════════════════════════════════════════════════ */
.dkc-header {
  background-color: #e63000;  /* Doritos red — adjust to brand spec */
  padding: 1rem 0;
}

.dkc-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.dkc-header__logo-img {
  height: 50px;
  width: auto;
}

.dkc-header__nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.dkc-header__nav a {
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dkc-header__lang-toggle a {
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  border: 2px solid currentColor;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  text-decoration: none;
}

/* ═══════════════════════════════════════════════════════════════
   Main
   ═══════════════════════════════════════════════════════════════ */
.dkc-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ═══════════════════════════════════════════════════════════════
   Footer
   ═══════════════════════════════════════════════════════════════ */
.dkc-footer {
  background-color: #111;
  padding: 2rem 0;
  margin-top: auto;
}

.dkc-footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.dkc-footer__links ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.dkc-footer__legal {
  font-size: 0.75rem;
  color: #999;
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════════
   Shared Form Elements
   ═══════════════════════════════════════════════════════════════ */
.dkc-form__group {
  margin-bottom: 1.25rem;
}

.dkc-form__fieldset {
  border: none;
  padding: 0;
  margin: 0 0 1.25rem;
}

.dkc-form__legend {
  font-size: 0.875rem;
  font-weight: 600;
  color: #f0f0f0;
  margin-bottom: 0.6rem;
  display: block;
  width: 100%;
}

/* Three DOB dropdowns side-by-side */
.dkc-form__dob-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1.5fr;
  gap: 0.75rem;
}

.dkc-form__select--dob {
  width: 100%;
}

@media (max-width: 400px) {
  .dkc-form__dob-row {
    grid-template-columns: 1fr;
  }
}

.dkc-form__label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: #f0f0f0;
}

.dkc-form__label--sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.dkc-form__input,
.dkc-form__select {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  background: #2a2a2a;
  color: #fff;
  border: 2px solid #555;
  border-radius: 6px;
  transition: border-color 0.2s ease;
  appearance: none;
}

.dkc-form__input:focus,
.dkc-form__select:focus {
  outline: 3px solid #e63000;
  outline-offset: 2px;
  border-color: #e63000;
}

/* Invalid state — applied by JS validation (inputs and selects) */
.dkc-form__select--invalid,
.dkc-form__input--invalid {
  border-color: #e53e3e !important;
  outline: 2px solid #e53e3e;
  outline-offset: 2px;
}

/* Optional label helper */
.dkc-form__label--optional {
  font-weight: 400;
  font-size: 0.8rem;
  color: #aaa;
  margin-left: 0.25rem;
}

/* City / Province / Postal code row — 3 columns */
.dkc-form__row--address {
  grid-template-columns: 2fr 1.5fr 1fr;
}

@media (max-width: 600px) {
  .dkc-form__row--address {
    grid-template-columns: 1fr;
  }
}

/* Inline field-level error message */
.dkc-field-error {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: #fc8181;
  font-weight: 500;
}

.dkc-form__input--code {
  font-size: 1.5rem;
  text-align: center;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  resize: vertical;
}

.dkc-form__counter {
  font-size: 0.875rem;
  color: #999;
  text-align: right;
  margin-top: 0.25rem;
}

.dkc-form__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0 1.5rem;
}

/* ═══════════════════════════════════════════════════════════════
   Buttons
   ═══════════════════════════════════════════════════════════════ */
.dkc-btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.dkc-btn:active { transform: scale(0.98); }

.dkc-btn--primary {
  background-color: #e63000;
  color: #fff;
}

.dkc-btn--primary:hover {
  background-color: #c42800;
}

.dkc-btn--large {
  padding: 1rem 3rem;
  font-size: 1.2rem;
}

/* ═══════════════════════════════════════════════════════════════
   Age Consent
   ═══════════════════════════════════════════════════════════════ */
.dkc-ageconsent {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 3rem 1.5rem;
}

.dkc-ageconsent__inner {
  background: #222;
  border-radius: 12px;
  padding: 2.5rem;
  max-width: 540px;
  width: 100%;
}

.dkc-ageconsent__title {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.dkc-ageconsent__error {
  background: #6b1a1a;
  border-left: 4px solid #e63000;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}

/* ═══════════════════════════════════════════════════════════════
   Contest / Game
   ═══════════════════════════════════════════════════════════════ */
.dkc-contest {
  flex: 1;
}

.dkc-game__inner {
  max-width: 700px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.dkc-game__title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  text-align: center;
}

.dkc-game__intro {
  text-align: center;
  margin-bottom: 2rem;
  color: #ccc;
}

.dkc-game__code-form {
  text-align: center;
}

.dkc-game__error {
  background: #6b1a1a;
  border-left: 4px solid #e63000;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  margin-top: 1rem;
  font-size: 0.9rem;
  text-align: left;
}

.dkc-game__winner-announcement {
  text-align: center;
  padding: 2rem 0;
}

.dkc-game__winner-title {
  font-size: 2rem;
  color: #ffd700;
  margin-bottom: 1rem;
}

.dkc-game__prize-display {
  margin: 1.5rem 0;
}

.dkc-game__profile-title {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  border-top: 1px solid #444;
  padding-top: 1.5rem;
}

.dkc-game__plays-remaining {
  font-size: 0.85rem;
  color: #aaa;
  margin: 0.5rem 0 1rem;
}

.dkc-game__phase { display: none; }
.dkc-game__phase[hidden] { display: none !important; }
.dkc-game__phase:not([hidden]) { display: block; }

/* ═══════════════════════════════════════════════════════════════
   Coming Soon / Closed
   ═══════════════════════════════════════════════════════════════ */
.dkc-comingsoon,
.dkc-closed {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  text-align: center;
  padding: 4rem 1.5rem;
}

.dkc-comingsoon__title,
.dkc-closed__title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.dkc-comingsoon__message,
.dkc-closed__message {
  color: #ccc;
  font-size: 1.1rem;
}

/* ═══════════════════════════════════════════════════════════════
   FAQ
   ═══════════════════════════════════════════════════════════════ */
.dkc-faq__inner,
.dkc-rules__inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 7rem 1.5rem;
}

.dkc-faq__title,
.dkc-rules__title {
  font-size: 2rem;
  margin-bottom: 2rem;
}

/* ═══════════════════════════════════════════════════════════════
   Official Rules
   ═══════════════════════════════════════════════════════════════ */
.dkc-rules__inner {
  max-width: 800px;
}

.dkc-rules__title {
  font-family: 'DrukWide', sans-serif;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 900;
  text-transform: uppercase;
  color: #fff;
  line-height: 1.1;
  letter-spacing: 0.02em;
  margin-bottom: 2rem;
}


.dkc-rules__content p,
.dkc-rules__content li {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.75;
  margin: 0 0 0.85rem;
}

.dkc-rules__content p:last-child {
  margin-bottom: 0;
}

.dkc-rules__content strong {
  color: #fff;
  font-weight: 700;
}

.dkc-rules__list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0.85rem;
}

.dkc-rules__list li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 0.5rem;
}

.dkc-rules__list li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: #ED1C24;
  font-weight: 700;
}

.dkc-rules__link {
  color: #ED1C24;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.dkc-rules__link:hover {
  color: #fff;
}

/* Prize table */
.dkc-rules__table-wrap {
  overflow-x: auto;
  margin: 1rem 0;
}

.dkc-rules__table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
}

.dkc-rules__table th {
  background: #ED1C24;
  color: #fff;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.6rem 0.85rem;
  text-align: left;
  white-space: nowrap;
}

.dkc-rules__table td {
  padding: 0.55rem 0.85rem;
  color: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  vertical-align: top;
}

.dkc-rules__table tbody tr:nth-child(odd) td {
  background: rgba(255, 255, 255, 0.03);
}

.dkc-rules__table tbody tr:last-child td {
  border-bottom: none;
}

.dkc-faq__item {
  border-bottom: 1px solid #333;
  padding: 1rem 0;
}

.dkc-faq__question {
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 600;
  list-style: none;
  padding-right: 2rem;
  position: relative;
}

.dkc-faq__question::after {
  content: '+';
  position: absolute;
  right: 0;
  font-size: 1.4rem;
  line-height: 1;
}

details[open] .dkc-faq__question::after { content: '−'; }

.dkc-faq__answer {
  padding: 0.75rem 0 0;
  color: #ccc;
  line-height: 1.7;
}

/* ═══════════════════════════════════════════════════════════════
   Report
   ═══════════════════════════════════════════════════════════════ */
.dkc-report__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.dkc-report__filter {
  margin-bottom: 1.5rem;
  display: flex;
  gap: 0.75rem;
}

.dkc-report__filter a {
  padding: 0.4rem 1rem;
  border: 1px solid #555;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.875rem;
}

.dkc-report__filter a.active {
  background: #e63000;
  border-color: #e63000;
}

.dkc-report__section-title {
  font-size: 1.25rem;
  margin: 2rem 0 1rem;
}

.dkc-report__table-wrapper {
  overflow-x: auto;
}

.dkc-report__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.dkc-report__table th,
.dkc-report__table td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #333;
}

.dkc-report__table th {
  background: #2a2a2a;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.dkc-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.dkc-badge--redeemed   { background: #1a6b1a; color: #fff; }
.dkc-badge--available  { background: #1a3a6b; color: #fff; }
.dkc-badge--separated  { background: #6b6b1a; color: #fff; }

.dkc-report__token {
  font-family: monospace;
  font-size: 0.8rem;
  color: #999;
}

/* ═══════════════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .dkc-header__inner {
    flex-wrap: wrap;
  }

  .dkc-header__nav ul {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .dkc-game__title {
    font-size: 1.75rem;
  }

  .dkc-form__input--code {
    font-size: 1.2rem;
  }
}
