/* HYDROMAN COMPONENTS
* Loaded after w3.css and base.css. W3.CSS classes (w3-input, w3-select,
* w3-btn, w3-radio) provide the foundation; these rules match the Figma design.
* Keep vendor w3.css unchanged. Put shared visual changes in this file.
*/
/* Text inputs, select triggers and validation messages. */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  width: 100%;
}

.field-label {
  color: var(--accent);
  font: 700 14px/14px var(--heading-font);
  letter-spacing: -.025em;
  text-transform: uppercase;
}

.text-input, .select-trigger, .native-select {
  width: 100%;
  height: 52px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--field-background);
  color: var(--muted);
  font: 500 14px/21px var(--body-font);
  transition: border-color var(--motion), color var(--motion);
}

.text-input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.text-input:focus, .select-trigger[aria-expanded="true"], .native-select:focus {
  outline: none;
  border-color: var(--accent);
  color: var(--accent);
}

.text-input:focus::placeholder {
  color: var(--accent);
}

.text-input:user-invalid {
  box-shadow: none;
}

.text-input:-webkit-autofill {
  -webkit-text-fill-color: var(--white);
  -webkit-box-shadow: 0 0 0 1000px #242835 inset;
  caret-color: var(--accent);
}

.field.is-invalid .text-input, .field.is-invalid .select-trigger, .field.is-invalid .native-select {
  border-color: var(--error);
}

.field.is-invalid .text-input:focus, .field.is-invalid .select-trigger:focus-visible {
  outline-color: var(--error);
}

.field-error, .group-error {
  color: var(--error);
  font: 500 14px/21px var(--body-font);
}

.field-error:empty, .group-error:empty {
  display: none;
}

.native-select {
  appearance: none;
  padding-right: 36px;
  background: url("../assets/icons/chevron-small.svg") right 16px center / 12px 12px no-repeat, var(--field-background);
}

.native-select option {
  background: var(--ink);
  color: var(--white);
}

.select {
  position: relative;
  min-width: 0;
}

.select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
}

.select-trigger > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-chevron {
  display: flex;
  flex: 0 0 24px;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  transition: transform var(--motion);
}

.select-chevron--small {
  flex-basis: 12px;
  width: 12px;
  height: 12px;
}

.select-trigger[aria-expanded="true"] .select-chevron {
  transform: rotate(180deg);
}

.select-options {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 248px;
  overflow-y: auto;
  margin: 0;
  padding: 4px;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--ink);
  box-shadow: 0 8px 24px rgb(0 0 0 / 32%);
  scrollbar-width: thin;
}

.select-option {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 2px;
  color: var(--muted);
  font: 500 14px/21px var(--body-font);
  cursor: pointer;
}

.select-option.is-highlighted, .select-option[aria-selected="true"] {
  background: var(--field-background);
  color: var(--accent);
}

/* Single-choice cards. Native radio inputs handle grouping and keyboard input. */
.radio-option {
  position: relative;
  min-width: 0;
}

.radio-input {
  position: absolute;
  z-index: 1;
  top: 24px;
  left: 24px;
  width: 18px;
  height: 32px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.radio-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  min-height: 80px;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--field-background);
  color: var(--white);
  cursor: pointer;
  transition: background-color var(--motion), color var(--motion);
}

.radio-mark {
  display: flex;
  flex: 0 0 18px;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 32px;
}

.radio-mark .radio-mark-active {
  display: none;
}

.radio-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.radio-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
}

.radio-label {
  font: 700 24px/24px var(--heading-font);
  letter-spacing: -.025em;
  text-transform: uppercase;
  white-space: nowrap;
}

.tag {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  height: 24px;
  padding: 0 4px;
  border-radius: 2px;
  background: var(--accent);
  color: #000;
  font: 600 10px/10px var(--body-font);
  letter-spacing: -.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.radio-option:has(> .radio-input:checked) > .radio-card {
  background: var(--accent);
  color: var(--ink);
}

.radio-input:checked + .radio-card .radio-mark-idle {
  display: none;
}

.radio-input:checked + .radio-card .radio-mark-active {
  display: block;
}

.radio-input:checked + .radio-card .tag {
  background: var(--ink);
  color: var(--white);
}

.radio-input:focus-visible + .radio-card {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.radio-input:checked:focus-visible + .radio-card {
  outline-color: var(--white);
}

.radio-input:disabled + .radio-card {
  opacity: .45;
  cursor: not-allowed;
}

.radio-input[aria-invalid="true"] + .radio-card {
  box-shadow: inset 0 0 0 1px var(--error);
}

.radio-option--other .club-detail {
  margin-top: -4px;
  padding: 0 24px 24px 54px;
  border-radius: 0 0 4px 4px;
  background: var(--accent);
}

.radio-option--other:has(> .radio-input:checked) .radio-card {
  border-radius: 4px 4px 0 0;
}

.club-detail .field-label {
  color: var(--ink);
}

.club-detail .text-input {
  background: var(--ink);
}

.club-detail .field-error {
  color: #7c122a;
}

.action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  height: 54px;
  padding: 4px 4px 4px 16px;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: #000;
  font: 700 18px/18px var(--heading-font);
  letter-spacing: -.02em;
  text-align: left;
  text-transform: uppercase;
}

.action-icon {
  display: flex;
  flex: 0 0 46px;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 2px;
  background: var(--ink);
}

.action:active {
  transform: translateY(1px);
}

.action:disabled {
  opacity: .45;
}

.icon-button {
  display: inline-flex;
  flex: 0 0 44px;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--white);
}

.icon-button--accent {
  border-color: transparent;
  background: var(--accent);
  color: var(--ink);
}

.language-switch {
  display: flex;
  gap: 4px;
  height: 44px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 2px;
}

.language-switch button {
  min-width: 40px;
  padding: 0 8px;
  border: 0;
  border-radius: 1px;
  background: none;
  font: 700 16px/16px var(--heading-font);
}

.language-switch [aria-pressed="true"] {
  background: var(--accent);
  color: var(--ink);
}

.site-header {
  position: fixed;
  z-index: 30;
  top: 8px;
  right: 8px;
  left: 8px;
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  padding: 8px 8px 8px 12px;
  border-radius: var(--radius);
  background: linear-gradient(rgb(0 0 0 / 60%), rgb(0 0 0 / 40%));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.race-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
}


.site-footer {
  padding: 64px 24px;
  background: var(--footer);
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 64px;
  max-width: 392px;
  margin: 0 auto;
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  row-gap: 64px;
}

.footer-heading {
  font: 700 24px/24px var(--heading-font);
  letter-spacing: -.025em;
  text-transform: uppercase;
}

.footer-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  margin-top: 32px;
}

.footer-links .text-link {
  line-height: 16px;
}

@media (width < 768px) {
  .footer-links .footer-terms-break { display: none; }
}

.footer-contact {
  grid-column: 1 / -1;
}

.footer-contact address {
  display: flex;
  flex-direction: column;
  margin-top: 32px;
  font: 500 16px/24px var(--body-font);
  letter-spacing: -.01em;
  font-style: normal;
}

.footer-socials {
  display: flex;
  gap: 8px;
}

.footer-bottom {
  padding-top: 49px;
  background: url("../assets/icons/footer-divider.svg") left top / 100% 1px no-repeat;
}

.footer-wordmark {
  display: block;
  width: fit-content;
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: 700 52px/52px var(--heading-font);
  letter-spacing: -.03em;
  text-transform: uppercase;
}

.footer-copyright {
  display: block;
  margin-top: 8px;
  font: 500 12px/18px var(--body-font);
  text-align: center;
}

.notice {
  position: fixed;
  z-index: 50;
  right: 16px;
  bottom: 16px;
  left: 16px;
  width: fit-content;
  max-width: min(480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--ink);
  box-shadow: 0 8px 28px rgb(0 0 0 / 32%);
  color: var(--white);
  font: 500 14px/21px var(--body-font);
}

.notice:empty {
  display: none;
}

@media (hover: hover) {
  .text-input:hover, .text-input:hover::placeholder, .select-trigger:hover, .native-select:hover {
    color: var(--accent);
  }
  .radio-option:has(> .radio-input:not(:checked):not(:disabled)) > .radio-card:hover {
    box-shadow: inset 0 0 0 1px var(--accent);
  }
  .action:hover {
    background: #ffea4d;
    font-style: oblique;
  }
  .icon-button:hover {
    border-color: var(--accent);
    color: var(--accent);
  }
  .icon-button--accent:hover {
    background: #ffea4d;
  }
  .language-switch button:not([aria-pressed="true"]):hover {
    color: var(--accent);
  }
}

@media (min-width: 439px) and (max-width: 767.98px) {
  .site-footer {
    padding-bottom: 80px;
  }
}

@media (min-width: 768px) {
  .site-header {
    right: 32px;
    left: 32px;
  }
  .site-footer {
    padding: 64px 32px 80px;
  }
  .footer-inner {
    max-width: 600px;
  }
  .footer-top {
    /* Figma 913:5264: fixed link/contact columns, flexible space before the arrow. */
    grid-template-columns: 184px 184px minmax(0, 1fr);
    gap: 24px;
  }
  .footer-contact {
    grid-column: 2;
    grid-row: 1;
  }
  .footer-top > .icon-button {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }
}

@media (min-width: 1288px) {
  .field-label {
    font-size: 16px;
    line-height: 16px;
  }
  .text-input, .native-select, .select-trigger, .select-option {
    font-size: 16px;
    line-height: 24px;
  }
  .radio-label {
    font-size: 32px;
    line-height: 32px;
  }
  .tag {
    font-size: 12px;
    line-height: 12px;
  }
  .site-header {
    top: 32px;
    right: 160px;
    left: 160px;
  }
  .site-header-inner {
    min-height: 72px;
    padding: 12px 12px 12px 16px;
  }
  .site-footer {
    padding: 120px 32px 160px;
  }
  .footer-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 80px 24px;
    max-width: var(--content-width);
  }
  .footer-top {
    grid-column: 1 / -1;
    grid-template-columns: 184px minmax(184px, 1fr) 44px;
    column-gap: 24px;
  }
  .footer-heading {
    font-size: 32px;
    line-height: 32px;
  }
  .footer-links {
    margin-top: 24px;
  }
  .footer-contact address {
    margin-top: 24px;
    font-size: 18px;
    line-height: 27px;
  }
  .footer-bottom {
    grid-column: 1 / -1;
    grid-row: 2;
    padding-top: 41px;
  }
  .footer-wordmark {
    margin: 0;
    font-size: 120px;
    line-height: 120px;
  }
  .footer-copyright {
    text-align: left;
    font-size: 14px;
    line-height: 21px;
  }
  .footer-socials {
    z-index: 1;
    grid-column: 2;
    grid-row: 2;
    align-self: end;
    margin-bottom: 29px;
  }
}

/* Home/Race start desktop 8px before the unchanged Form component boundary. */
@media (min-width: 1280px) and (max-width: 1287.98px) {
  :where(.home-page, .race-page) .tag {
    font-size: 12px;
    line-height: 12px;
    }
  :where(.home-page, .race-page) .site-header {
    top: 32px;
    right: 160px;
    left: 160px;
    }
  :where(.home-page, .race-page) .site-header-inner {
    min-height: 72px;
    padding: 12px 12px 12px 16px;
    }
  :where(.home-page, .race-page) .site-footer {
    padding: 120px 32px 160px;
    }
  :where(.home-page, .race-page) .footer-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 80px 24px;
    max-width: var(--content-width);
    }
  :where(.home-page, .race-page, .terms-page) .footer-top {
    grid-column: 1 / -1;
    grid-template-columns: 184px minmax(184px, 1fr) 44px;
    column-gap: 24px;
    }
  :where(.home-page, .race-page) .footer-heading {
    font-size: 32px;
    line-height: 32px;
    }
  :where(.home-page, .race-page, .terms-page) .footer-links {
    margin-top: 24px;
  }
  :where(.home-page, .race-page) .footer-contact address {
    margin-top: 24px;
    font-size: 18px;
    line-height: 27px;
    }
  :where(.home-page, .race-page) .footer-bottom {
    grid-column: 1 / -1;
    grid-row: 2;
    padding-top: 41px;
    }
  :where(.home-page, .race-page) .footer-wordmark {
    margin: 0;
    font-size: 120px;
    line-height: 120px;
    }
  :where(.home-page, .race-page) .footer-copyright {
    text-align: left;
    font-size: 14px;
    line-height: 21px;
    }
  :where(.home-page, .race-page) .footer-socials {
    z-index: 1;
    grid-column: 2;
    grid-row: 2;
    align-self: end;
    margin-bottom: 29px;
    }
}

/* Closed registration is still a recognizable action but cannot be activated. */
.action.registration-closed { opacity: .55; cursor: default; pointer-events: none; }

/* The tablet design allows the organizer name to extend into the free arrow column. */
@media (min-width: 768px) and (max-width: 1279.98px) {
  .footer-contact address > span { white-space: nowrap; }
}
