@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700;800&display=swap');

:root {
    --bg-1: #ffc333;
    --bg-2: #fff1bf;
    --ink: #0f172a;
    --muted: #475569;
    --card: #ffffff;
    --brand: #ffc107;
    --brand-dark: #f96d00;
    --accent: #0ea5e9;
    --line: #e2e8f0;
    --radius-lg: 20px;
    --radius-md: 12px;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    color: var(--ink);
    background-color: var(--bg-1);
    min-height: 100vh;
}

.page-wrap {
    width: min(980px, 92%);
    margin: 2.5rem auto;
}

.form-card {
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 50px rgba(15, 23, 42, 0.15);
    overflow: hidden;
}

.form-header {
    padding: 2rem 2rem 1rem;
    background: linear-gradient(120deg, #fff4cc, #ffd86b);
    border-bottom: 1px solid var(--line);
}

.tag {
    display: inline-block;
    margin: 0;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    font-weight: 800;
    color: var(--brand-dark);
}

.form-header h1 {
    margin: 0.5rem 0;
    font-size: clamp(1.6rem, 2.8vw, 2.2rem);
}

.form-header p {
    margin: 0;
    color: var(--muted);
}

/* Autosave indicator — sits below the description line with clear breathing room */
.autosave-notice {
    display: inline-block;
    margin-top: 0.65rem !important;
    margin-bottom: 0 !important;
    font-size: 0.78rem;
    color: #65a30d;
    font-weight: 600;
}

.registration-form {
    padding: 1.5rem 2rem 2rem;
}

.registration-instructions {
    margin: 0 0 1.1rem;
    padding: 1rem 1.05rem;
    border: 1px solid #fde68a;
    border-left: 4px solid #f59e0b;
    border-radius: var(--radius-md);
    background: linear-gradient(120deg, #fffbeb, #fef3c7);
    box-shadow: 0 8px 16px rgba(124, 45, 18, 0.08);
}

.registration-instructions h2 {
    margin: 0 0 0.55rem;
    font-size: 1rem;
    color: #7c2d12;
    letter-spacing: 0.01em;
}

.registration-instructions ol {
    list-style: none;
    counter-reset: instruction-count;
    display: grid;
    gap: 0.45rem;
    margin: 0;
    padding: 0;
    color: #334155;
    font-size: 0.9rem;
    line-height: 1.6;
}

.registration-instructions li {
    position: relative;
    padding: 0.5rem 0.65rem 0.5rem 2.15rem;
    border: 1px solid #fde9a9;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.65);
}

.registration-instructions li::before {
    counter-increment: instruction-count;
    content: counter(instruction-count);
    position: absolute;
    left: 0.55rem;
    top: 0.48rem;
    width: 1.2rem;
    height: 1.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 800;
    color: #7c2d12;
    background: #fde68a;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.field-full {
    grid-column: 1 / -1;
}

label {
    font-size: 0.9rem;
    font-weight: 700;
}

.file-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 0.4rem;
}

input,
select {
    width: 100%;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--ink);
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="file"] {
    padding: 0.6rem 0.5rem;
    cursor: pointer;
}

.phone-input-wrap {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fff;
    overflow: hidden;
}

.country-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 0.75rem 0.85rem;
    font-weight: 700;
    color: var(--ink);
    background: #fff8e5;
    border-right: 1px solid var(--line);
}

.phone-input-wrap input {
    border: 0;
    border-radius: 0;
}

.phone-input-wrap:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.phone-input-wrap input:focus {
    box-shadow: none;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

/* ====== Sport selection error message ====== */
.sport-error {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-left: 4px solid #ef4444;
    border-radius: var(--radius-md);
    color: #b91c1c;
    font-size: 0.9rem;
    font-weight: 700;
}

.event-block {
    margin-top: 1.4rem;
}

.event-block h2 {
    margin: 0 0 0.65rem;
    font-size: 1.05rem;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.checkbox-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #0f172a;
    border-radius: 999px;
    padding: 0.55rem 0.95rem;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: transform 0.15s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.checkbox-button:hover {
    transform: translateY(-1px);
    border-color: var(--brand);
}

.checkbox-button input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-button.checked {
    background: linear-gradient(120deg, #f59e0b, #facc15);
    border-color: #b45309;
    color: #111827;
}

.payment-block {
    margin-top: 1.4rem;
    padding: 1rem;
    border: 1px solid #fde68a;
    background: linear-gradient(120deg, #fffbeb, #fef3c7);
    border-radius: var(--radius-md);
}

.payment-block h2 {
    margin: 0;
    font-size: 1.05rem;
}

.payment-note {
    margin: 0.35rem 0 0.7rem;
    color: #92400e;
    font-size: 0.9rem;
    font-weight: 600;
}

.payment-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.payment-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: 999px;
    background: linear-gradient(120deg, #f59e0b, #facc15);
    border: 1px solid #b45309;
    color: #111827;
    font-size: 0.86rem;
    font-weight: 700;
}

.payment-empty {
    font-size: 0.88rem;
    color: var(--muted);
    font-weight: 600;
}

.payment-selected {
    display: inline-flex;
    align-items: center;
    padding: 0.48rem 0.75rem;
    border-radius: 999px;
    border: 1px solid #fcd34d;
    background: #fffdf4;
    color: #334155;
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.3;
}

.coach-toggle-field {
    margin-top: 0.2rem;
}

.coach-toggle {
    display: inline-flex;
    border: 1px solid var(--line);
    border-radius: 999px;
    overflow: hidden;
    width: fit-content;
    background: #fff;
}

.coach-option {
    margin: 0;
    cursor: pointer;
}

.coach-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.coach-option span {
    display: inline-block;
    min-width: 78px;
    text-align: center;
    padding: 0.55rem 0.9rem;
    font-size: 0.88rem;
    font-weight: 700;
    color: #334155;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.coach-option input:checked + span {
    background: linear-gradient(120deg, #f59e0b, #facc15);
    color: #111827;
}

.coach-details {
    margin-top: 0.25rem;
    padding: 0.85rem;
    border: 1px dashed #f59e0b;
    border-radius: var(--radius-md);
    background: #fffaf0;
    display: grid;
    gap: 0.8rem;
}

.coach-details[hidden] {
    display: none !important;
}

.qr-panel {
    margin-top: 1rem;
    border-top: 1px dashed #f59e0b;
    padding-top: 0.9rem;
    text-align: center;
}

.qr-panel h3 {
    margin: 0 0 0.6rem;
    font-size: 0.98rem;
    color: #7c2d12;
}

.payment-qr {
    width: 220px;
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    border: 1px solid #fbbf24;
    background: #fff;
    padding: 0.4rem;
}

.upi-note {
    margin: 0.55rem 0 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: #111827;
}

.payment-screenshot-field {
    margin-top: 1rem;
}

.team-role-field {
    margin-top: 1rem;
}

#teamRoleField {
    padding-top: 0.35rem;
}

/* ====== Submit button: normal + loading state ====== */
.submit-btn {
    width: 100%;
    margin-top: 1.7rem;
    border: none;
    border-radius: 14px;
    padding: 0.9rem 1.2rem;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #111827;
    background: linear-gradient(120deg, #f59e0b, #fde047);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 12px 20px rgba(245, 158, 11, 0.35);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.receipt-lookup-link {
    display: inline-block;
    width: 100%;
    margin-top: 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    padding: 0.82rem 1rem;
    text-align: center;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 800;
    color: #0f172a;
    background: #ffffff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.receipt-lookup-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.12);
    text-decoration: none;
}

@media (max-width: 760px) {
    .page-wrap {
        width: min(980px, 94%);
        margin: 1.2rem auto;
    }

    .form-header,
    .registration-form {
        padding: 1.1rem;
    }

    .field-grid {
        grid-template-columns: 1fr;
    }

    .field-full {
        grid-column: auto;
    }

    .registration-instructions {
        padding: 0.85rem;
    }

    .registration-instructions h2 {
        font-size: 0.96rem;
    }

    .registration-instructions ol {
        font-size: 0.86rem;
        gap: 0.4rem;
    }

    .registration-instructions li {
        padding: 0.48rem 0.58rem 0.48rem 2rem;
    }

    .registration-instructions li::before {
        left: 0.5rem;
        top: 0.45rem;
        width: 1.15rem;
        height: 1.15rem;
    }

    .coach-toggle {
        display: flex;
        width: 100%;
    }

    .coach-option {
        flex: 1;
    }

    .coach-option span {
        width: 100%;
        min-width: 0;
        padding: 0.6rem 0.55rem;
    }

    .payment-tags {
        gap: 0.45rem;
    }

    .payment-chip,
    .payment-empty {
        white-space: normal;
        line-height: 1.4;
    }

    .receipt-lookup-link {
        padding: 0.78rem 0.85rem;
    }
}