/* TriAthy Transfer Forms — brand styling
 * Scoped to body.page-id-XXX isn't stable across environments;
 * instead we scope via a wrapper class we set via body_class filter
 * on the two landing pages, plus a .triathy-tr-form class on the form.
 */

/* Brand constants (from memory):
 *  Navy:      #0F1A2E
 *  Yellow:    #FFE600
 *  Race accents:
 *    TA-100:  #A855F7
 *    Olympic: #F59E0B
 *    Sprint:  #3B82F6
 *    Try:     #22C55E
 */

body.triathy-tr-page {
  /* base page adjustments — ensure enough vertical rhythm */
}

/* ---------- Page header region ---------- */
body.triathy-tr-page .elementor-widget-heading h1.elementor-heading-title {
  color: #FFFFFF !important;
  font-family: 'industry', 'Industry', 'Helvetica Neue', Arial, sans-serif !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border-bottom: 3px solid #FFE600;
  padding-bottom: 14px;
  margin-bottom: 24px;
  display: inline-block;
}

body.triathy-tr-page .elementor-widget-text-editor {
  color: #E5E9F0;
}

body.triathy-tr-page .elementor-widget-text-editor h3 {
  color: #FFE600 !important;
  font-family: 'industry', 'Industry', 'Helvetica Neue', Arial, sans-serif !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 1.05rem !important;
  margin: 28px 0 12px !important;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 230, 0, 0.25);
}

body.triathy-tr-page .elementor-widget-text-editor h3:first-of-type {
  border-top: none;
  padding-top: 0;
}

body.triathy-tr-page .elementor-widget-text-editor p,
body.triathy-tr-page .elementor-widget-text-editor li {
  color: #D3DAE6;
  line-height: 1.6;
}

body.triathy-tr-page .elementor-widget-text-editor strong {
  color: #FFE600;
}

body.triathy-tr-page .elementor-widget-text-editor a {
  color: #FFE600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- Form styling ---------- */
body.triathy-tr-page .elementor-form {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 230, 0, 0.2);
  border-radius: 8px;
  padding: 28px 26px 22px;
  margin-top: 8px;
}

body.triathy-tr-page .elementor-form .elementor-field-label {
  color: #FFE600 !important;
  font-family: 'industry', 'Industry', 'Helvetica Neue', Arial, sans-serif !important;
  font-weight: 600 !important;
  font-size: 0.85rem !important;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px !important;
}

body.triathy-tr-page .elementor-form .elementor-field-group {
  margin-bottom: 16px;
}

body.triathy-tr-page .elementor-form input[type="text"],
body.triathy-tr-page .elementor-form input[type="email"],
body.triathy-tr-page .elementor-form input[type="tel"],
body.triathy-tr-page .elementor-form select {
  background: #FFFFFF !important;
  color: #0F1A2E !important;
  border: 1px solid transparent !important;
  border-radius: 4px !important;
  padding: 12px 14px !important;
  font-size: 1rem !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}

body.triathy-tr-page .elementor-form input[type="text"]:focus,
body.triathy-tr-page .elementor-form input[type="email"]:focus,
body.triathy-tr-page .elementor-form input[type="tel"]:focus,
body.triathy-tr-page .elementor-form select:focus {
  border-color: #FFE600 !important;
  box-shadow: 0 0 0 3px rgba(255, 230, 0, 0.25) !important;
  outline: none !important;
}

body.triathy-tr-page .elementor-form input::placeholder {
  color: #8a96a8 !important;
}

/* ---------- Submit button ---------- */
body.triathy-tr-page .elementor-form button[type="submit"],
body.triathy-tr-page .elementor-form .elementor-button {
  background: #FFE600 !important;
  color: #0F1A2E !important;
  font-family: 'industry', 'Industry', 'Helvetica Neue', Arial, sans-serif !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.95rem !important;
  padding: 14px 20px !important;
  border: none !important;
  border-radius: 4px !important;
  transition: transform 0.1s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

body.triathy-tr-page .elementor-form button[type="submit"]:hover {
  box-shadow: 0 6px 18px rgba(255, 230, 0, 0.25);
  transform: translateY(-1px);
}

body.triathy-tr-page .elementor-form button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

/* ---------- Masked-name pre-confirmation ---------- */
.triathy-tr-ident-status {
  margin-top: -6px;
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: 4px;
  font-family: 'industry', 'Industry', 'Helvetica Neue', Arial, sans-serif !important;
  font-size: 0.9rem;
  display: none;
  animation: triathy-tr-fade 0.25s ease;
}

.triathy-tr-ident-status.is-checking {
  display: block;
  background: rgba(255, 255, 255, 0.06);
  color: #D3DAE6;
  border-left: 3px solid #D3DAE6;
}

.triathy-tr-ident-status.is-found {
  display: block;
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
  border-left: 3px solid #22C55E;
}

.triathy-tr-ident-status.is-missing {
  display: block;
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border-left: 3px solid #ef4444;
}

.triathy-tr-ident-status strong {
  color: #FFFFFF;
  font-weight: 700;
}

@keyframes triathy-tr-fade {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Loading overlay while submitting ---------- */
.triathy-tr-submitting-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 26, 46, 0.8);
  backdrop-filter: blur(2px);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  z-index: 10;
  animation: triathy-tr-fade 0.2s ease;
}

.triathy-tr-submitting-overlay .spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255, 230, 0, 0.25);
  border-top-color: #FFE600;
  border-radius: 50%;
  animation: triathy-tr-spin 0.9s linear infinite;
}

.triathy-tr-submitting-overlay .label {
  color: #FFE600;
  font-family: 'industry', 'Industry', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.9rem;
}

@keyframes triathy-tr-spin {
  to { transform: rotate(360deg); }
}

/* ---------- Success block ---------- */
.triathy-tr-success {
  background: linear-gradient(180deg, rgba(255, 230, 0, 0.08) 0%, rgba(15, 26, 46, 0) 60%),
              rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 230, 0, 0.3);
  border-radius: 10px;
  padding: 44px 32px 36px;
  text-align: center;
  animation: triathy-tr-success-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.triathy-tr-success::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #FFE600 0%, #FFE600 50%, transparent 100%);
}

.triathy-tr-success-check {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #22C55E;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  animation: triathy-tr-check-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both;
}

.triathy-tr-success-check svg {
  width: 36px;
  height: 36px;
  stroke: #FFFFFF;
  stroke-width: 3.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: triathy-tr-check-draw 0.4s ease-out 0.35s forwards;
}

.triathy-tr-success h2 {
  color: #FFFFFF !important;
  font-family: 'industry', 'Industry', 'Helvetica Neue', Arial, sans-serif !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 1.8rem !important;
  margin: 0 0 8px !important;
}

.triathy-tr-success .triathy-tr-success-tag {
  color: #FFE600;
  font-family: 'industry', 'Industry', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  margin-bottom: 16px;
}

.triathy-tr-success p {
  color: #D3DAE6;
  font-size: 1.02rem;
  line-height: 1.6;
  max-width: 520px;
  margin: 0 auto 20px;
}

.triathy-tr-success .triathy-tr-ref {
  display: inline-block;
  margin: 6px 0 22px;
  padding: 10px 18px;
  background: #0F1A2E;
  border: 1px solid rgba(255, 230, 0, 0.4);
  border-radius: 4px;
  font-family: 'industry', 'Industry', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: #FFE600;
  font-size: 1.05rem;
}

.triathy-tr-success .triathy-tr-ref-label {
  display: block;
  color: #8a96a8;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

/* ---------- Switch visualisation (race pills) ---------- */
.triathy-tr-switch {
  margin: 18px auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.triathy-tr-switch-pill {
  padding: 8px 16px;
  border-radius: 999px;
  font-family: 'industry', 'Industry', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.8rem;
  background: #0F1A2E;
  color: #FFFFFF;
  border: 2px solid;
}

.triathy-tr-switch-pill.race-ta-100 { border-color: #A855F7; color: #D8B4FE; }
.triathy-tr-switch-pill.race-olympic { border-color: #F59E0B; color: #FDE68A; }
.triathy-tr-switch-pill.race-sprint { border-color: #3B82F6; color: #93C5FD; }
.triathy-tr-switch-pill.race-try { border-color: #22C55E; color: #86EFAC; }

.triathy-tr-switch-pill.is-target {
  background: #FFE600;
  color: #0F1A2E;
  border-color: #FFE600;
  animation: triathy-tr-target-pulse 1.2s ease-out 0.6s both;
}

.triathy-tr-switch-arrow {
  color: #FFE600;
  font-size: 1.4rem;
  animation: triathy-tr-arrow-slide 0.6s ease-out 0.3s both;
}

/* Person-to-person glyph for RTR */
.triathy-tr-switch-person {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #0F1A2E;
  border: 2px solid #FFE600;
  color: #FFE600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'industry', 'Industry', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
}

.triathy-tr-switch-person.is-transferee {
  background: #FFE600;
  color: #0F1A2E;
  animation: triathy-tr-target-pulse 1.2s ease-out 0.6s both;
}

.triathy-tr-success-next {
  margin: 20px auto 0;
  max-width: 540px;
  padding: 16px 22px;
  background: rgba(59, 130, 246, 0.08);
  border-left: 3px solid #3B82F6;
  border-radius: 4px;
  text-align: left;
}

.triathy-tr-success-next strong {
  color: #FFFFFF;
  display: block;
  margin-bottom: 4px;
  font-family: 'industry', 'Industry', 'Helvetica Neue', Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.85rem;
}

.triathy-tr-success-next p {
  color: #D3DAE6;
  margin: 0;
  font-size: 0.95rem;
}

.triathy-tr-success-footer {
  margin-top: 26px;
  color: #8a96a8;
  font-size: 0.85rem;
}

.triathy-tr-success-footer a {
  color: #FFE600;
  text-decoration: underline;
}

@keyframes triathy-tr-success-in {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes triathy-tr-check-pop {
  0% { transform: scale(0); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

@keyframes triathy-tr-check-draw {
  to { stroke-dashoffset: 0; }
}

@keyframes triathy-tr-arrow-slide {
  from { transform: translateX(-12px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

@keyframes triathy-tr-target-pulse {
  0%   { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 230, 0, 0.7); }
  60%  { transform: scale(1.08); box-shadow: 0 0 0 12px rgba(255, 230, 0, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 230, 0, 0); }
}

/* ---------- Mobile adjustments ---------- */
@media (max-width: 640px) {
  body.triathy-tr-page .elementor-widget-heading h1.elementor-heading-title {
    font-size: 1.6rem !important;
  }
  body.triathy-tr-page .elementor-form {
    padding: 20px 16px 18px;
  }
  .triathy-tr-success {
    padding: 32px 20px 28px;
  }
  .triathy-tr-success h2 {
    font-size: 1.4rem !important;
  }
  .triathy-tr-switch {
    gap: 8px;
  }
  .triathy-tr-switch-pill {
    font-size: 0.75rem;
    padding: 6px 12px;
  }
}

/* Section headers inside form HTML blocks (RTR) */
body.triathy-tr-page .elementor-form .elementor-field-type-html h3 {
  color: #FFE600 !important;
  font-family: 'industry', 'Industry', 'Helvetica Neue', Arial, sans-serif !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 1rem !important;
  margin: 18px 0 10px !important;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 230, 0, 0.2);
}
body.triathy-tr-page .elementor-form .elementor-field-type-html:first-child h3 {
  border-top: none;
  padding-top: 0;
  margin-top: 0 !important;
}

/* ---------- Site-wide Industry font on transfer pages ---------- */
/* Applies Industry to body copy, lists, links — everywhere that doesn't
 * have an explicit font rule upstream. Paragraphs get a slight
 * letter-spacing tone-down so Industry reads well at body-copy size. */
body.triathy-tr-page,
body.triathy-tr-page p,
body.triathy-tr-page li,
body.triathy-tr-page span,
body.triathy-tr-page a,
body.triathy-tr-page em,
body.triathy-tr-page strong,
body.triathy-tr-page div:not(.triathy-tr-ref),
body.triathy-tr-page .elementor-widget-text-editor {
  font-family: 'industry', 'Industry', 'Helvetica Neue', Arial, sans-serif !important;
}

body.triathy-tr-page .elementor-widget-text-editor p,
body.triathy-tr-page .elementor-widget-text-editor li {
  letter-spacing: 0.005em;
}

/* Keep the site header/nav using whatever the theme declares —
 * only the page content gets the Industry override. */
body.triathy-tr-page header,
body.triathy-tr-page header *,
body.triathy-tr-page footer#colophon,
body.triathy-tr-page footer#colophon *,
body.triathy-tr-page nav.elementor-nav-menu--main,
body.triathy-tr-page nav.elementor-nav-menu--main * {
  font-family: inherit !important;
}

/* ---------- Target race availability badge (CRC) ---------- */
.triathy-tr-avail-badge {
  margin-top: -6px;
  margin-bottom: 14px;
  padding: 10px 14px;
  border-radius: 4px;
  font-family: 'industry', 'Industry', 'Helvetica Neue', Arial, sans-serif !important;
  font-size: 0.88rem;
  display: none;
  animation: triathy-tr-fade 0.25s ease;
}
.triathy-tr-avail-badge strong { color: #FFFFFF; font-weight: 700; }
.triathy-tr-avail-badge.is-checking {
  display: block;
  background: rgba(255, 255, 255, 0.06);
  color: #D3DAE6;
  border-left: 3px solid #D3DAE6;
}
.triathy-tr-avail-badge.is-open {
  display: block;
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
  border-left: 3px solid #22C55E;
}
.triathy-tr-avail-badge.is-low {
  display: block;
  background: rgba(245, 158, 11, 0.12);
  color: #fcd34d;
  border-left: 3px solid #F59E0B;
}
.triathy-tr-avail-badge.is-full {
  display: block;
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border-left: 3px solid #ef4444;
}

/* ---------- Identity banner — secondary line (RTR original entry fee) ---------- */
/* Renders below the primary "We've found your registration" line on RTR
 * only, when the entrant has an original_gross_revenue value on file.
 * Subtler typographic treatment so the primary confirmation stays dominant. */
.triathy-tr-ident-status .triathy-tr-ident-status-secondary {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
  color: #D3DAE6;
  line-height: 1.45;
}
.triathy-tr-ident-status .triathy-tr-ident-status-secondary strong {
  color: #FFE600;
  font-weight: 700;
}

/* ---------- RTR success: settlement card ---------- */
/* Yellow-accented panel that sits below the blue "What happens next" block
 * on RTR success only. Visually distinct from the blue panel above, picks
 * up the brand yellow as a settlement signal. */
.triathy-tr-settlement {
  margin: 16px auto 0;
  max-width: 540px;
  padding: 18px 22px 16px;
  background: rgba(255, 230, 0, 0.10);
  border: 1px solid rgba(255, 230, 0, 0.45);
  border-left: 4px solid #FFE600;
  border-radius: 4px;
  text-align: left;
  animation: triathy-tr-fade 0.35s ease 0.1s both;
}

.triathy-tr-settlement-tag {
  color: #FFE600;
  font-family: 'industry', 'Industry', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  margin-bottom: 10px;
}

.triathy-tr-settlement-amount {
  color: #FFFFFF;
  font-family: 'industry', 'Industry', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.35;
  margin-bottom: 6px;
}

.triathy-tr-settlement-amount strong {
  color: #FFE600;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.triathy-tr-settlement-comp {
  color: #D3DAE6;
  font-size: 0.92rem;
  line-height: 1.55;
  margin-bottom: 10px;
}

.triathy-tr-settlement-note {
  color: #B5BEC9;
  font-size: 0.88rem;
  line-height: 1.55;
}

@media (max-width: 640px) {
  .triathy-tr-settlement {
    padding: 14px 16px 14px;
  }
  .triathy-tr-settlement-amount {
    font-size: 0.98rem;
  }
}
