/* ────────────────────────────────────────────────────────────
   BBL Race Registration — Frontend Wizard
   Nautical / maritime aesthetic
   ──────────────────────────────────────────────────────────── */

/* Self-hosted fonts — required by WordPress.org Plugin Directory policy
   (no remote asset offloading). Both Sora and Fraunces are variable fonts. */
@font-face {
    font-family: 'Sora';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('../fonts/sora-variable.woff2') format('woff2-variations'),
         url('../fonts/sora-variable.woff2') format('woff2');
}
@font-face {
    font-family: 'Fraunces';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('../fonts/fraunces-variable.woff2') format('woff2-variations'),
         url('../fonts/fraunces-variable.woff2') format('woff2');
}

.bbl-race-wrap {
    --bbl-deep:    #0a2342;
    --bbl-navy:    #1a3a5c;
    --bbl-ocean:   #2e86ab;
    --bbl-sky:     #a8dadc;
    --bbl-foam:    #f1faee;
    --bbl-coral:   #e63946;
    --bbl-sand:    #f4a261;
    --bbl-gold:    #e9c46a;
    --bbl-mint:    #06d6a0;
    --bbl-line:    #e2e8f0;
    --bbl-text:    #1e293b;
    --bbl-muted:   #64748b;
    --bbl-radius:  14px;

    font-family: 'Sora', sans-serif;
    color: var(--bbl-text);
    max-width: 760px;
    margin: 0 auto;
    padding: 24px;
    position: relative;
}

.bbl-race-wrap * { box-sizing: border-box; }

/* ─── Decorative wave background ───────────────── */
.bbl-race-wrap::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 220px;
    background:
        radial-gradient(circle at 10% 20%, rgba(46,134,171,.08) 0%, transparent 50%),
        radial-gradient(circle at 90% 0%, hsla(224, 48%, 42%, 0.102) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* ─── Stepper ──────────────────────────────────── */
.bbl-race-stepper {
    display: flex;
    align-items: center;
    margin-bottom: 32px;
    gap: 0;
}
.bbl-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--bbl-muted);
    transition: color .25s;
    flex-shrink: 0;
}
.bbl-step-dot {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--bbl-line);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    transition: all .25s;
}
.bbl-step-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .03em;
}
.bbl-step-line {
    flex: 1;
    height: 2px;
    background: var(--bbl-line);
    margin: 0 -2px;
    margin-bottom: 22px; /* aligns with dot center */
    transition: background .25s;
}
.bbl-step.active { color: var(--bbl-deep); }
.bbl-step.active .bbl-step-dot {
    background: var(--bbl-deep);
    border-color: var(--bbl-deep);
    color: #fff;
    box-shadow: 0 4px 14px rgba(10,35,66,.3);
}
.bbl-step.done .bbl-step-dot {
    background: var(--bbl-mint);
    border-color: var(--bbl-mint);
    color: #fff;
}
.bbl-step.done .bbl-step-dot::before {
    content: '✓';
    font-size: 16px;
}
.bbl-step.done + .bbl-step-line { background: var(--bbl-mint); }

/* ─── Panels ────────────────────────────────────── */
.bbl-race-panel {
    display: none;
    background: #fff;
    border-radius: var(--bbl-radius);
    box-shadow:
        0 1px 3px rgba(10,35,66,.04),
        0 10px 30px rgba(10,35,66,.08);
    padding: 32px 36px;
    animation: bbl-fade-in .35s ease;
    border: 1px solid var(--bbl-line);
}
.bbl-race-panel.active { display: block; }
@keyframes bbl-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.bbl-panel-header { margin-bottom: 24px; }
.bbl-panel-header h2 {
    font-family: 'Fraunces', serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--bbl-deep);
    margin: 0 0 6px;
    line-height: 1.2;
    letter-spacing: -0.01em;
}
.bbl-panel-header p {
    margin: 0;
    color: var(--bbl-muted);
    font-size: 14px;
}

/* ─── Race type cards ──────────────────────────── */
.bbl-race-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 28px;
}
@media (max-width: 600px) {
    .bbl-race-grid { grid-template-columns: 1fr; }
}

.bbl-radio-card {
    cursor: pointer;
    position: relative;
}
.bbl-radio-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.bbl-radio-card-inner {
    border: 2px solid var(--bbl-line);
    border-radius: 12px;
    padding: 22px 16px 18px;
    text-align: center;
    transition: all .2s;
    background: #fff;
    height: 100%;
}
.bbl-radio-card:hover .bbl-radio-card-inner {
    border-color: var(--bbl-ocean);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(46,134,171,.15);
}
.bbl-radio-card input:checked + .bbl-radio-card-inner {
    border-color: var(--bbl-deep);
    background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
    box-shadow: 0 4px 14px rgba(10,35,66,.15);
}
.bbl-radio-card input:checked + .bbl-radio-card-inner::after {
    content: '✓';
    position: absolute;
    top: 10px; right: 12px;
    width: 22px; height: 22px;
    background: var(--bbl-mint);
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}
.bbl-radio-icon { font-size: 32px; margin-bottom: 8px; }
.bbl-radio-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--bbl-deep);
    margin-bottom: 4px;
}
.bbl-radio-desc {
    font-size: 12px;
    color: var(--bbl-muted);
    line-height: 1.4;
}

/* ─── Fields ───────────────────────────────────── */
.bbl-field { margin-bottom: 20px; }
.bbl-field--disabled { opacity: 0.55; pointer-events: none; }
.bbl-field--disabled .bbl-counter-btn { cursor: not-allowed; }
/* "Add-on" field (party fee / extras) — visual breathing room from the surrounding fields. */
.bbl-field.bbl-addon {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px dashed var(--bbl-line);
}
.bbl-field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}
@media (max-width: 540px) {
    .bbl-field-grid { grid-template-columns: 1fr; }
}

.bbl-field label,
.bbl-field > label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--bbl-deep);
    margin-bottom: 7px;
}
.bbl-field .req { color: var(--bbl-coral); }
.bbl-field input[type="text"],
.bbl-field input[type="email"],
.bbl-field input[type="number"],
.bbl-field textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--bbl-line);
    border-radius: 9px;
    font-family: 'Sora', sans-serif;
    font-size: 14px;
    color: var(--bbl-text);
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.bbl-field input:focus,
.bbl-field textarea:focus {
    outline: none;
    border-color: var(--bbl-ocean);
    box-shadow: 0 0 0 3px rgba(46,134,171,.15);
}
.bbl-help {
    font-size: 12px;
    color: var(--bbl-muted);
    margin: 7px 0 0;
    line-height: 1.5;
}

/* ─── Amount input ─────────────────────────────── */
.bbl-amount-input {
    position: relative;
    display: flex;
    align-items: center;
}
.bbl-amount-prefix {
    position: absolute;
    left: 14px;
    font-weight: 700;
    color: var(--bbl-deep);
    font-size: 18px;
    font-family: 'Fraunces', serif;
}
.bbl-amount-input input {
    padding-left: 30px !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    font-family: 'Fraunces', serif !important;
}

/* ─── Radio list (class selection) ─────────────── */
.bbl-radio-list { display: flex; flex-direction: column; gap: 12px; }
.bbl-radio-row {
    position: relative;
    display: flex !important;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    border: 1.5px solid var(--bbl-line);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color .15s, background-color .15s, box-shadow .15s, transform .15s;
    background: #fff;
}
.bbl-radio-row:hover {
    border-color: var(--bbl-ocean);
    background: #f8fcfd;
    box-shadow: 0 2px 8px rgba(10, 35, 66, 0.05);
}
.bbl-radio-row input { position: absolute; opacity: 0; pointer-events: none; }
.bbl-radio-check {
    width: 22px; height: 22px;
    display: block;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
    background: #fff;
    transition: border-color .18s ease, background-color .18s ease, transform .18s ease, box-shadow .18s ease;
    margin-top: 1px;
}
.bbl-radio-row:hover .bbl-radio-check {
    border-color: var(--bbl-ocean);
    background: #f0f9ff;
}
.bbl-radio-check::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    transform: translate(-50%, -50%) scale(0.4) rotate(-8deg);
    opacity: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='3.5 8.5 6.5 11.5 12.5 5'/></svg>");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    transition: opacity .18s ease, transform .22s cubic-bezier(.34, 1.56, .64, 1);
}
.bbl-radio-row input:checked ~ .bbl-radio-check {
    border-color: var(--bbl-deep);
    background: var(--bbl-deep);
    box-shadow: 0 4px 10px rgba(10, 35, 66, 0.18);
}
.bbl-radio-row input:checked ~ .bbl-radio-check::after {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0);
}
.bbl-radio-row:has(input:checked) {
    border-color: var(--bbl-deep);
    background: #f5f9fc;
    box-shadow: 0 0 0 3px rgba(10, 35, 66, 0.08);
}
.bbl-radio-row input:focus-visible ~ .bbl-radio-check {
    box-shadow: 0 0 0 3px rgba(46, 134, 171, 0.25);
}
.bbl-radio-row > span:last-child {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.bbl-radio-row strong {
    font-weight: 600;
    font-size: 15px;
    color: var(--bbl-text);
    line-height: 1.3;
}
.bbl-radio-row input:checked ~ span:last-child strong { color: var(--bbl-deep); }
.bbl-radio-row em {
    font-style: normal;
    font-weight: 500;
    font-size: 13px;
    color: var(--bbl-muted);
    line-height: 1.45;
}

/* ─── Checkbox row (party fee add-on) ─────────── */
.bbl-checkbox-row {
    display: flex !important;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    border: 1.5px solid var(--bbl-line);
    border-radius: 10px;
    cursor: pointer;
    transition: all .15s;
    background: linear-gradient(135deg, #fef3c7 0%, #fff7ed 100%);
    border-color: #fde68a;
}
.bbl-checkbox-row:hover { border-color: var(--bbl-gold); }
.bbl-checkbox-row input { display: none; }
.bbl-check-box {
    width: 22px; height: 22px;
    display: inline-block;
    background: #fff;
    border: 2px solid var(--bbl-line);
    border-radius: 5px;
    flex-shrink: 0;
    position: relative;
    transition: all .15s;
    margin-top: 1px;
}
.bbl-checkbox-row input:checked ~ .bbl-check-box {
    background: var(--bbl-mint);
    border-color: var(--bbl-mint);
}
.bbl-checkbox-row input:checked ~ .bbl-check-box::after {
    content: '✓';
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
}
.bbl-checkbox-row > span:last-child { flex: 1; }
.bbl-checkbox-row strong {
    display: block;
    font-size: 14px;
    color: var(--bbl-deep);
    margin-bottom: 4px;
}
.bbl-checkbox-row em {
    font-style: normal;
    font-size: 12px;
    color: var(--bbl-muted);
}

/* ─── Counter input ────────────────────────────── */
.bbl-counter {
    display: inline-flex;
    align-items: stretch;
    border: 1.5px solid var(--bbl-line);
    border-radius: 9px;
    overflow: hidden;
    width: 160px;
}
.bbl-counter-btn {
    width: 44px;
    background: #f8fafc;
    border: none;
    color: var(--bbl-deep);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
}
.bbl-counter-btn:hover { background: var(--bbl-sky); }
.bbl-counter input {
    flex: 1;
    border: none !important;
    text-align: center;
    border-radius: 0 !important;
    font-weight: 700 !important;
    font-size: 16px !important;
    border-left: 1px solid var(--bbl-line) !important;
    border-right: 1px solid var(--bbl-line) !important;
}
.bbl-counter input:focus { box-shadow: none !important; }
.bbl-counter input::-webkit-outer-spin-button,
.bbl-counter input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bbl-counter input { -moz-appearance: textfield; }

/* ─── Panel footer / buttons ───────────────────── */
.bbl-panel-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--bbl-line);
}

.bbl-btn-next,
.bbl-btn-back,
.bbl-btn-pay {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 9px;
    font-family: 'Sora', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    border: none;
}

.bbl-btn-next {
    background: linear-gradient(135deg, var(--bbl-deep), var(--bbl-ocean));
    color: #fff;
    box-shadow: 0 4px 14px rgba(10,35,66,.25);
}
.bbl-btn-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(10,35,66,.35);
}
.bbl-btn-next:disabled {
    opacity: .4;
    cursor: not-allowed;
    transform: none;
}

.bbl-btn-back {
    background: #f1f5f9;
    color: var(--bbl-deep);
}
.bbl-btn-back:hover { background: var(--bbl-sky); }

.bbl-btn-pay {
    background: linear-gradient(135deg, var(--bbl-mint) 0%, #059669 100%);
    color: #fff;
    box-shadow: 0 4px 18px rgba(6,214,160,.4);
    padding: 14px 28px;
    font-size: 15px;
}
.bbl-btn-pay:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(6,214,160,.5);
}
.bbl-btn-pay span { font-weight: 700; }

/* ─── Review card ──────────────────────────────── */
.bbl-review-card {
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
    border-radius: 12px;
    border: 1px solid var(--bbl-line);
    padding: 0;
    overflow: hidden;
}
.bbl-review-section {
    padding: 18px 22px;
    border-bottom: 1px solid var(--bbl-line);
}
.bbl-review-section:last-child { border-bottom: none; }
.bbl-review-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--bbl-muted);
    margin-bottom: 10px;
}
.bbl-review-line,
.bbl-review-charge-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 14px;
}
.bbl-review-line span:first-child,
.bbl-review-charge-line span:first-child {
    color: var(--bbl-muted);
}
.bbl-review-line span:last-child,
.bbl-review-charge-line span:last-child {
    font-weight: 600;
    color: var(--bbl-deep);
    text-align: right;
}
.bbl-review-charges { background: linear-gradient(135deg, #eff6ff 0%, #f0fdfa 100%); }

.bbl-review-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 14px;
    border-top: 2px dashed #cbd5e1;
}
.bbl-review-total span:first-child {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--bbl-deep);
}
.bbl-review-total span:last-child {
    font-family: 'Fraunces', serif;
    font-size: 30px;
    font-weight: 700;
    color: var(--bbl-deep);
    line-height: 1;
}

.bbl-secure-banner {
    margin-top: 18px;
    padding: 10px 16px;
    background: #f1f5f9;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--bbl-muted);
}
.bbl-secure-banner svg { color: var(--bbl-mint); }

/* ─── Field validation ─────────────────────────── */
.bbl-field.error input,
.bbl-field.error textarea { border-color: var(--bbl-coral); background: #fef2f2; }
.bbl-field-error {
    display: block;
    color: var(--bbl-coral);
    font-size: 12px;
    margin-top: 6px;
    font-weight: 500;
}

/* ─── Loading state ────────────────────────────── */
.bbl-btn-pay.loading {
    pointer-events: none;
    opacity: .8;
}
.bbl-btn-pay.loading::after {
    content: '';
    width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: bbl-spin .7s linear infinite;
    margin-left: 4px;
}
@keyframes bbl-spin { to { transform: rotate(360deg); } }
