/* Reusable pieces: buttons, tags, fields, section headings, overlays.
 * Numbers are the mockup's (fig-spec); states the mockup does not draw
 * (hover, focus, active, disabled, error) are added in its own palette. */

/* ── buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 16px 32px;
  border: 0; border-radius: 0;
  background: transparent; color: inherit;
  font-family: var(--font-body); font-weight: 800; font-size: 14px; line-height: 18px; text-transform: uppercase;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.btn--brand { background: var(--color-brand); color: var(--color-ink); }
.btn--brand:hover { background: var(--color-brand-hover); }
.btn--brand:active { background: var(--color-brand-active); }

.btn--purple { background: var(--color-purple-btn); color: var(--color-text); }
.btn--purple:hover { background: var(--color-purple-btn-hover); }
.btn--purple:active { background: var(--color-purple-btn-active); }

.btn--outline { box-shadow: inset 0 0 0 1px var(--color-ink-2); color: var(--color-text); font-weight: 700; }
.btn--outline:hover { background: var(--color-surface-2); box-shadow: inset 0 0 0 1px var(--color-muted-2); }
.btn--outline:focus-visible { box-shadow: inset 0 0 0 1px var(--color-muted-2), var(--focus-ring); }

.btn--outline-white { box-shadow: inset 0 0 0 1px var(--color-text); color: var(--color-text); }
.btn--outline-white:hover { background: rgba(255, 255, 255, .08); }
.btn--outline-white:focus-visible { box-shadow: inset 0 0 0 1px var(--color-text), var(--focus-ring); }

.btn--ghost { box-shadow: inset 0 0 0 1px var(--color-border); color: var(--color-muted); }
.btn--ghost:hover { color: var(--color-text); background: var(--color-surface-2); }

.btn--sm { padding: 10px 16px; font-size: 12px; line-height: 16px; }
.btn--block { width: 100%; }
.btn--busy { position: relative; color: transparent !important; pointer-events: none; }
.btn--busy::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  color: var(--color-ink); animation: spin .7s linear infinite;
}
.btn--purple.btn--busy::after, .btn--outline.btn--busy::after { color: var(--color-text); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Text links with an arrow, everywhere in the mockup ("View all AFL →") */
.link { font-weight: 700; font-size: 13px; line-height: 17px; color: var(--color-brand); text-decoration: none; }
.link:hover { text-decoration: underline; }
.link--purple { color: var(--color-purple-light); }

/* ── tags / pills ─────────────────────────────────────────────────────── */
.tag {
  display: inline-flex; align-items: center; padding: 2px 6px; border-radius: var(--radius-xs);
  font-weight: 800; font-size: 11px; line-height: 14px; text-transform: uppercase; white-space: nowrap;
}
.tag--brand { background: var(--color-brand); color: var(--color-ink); }
.tag--red { background: var(--color-red); color: var(--color-text); }
.tag--purple { background: var(--color-purple); color: var(--color-text); }
.tag--light { background: var(--color-card-3); color: var(--color-ink); }
.tag--outline { box-shadow: inset 0 0 0 1px var(--color-border); color: var(--color-muted); }

/* Eyebrow + heading pairs used by every section header */
.eyebrow { font-weight: 800; font-size: 13px; line-height: 17px; text-transform: uppercase; color: var(--color-brand); }
.h-section { font-family: var(--font-display); font-size: 28px; line-height: 30px; text-transform: uppercase; color: var(--color-text); }
.h-card { font-family: var(--font-display); font-size: 14px; line-height: 15px; text-transform: uppercase; color: var(--color-text); }
.lead { font-size: 14px; line-height: 18px; color: var(--color-muted); }

/* ── fields (light modal surfaces and dark page forms) ────────────────── */
.field { display: grid; gap: 6px; }
.field__label { font-weight: 800; font-size: 11px; line-height: 14px; text-transform: uppercase; color: var(--color-ink-2); }
.field__label .req { color: var(--color-purple-light); }
.field__control { position: relative; }
.field input:not(.visually-hidden):not([type="checkbox"]):not([type="radio"]), .field select, .field textarea {
  width: 100%; min-height: 44px; padding: 12px 14px;
  border: 1px solid var(--color-border-input); border-radius: var(--radius-sm);
  background: var(--color-card); color: var(--color-ink);
  font-size: 15px; line-height: 20px;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.field input::placeholder, .field textarea::placeholder { color: var(--color-muted); }   /* mockup #9ca3af — kept (F3) */
.field textarea { min-height: 120px; resize: vertical; }
.field select { appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--color-purple-btn); box-shadow: var(--focus-ring-light); outline: none; }
.field__hint { font-size: 12px; line-height: 16px; color: var(--color-ink-3); }
.field__error { font-weight: 700; font-size: 12px; line-height: 16px; color: var(--color-red); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--color-red); }

.field--check { grid-template-columns: auto 1fr; align-items: start; gap: 10px; }
.field--check .field__label { display: inline; font-weight: 400; font-size: 13px; line-height: 18px; text-transform: none; color: var(--color-ink-2); }
.field--check input[type="checkbox"] {
  width: 18px; height: 18px; margin: 0; flex: none; appearance: none; cursor: pointer;
  border: 1px solid var(--color-border-input); border-radius: var(--radius-xs); background: var(--color-card);
  display: grid; place-content: center;
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.field--check input[type="checkbox"]::before { content: ""; width: 10px; height: 10px; clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%); background: var(--color-ink); transform: scale(0); transition: transform var(--dur-fast) var(--ease); }
.field--check input[type="checkbox"]:checked { background: var(--color-brand); border-color: var(--color-brand); }
.field--check input[type="checkbox"]:checked::before { transform: scale(1); }
.field--check input[type="checkbox"]:focus-visible { outline: none; box-shadow: var(--focus-ring-light); }

/* Dark variant for forms on page surfaces (contact form, deposit limits) */
.form--dark .field__label { color: var(--color-muted-2); }
.form--dark .field input:not(.visually-hidden):not([type="checkbox"]):not([type="radio"]), .form--dark .field select, .form--dark .field textarea {
  border-color: var(--color-border-2); background: var(--color-surface-2); color: var(--color-text);
}
.form--dark .field input::placeholder, .form--dark .field textarea::placeholder { color: var(--color-muted-3); }
.form--dark .field input:focus, .form--dark .field select:focus, .form--dark .field textarea:focus { border-color: var(--color-brand); box-shadow: var(--focus-ring); }
.form--dark .field--check .field__label { color: var(--color-muted); }
.form--dark .field--check input[type="checkbox"] { background: var(--color-surface-2); border-color: var(--color-border-2); }

.form__error { font-weight: 700; font-size: 13px; line-height: 18px; color: var(--color-red); }
.form__success { font-weight: 700; font-size: 13px; line-height: 18px; color: var(--color-green); }
.form__note {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px;
  border: 1px solid var(--color-border-light); border-radius: var(--radius-sm); background: var(--color-card-2);
  font-size: 13px; line-height: 18px; color: var(--color-ink-2);
}
.form__note--ok { border-color: var(--color-green); }
.form__note--err { border-color: var(--color-red); }
.form__note--dark { background: var(--color-surface-2); border-color: var(--color-border-2); color: var(--color-muted); }

/* ── overlays (modals) ────────────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; z-index: var(--z-modal);
  display: grid; place-items: center;
  padding: 16px; overflow: auto;
  background: rgba(17, 17, 17, .941);                       /* login backdrop from the mockup */
  opacity: 0;
  transition: opacity var(--dur-slow) var(--ease);
}
.overlay.is-open { opacity: 1; }
.overlay__panel {
  position: relative;
  width: min(100%, 660px);
  max-height: calc(100vh - 32px); overflow: auto;
  background: var(--color-card-2);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-modal);
  transform: translateY(8px);
  transition: transform var(--dur-slow) var(--ease);
}
.overlay.is-open .overlay__panel { transform: none; }

/* Icons inherit colour and take their size from CSS. */
.icon { width: 1em; height: 1em; fill: none; stroke: currentColor; flex: none; }
.icon--missing { display: inline-block; width: 1em; height: 1em; outline: 1px dashed var(--color-red); }

/* Live regions / toasts */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: var(--z-modal); transform: translate(-50%, 12px);
  padding: 12px 16px; border-radius: var(--radius-sm); background: var(--color-surface-2); color: var(--color-text);
  box-shadow: var(--shadow-sheet); font-weight: 700; font-size: 13px; line-height: 18px;
  opacity: 0; transition: opacity var(--dur-base) var(--ease), transform var(--dur-base) var(--ease);
  pointer-events: none; max-width: calc(100vw - 32px);
}
.toast.is-in { opacity: 1; transform: translate(-50%, 0); }

/* ── pills (sport quick-select, market filters) ───────────────────────── */
.pill {
  display: inline-flex; align-items: center; justify-content: center; padding: 10px 16px;
  border: 0; border-radius: 0; background: none; cursor: pointer; white-space: nowrap; text-decoration: none;
  font-weight: 700; font-size: 13px; line-height: 17px; text-transform: uppercase; color: var(--color-card-3);
  box-shadow: inset 0 0 0 1px var(--color-ink-2);
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.pill:hover { background: var(--color-surface-2); color: var(--color-text); }
.pill.is-active { background: var(--color-brand); color: var(--color-ink); box-shadow: none; }
.pill--hot.is-active { background: var(--color-red); color: var(--color-text); }
.pill--dark.is-active { background: var(--color-surface-2); color: var(--color-text); }
.pill--purple.is-active { background: var(--color-purple-btn); color: var(--color-text); }
.pill--muted { color: var(--color-muted); }
.pill:focus-visible { outline: none; box-shadow: inset 0 0 0 1px var(--color-ink-2), var(--focus-ring); }

/* ── market row (event-card) ──────────────────────────────────────────── */
.markets { display: flex; flex-direction: column; gap: 16px; }
.market { display: flex; flex-direction: column; background: var(--color-card-2); box-shadow: inset 0 0 0 1px var(--color-border-light); }
.market__cat { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; padding: 12px; background: var(--color-surface); }
.market__cat-title { display: flex; align-items: center; gap: 8px; }
.market__sport { font-family: var(--font-display); font-size: 14px; line-height: 15px; text-transform: uppercase; color: var(--color-text); }
.market__region { font-size: 12px; line-height: 16px; color: var(--color-muted); }
.market__viewall { font-weight: 700; font-size: 12px; line-height: 16px; color: var(--color-purple-light); text-decoration: none; white-space: nowrap; }
.market__viewall:hover { text-decoration: underline; }
.market__body { display: flex; align-items: center; gap: 20px; min-height: 96px; padding: 16px; }
.market__info { display: flex; flex-direction: column; gap: 4px; flex: 0 0 240px; }
.market__when { font-weight: 700; font-size: 12px; line-height: 16px; color: var(--color-muted-2); }
.market__teams { display: flex; flex-direction: column; font-weight: 800; font-size: 15px; line-height: 20px; color: var(--color-ink); }
.market__type--desk { display: flex; flex-direction: column; gap: 2px; flex: 0 0 120px; }
.market__type--mob { display: none; }
.market__type-label { font-weight: 700; font-size: 10px; line-height: 13px; text-transform: uppercase; color: var(--color-muted-2); }
.market__type-name { font-weight: 600; font-size: 13px; line-height: 17px; color: var(--color-ink); }
.market__odds { display: flex; gap: 8px; flex: 1; min-width: 0; }
.market__more { flex: 0 0 110px; text-align: right; font-weight: 700; font-size: 13px; line-height: 17px; color: var(--color-ink); text-decoration: none; }
.market__more:hover { text-decoration: underline; }

.odd {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex: 1; min-width: 0; min-height: 41px; padding: 12px;
  border: 0; border-radius: 0; background: var(--color-card); box-shadow: inset 0 0 0 1px var(--color-border-light); cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.odd--r { border-radius: var(--radius-sm); }              /* sports / racing frames round the price buttons */
.odd:hover { background: var(--color-card-3); }
.odd:active { transform: scale(.98); }
.odd:focus-visible { outline: none; box-shadow: inset 0 0 0 1px var(--color-border-light), var(--focus-ring-light); }
.odd__name { font-weight: 700; font-size: 12px; line-height: 16px; text-transform: uppercase; color: var(--color-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.odd__price { font-family: var(--font-mono); font-weight: 900; font-size: 13px; line-height: 17px; color: var(--color-red); }   /* mockup red on white, kept as drawn (F3) */
.odd[aria-pressed="true"] { background: var(--color-brand); box-shadow: inset 0 0 0 1px var(--color-brand); }
.odd[aria-pressed="true"] .odd__name { font-weight: 800; }
.odd[aria-pressed="true"] .odd__price { color: var(--color-ink); }
.odd.is-flash { animation: odd-flash var(--dur-slow) var(--ease); }
@keyframes odd-flash { from { transform: scale(1.04); } to { transform: none; } }
.market--3way .odd { padding: 12px 6px; gap: 4px; }
.markets__empty { padding: 24px; background: var(--color-surface); box-shadow: inset 0 0 0 1px var(--color-border); font-size: 14px; line-height: 20px; color: var(--color-muted); }

/* ── bet slip ─────────────────────────────────────────────────────────── */
.betslip { display: flex; flex-direction: column; gap: 20px; padding: 20px; background: var(--color-surface); box-shadow: inset 0 0 0 1px var(--color-border); }
.betslip__head { display: flex; align-items: center; justify-content: space-between; height: 22px; }
.betslip__title { font-family: var(--font-display); font-size: 18px; line-height: 20px; text-transform: uppercase; color: var(--color-text); }
.betslip__count { display: inline-block; padding: 4px 8px; background: var(--color-red); color: var(--color-text); font-family: var(--font-mono); font-weight: 900; font-size: 11px; line-height: 14px; text-transform: uppercase; white-space: nowrap; }
.betslip__count.is-zero { background: var(--color-surface-2); color: var(--color-muted); }
.betslip__list { display: flex; flex-direction: column; gap: 12px; }
.betslip__list:empty { display: none; }
.pick { display: flex; flex-direction: column; gap: 12px; padding: 16px; background: var(--color-surface-2); box-shadow: inset 0 0 0 1px var(--color-ink-2); }
.pick__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 17px; }
.pick__sport { display: inline-flex; padding: 2px 6px; background: #fee2e2; color: var(--color-red); font-weight: 800; font-size: 10px; line-height: 13px; text-transform: uppercase; }   /* one-off tint from the mockup */
.pick__event { flex: 1; font-size: 12px; line-height: 16px; color: var(--color-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick__remove { border: 0; background: none; padding: 0; cursor: pointer; font-weight: 700; font-size: 12px; line-height: 16px; color: var(--color-red); position: relative; }
.pick__remove::after { content: ""; position: absolute; inset: -6px -4px; }
.pick__remove:hover { text-decoration: underline; }
.betslip__line { height: 1px; margin: 0 0 -1px; border: 0; background: var(--color-border); }   /* Figma LINE: 1px paint, 0 in flow */
.pick__bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; }
.pick__desc { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pick__market { font-size: 11px; line-height: 14px; color: var(--color-muted); }
.pick__name { font-weight: 800; font-size: 15px; line-height: 20px; color: var(--color-text); }
.pick__odds { font-family: var(--font-mono); font-weight: 900; font-size: 16px; line-height: 21px; color: var(--color-brand); }
.betslip__empty { font-size: 12px; line-height: 16px; color: var(--color-muted); }
.betslip__form { display: flex; flex-direction: column; gap: 20px; }
.stake { display: flex; flex-direction: column; gap: 8px; }
.stake__label { font-weight: 800; font-size: 11px; line-height: 14px; text-transform: uppercase; color: var(--color-muted); }
.stake__input { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; padding: 0 14px; background: var(--color-bg); box-shadow: inset 0 0 0 1px var(--color-ink-2); transition: box-shadow var(--dur-fast) var(--ease); }
.stake__input:focus-within { box-shadow: inset 0 0 0 1px var(--color-brand); }
.stake__currency, .stake__field { font-family: var(--font-mono); font-weight: 900; font-size: 15px; line-height: 20px; }
.stake__currency { color: var(--color-brand); }
.stake__field { flex: 1; min-width: 0; padding: 14px 0; border: 0; background: none; color: var(--color-text); text-align: right; outline: none; }
.betslip__return { display: flex; align-items: center; justify-content: space-between; min-height: 23px; }
.betslip__return-label { font-weight: 700; font-size: 12px; line-height: 16px; text-transform: uppercase; color: var(--color-muted); }
.betslip__type { margin-top: -8px; font-size: 11px; line-height: 14px; color: var(--color-muted); }   /* multi / singles summary under the return */
.betslip__return-value { font-family: var(--font-mono); font-weight: 900; font-size: 18px; line-height: 23px; color: var(--color-green); }
.betslip__place {
  display: flex; align-items: center; justify-content: center; min-height: 47px; padding: 16px; border: 0; cursor: pointer;
  background: var(--color-brand); color: var(--color-ink);
  font-family: var(--font-display); font-size: 14px; line-height: 15px; text-transform: uppercase;
  transition: background-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.betslip__place:hover { background: var(--color-brand-hover); }
.betslip__place:active { transform: translateY(1px); }
.betslip__place:disabled { opacity: .5; cursor: not-allowed; }
.betslip__place:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.betslip__note { padding: 12px 14px; background: var(--color-surface-2); box-shadow: inset 0 0 0 1px var(--color-border-2); font-size: 12px; line-height: 16px; color: var(--color-muted); }
.betslip__note--ok { box-shadow: inset 0 0 0 1px var(--color-green); color: var(--color-text); }
.betslip__note--err { box-shadow: inset 0 0 0 1px var(--color-red); color: var(--color-text); }
.betslip__note strong { color: var(--color-brand); }
.betslip__compliance { display: flex; flex-direction: column; gap: 4px; font-size: 11px; line-height: 14px; color: var(--color-muted); }
.betslip__limit { font-weight: 700; color: var(--color-brand); text-decoration: none; align-self: flex-start; }
.betslip__limit:hover { text-decoration: underline; }

/* 1200–1439: the desktop row keeps its fixed columns, the prices drop to a second line */
@media (min-width: 1200px) and (max-width: 1439px) {
  .market__body { flex-wrap: wrap; row-gap: 12px; }
  .market__info { flex: 1 1 200px; }
  .market__odds { flex: 1 0 100%; order: 5; }
  .market__more { margin-left: auto; }
}

/* Mobile market row (390 frame): stacked, market label on the time row */
@media (max-width: 1199px) {
  .market__cat { min-height: 36px; padding: 10px; }
  .market__cat-title { gap: 6px; }
  .market__sport { font-size: 12px; line-height: 13px; }
  .market__region { font-size: 11px; line-height: 14px; }
  .market__viewall { color: var(--color-brand); }
  .market__body { flex-direction: column; align-items: stretch; gap: 12px; min-height: 0; padding: 14px; }
  .market__info { flex: none; display: grid; grid-template-columns: 1fr auto; gap: 12px 8px; }
  .market__when { grid-column: 1; grid-row: 1; }
  .market__type--mob { display: block; grid-column: 2; grid-row: 1; text-align: right; font-weight: 600; font-size: 11px; line-height: 14px; color: var(--color-muted-2); }
  .market__type--desk { display: none; }
  .market__teams { grid-column: 1 / -1; gap: 2px; font-size: 14px; line-height: 18px; }
  .market__odds { flex: none; }
  .market--3way .market__odds { flex-direction: column; gap: 6px; }
  .odd { min-height: 52px; padding: 10px; }
  .odd__name { font-size: 11px; line-height: 14px; }
  .odd[aria-pressed="true"] .odd__name { font-size: 12px; line-height: 16px; }
  .odd__price { font-size: 12px; line-height: 16px; }
  .market__more { flex: none; font-size: 12px; line-height: 16px; }
}

/* 320–359: two odds side by side leave ~69px for a team name — stack them like the 3-way row does */
@media (max-width: 389px) {
  .odd__name { letter-spacing: -.3px; }   /* «COLLINGWOOD» is 92px at 11px bold; the 360 slot is 89 */
}
@media (max-width: 359px) {
  .market__odds, .srow__odds { flex-direction: column; gap: 6px; }
  .pick__event { white-space: normal; }
}
