:root {
    --primary: #16395f;
    --secondary: #245b91;
    --primary-dark: #0e2947;
    --accent-soft: #e9f2fb;
    --text: #1e2938;
    --muted: #617083;
    --border: #dce3eb;
    --surface: #ffffff;
    --background: #f4f7fa;
    --success: #1d7a4a;
    --warning: #a95d00;
    --closed: #7a3030;
    --shadow:
        0 18px 45px rgba(18, 42, 68, 0.11);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family:
        Inter,
        "Segoe UI",
        Arial,
        sans-serif;
}

a {
    color: inherit;
}

button,
input {
    font: inherit;
}

.public-header {
    background:
        radial-gradient(
            circle at top right,
            rgba(255, 255, 255, 0.18),
            transparent 34%
        ),
        linear-gradient(
            135deg,
            var(--primary-dark),
            var(--primary) 52%,
            var(--secondary)
        );
    color: white;
}

.public-navigation {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 22px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.public-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: white;
    text-decoration: none;
}

.public-brand-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

.public-brand span {
    display: grid;
    gap: 3px;
}

.public-brand strong {
    font-size: 1.08rem;
}

.public-brand small {
    color: rgba(255, 255, 255, 0.72);
}

.navigation-contact-link {
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
}

.hero-content {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 78px 0 90px;
    display: grid;
    grid-template-columns:
        minmax(0, 1.65fr)
        minmax(280px, 0.75fr);
    gap: 56px;
    align-items: end;
}

.eyebrow,
.section-label {
    margin: 0 0 10px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.eyebrow {
    color: rgba(255, 255, 255, 0.72);
}

.hero-copy h1 {
    max-width: 790px;
    margin: 0;
    font-size: clamp(3rem, 7vw, 5.7rem);
    line-height: 0.98;
    letter-spacing: -0.045em;
}

.hero-intro {
    max-width: 720px;
    margin: 24px 0 0;
    color: rgba(255, 255, 255, 0.86);
    font-size: 1.13rem;
    line-height: 1.72;
}

.hero-actions {
    margin-top: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.primary-public-button,
.secondary-public-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 20px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 800;
}

.primary-public-button {
    background: white;
    color: var(--primary);
}

.secondary-public-button {
    border: 1px solid rgba(255, 255, 255, 0.45);
    color: white;
}

.hero-highlight {
    padding: 28px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
}

.hero-highlight-label {
    margin: 0 0 10px;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hero-highlight strong {
    display: block;
    font-size: 1.35rem;
    line-height: 1.35;
}

.hero-highlight p:last-child {
    margin: 14px 0 0;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.6;
}

.public-main {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}

.league-section,
.how-it-works-section,
.contact-section {
    padding: 72px 0;
}

.section-heading {
    margin-bottom: 30px;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 30px;
}

.section-label {
    color: var(--secondary);
}

.section-heading h2,
.contact-section h2 {
    margin: 0;
    color: var(--primary);
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: -0.025em;
}

.section-heading p:not(.section-label),
.contact-section p {
    max-width: 680px;
    margin: 12px 0 0;
    color: var(--muted);
    line-height: 1.65;
}

.league-filter {
    width: min(360px, 100%);
}

.league-filter label {
    display: block;
    margin-bottom: 7px;
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 800;
}

.league-filter input {
    width: 100%;
    min-height: 46px;
    padding: 10px 13px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: white;
    color: var(--text);
}

.league-filter input:focus {
    outline: 3px solid rgba(36, 91, 145, 0.16);
    border-color: var(--secondary);
}

.public-status {
    margin-bottom: 18px;
    color: var(--muted);
    font-size: 0.92rem;
}

.public-status.error {
    color: var(--closed);
}

.league-grid {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.league-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 17px;
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.league-card-top {
    padding: 23px 23px 18px;
}

.league-card-heading {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 14px;
}

.league-card h3 {
    margin: 0;
    color: var(--primary);
    font-size: 1.35rem;
    line-height: 1.25;
}

.recruiting-status-badge {
    flex: 0 0 auto;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.25;
    text-align: center;
}

.recruiting-status-badge.recruiting-teams {
    background: #e5f6ed;
    color: var(--success);
}

.recruiting-status-badge.recruiting-individuals {
    background: #fff1d8;
    color: var(--warning);
}

.recruiting-status-badge.waiting-list {
    background: #e7efff;
    color: #2456a6;
}

.recruiting-status-badge.closed {
    background: #f8e8e8;
    color: var(--closed);
}

.league-schedule {
    margin: 9px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.league-details-grid {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.league-detail {
    min-width: 0;
}

.league-detail span {
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
}

.league-detail strong {
    color: var(--text);
    font-size: 0.95rem;
}

.recruitment-panel {
    margin-top: auto;
    padding: 20px 23px 23px;
    border-top: 1px solid var(--border);
    background: #f9fbfd;
}

.recruitment-heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.recruitment-heading span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.recruitment-heading strong {
    color: var(--primary);
}

.progress-track {
    height: 8px;
    margin-top: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #dde5ed;
}

.progress-bar {
    height: 100%;
    border-radius: inherit;
    background: var(--secondary);
}

.recruitment-message {
    margin: 12px 0 0;
    color: var(--text);
    line-height: 1.5;
}

.league-card.closed .recruitment-message {
    color: var(--closed);
}

.league-card.recruiting-teams {
    border-top: 4px solid var(--success);
}

.league-card.recruiting-individuals {
    border-top: 4px solid var(--warning);
}

.league-card.waiting-list {
    border-top: 4px solid #2456a6;
}

.league-card.closed {
    border-top: 4px solid var(--closed);
}

.league-action-button {
    width: 100%;
    min-height: 46px;
    margin-top: 18px;
    padding: 12px 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 10px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    font-weight: 800;
    text-align: center;
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        opacity 0.15s ease;
}

.league-action-button:hover {
    transform: translateY(-1px);
    box-shadow:
        0 8px 18px rgba(18, 42, 68, 0.16);
}

.league-action-button.waiting-list {
    background: #2456a6;
}

.league-action-button.disabled {
    background: #d8dee5;
    color: #6c7784;
    cursor: not-allowed;
    box-shadow: none;
}

.empty-public-card {
    grid-column: 1 / -1;
    padding: 40px;
    border: 1px dashed var(--border);
    border-radius: 15px;
    background: white;
    color: var(--muted);
    text-align: center;
}

.how-it-works-section {
    border-top: 1px solid var(--border);
}

.simple-heading {
    justify-content: start;
}

.steps-grid {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.step-card {
    padding: 25px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: white;
}

.step-card > span {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--primary);
    font-weight: 900;
}

.step-card h3 {
    margin: 18px 0 8px;
    color: var(--primary);
}

.step-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.contact-section {
    margin-bottom: 60px;
    padding-right: 38px;
    padding-left: 38px;
    display: grid;
    grid-template-columns:
        minmax(0, 1.4fr)
        minmax(280px, 0.7fr);
    gap: 50px;
    align-items: center;
    border-radius: 20px;
    background: var(--primary);
    color: white;
}

.contact-section .section-label,
.contact-section h2,
.contact-section p {
    color: white;
}

.contact-section p {
    opacity: 0.8;
}

.contact-card {
    display: grid;
    gap: 10px;
    padding: 23px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.1);
}

.contact-card a,
.contact-card p {
    margin: 0;
    color: white;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.public-footer {
    min-height: 70px;
    padding: 22px;
    display: flex;
    justify-content: center;
    gap: 8px;
    background: #e9eef3;
    color: var(--muted);
    font-size: 0.88rem;
}

.public-footer span + span::before {
    content: "·";
    margin-right: 8px;
}

@media (max-width: 980px) {
    .hero-content {
        grid-template-columns: 1fr;
    }

    .hero-highlight {
        max-width: 620px;
    }

    .league-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .public-navigation,
    .hero-content,
    .public-main {
        width: min(100% - 28px, 1180px);
    }

    .navigation-contact-link {
        display: none;
    }

    .hero-content {
        padding: 55px 0 68px;
    }

    .section-heading,
    .contact-section {
        grid-template-columns: 1fr;
        display: grid;
    }

    .league-filter {
        width: 100%;
    }

    .league-grid,
    .steps-grid {
        grid-template-columns: 1fr;
    }

    .contact-section {
        padding: 34px 24px;
    }
}

@media (max-width: 480px) {
    .hero-copy h1 {
        font-size: 3rem;
    }

    .hero-actions {
        display: grid;
    }

    .primary-public-button,
    .secondary-public-button {
        width: 100%;
    }

    .league-details-grid {
        grid-template-columns: 1fr;
    }

    .public-footer {
        display: grid;
        text-align: center;
    }

    .public-footer span + span::before {
        content: "";
        margin: 0;
    }
}


body.modal-open {
    overflow: hidden;
}

.league-card-actions {
    margin-top: 18px;
    display: grid;
    grid-template-columns:
        minmax(0, 0.78fr)
        minmax(0, 1.22fr);
    gap: 10px;
}

.league-card-actions .league-action-button {
    margin-top: 0;
}

.league-learn-more-button {
    min-height: 46px;
    padding: 12px 15px;
    border: 1px solid var(--primary);
    border-radius: 10px;
    background: white;
    color: var(--primary);
    font-weight: 800;
    cursor: pointer;
}

.league-learn-more-button:hover {
    background: var(--accent-soft);
}

.league-modal[hidden] {
    display: none;
}

.league-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 24px;
}

.league-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(9, 24, 40, 0.72);
    backdrop-filter: blur(3px);
}

.league-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(720px, 100%);
    max-height: min(88vh, 850px);
    overflow-y: auto;
    padding: 32px;
    border-radius: 20px;
    background: white;
    box-shadow:
        0 30px 80px rgba(6, 21, 37, 0.34);
}

.league-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: #eef2f6;
    color: var(--primary);
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
}

.league-modal-heading {
    padding-right: 48px;
}

.league-modal-heading h2 {
    margin: 0 0 14px;
    color: var(--primary);
    font-size: clamp(1.65rem, 4vw, 2.25rem);
}

.league-modal-details {
    margin-top: 26px;
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 13px;
}

.league-modal-detail {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #f9fbfd;
}

.league-modal-detail span {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
}

.league-modal-detail strong {
    color: var(--text);
}

.league-modal-description {
    margin-top: 26px;
}

.league-modal-description h3 {
    margin: 0 0 9px;
    color: var(--primary);
}

.league-modal-description p {
    margin: 0;
    color: var(--text);
    line-height: 1.7;
    white-space: pre-line;
}

.league-modal-recruitment {
    margin-top: 24px;
    padding: 17px;
    border-left: 4px solid var(--secondary);
    border-radius: 9px;
    background: var(--accent-soft);
}

.league-modal-recruitment strong {
    color: var(--primary);
}

.league-modal-recruitment p {
    margin: 6px 0 0;
    line-height: 1.55;
}

.league-modal-actions {
    margin-top: 26px;
    display: grid;
    grid-template-columns:
        minmax(0, 0.7fr)
        minmax(0, 1.3fr);
    gap: 11px;
}

.league-modal-actions .league-action-button {
    margin-top: 0;
}

.secondary-modal-button {
    min-height: 46px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: white;
    color: var(--primary);
    font-weight: 800;
    cursor: pointer;
}

@media (max-width: 620px) {
    .league-card-actions,
    .league-modal-actions {
        grid-template-columns: 1fr;
    }

    .league-modal {
        padding: 12px;
    }

    .league-modal-dialog {
        padding: 25px 19px;
        border-radius: 15px;
    }

    .league-modal-details {
        grid-template-columns: 1fr;
    }
}

/* Public registration page */
.registration-page {
    background:
        linear-gradient(
            180deg,
            #eef4f9 0,
            var(--background) 340px
        );
}

.registration-header {
    background:
        linear-gradient(
            135deg,
            var(--primary-dark),
            var(--primary),
            var(--secondary)
        );
    color: white;
}

.registration-main {
    width: min(1040px, calc(100% - 40px));
    margin: 0 auto;
    padding: 52px 0 80px;
}

.registration-introduction {
    margin-bottom: 26px;
}

.registration-back-link {
    display: inline-block;
    margin-bottom: 28px;
    color: var(--secondary);
    font-weight: 800;
    text-decoration: none;
}

.registration-introduction h1 {
    margin: 0;
    color: var(--primary);
    font-size: clamp(2.25rem, 6vw, 4rem);
    letter-spacing: -0.04em;
    line-height: 1.03;
}

.registration-introduction > p:last-child {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.65;
}

.registration-page-status {
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: white;
    color: var(--muted);
}

.registration-page-status.error {
    border-color: #e9caca;
    background: #fff8f8;
    color: var(--closed);
}

.registration-layout {
    display: grid;
    grid-template-columns:
        minmax(250px, 0.68fr)
        minmax(0, 1.55fr);
    gap: 24px;
    align-items: start;
}

.registration-league-summary,
.public-registration-form,
.registration-success {
    border: 1px solid var(--border);
    border-radius: 19px;
    background: white;
    box-shadow: var(--shadow);
}

.registration-league-summary {
    position: sticky;
    top: 24px;
    padding: 25px;
}

.summary-label {
    margin: 0 0 8px;
    color: var(--secondary);
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.registration-league-summary h2 {
    margin: 0;
    color: var(--primary);
    font-size: 1.55rem;
    line-height: 1.25;
}

.registration-summary-list {
    margin: 24px 0 0;
}

.registration-summary-list div {
    padding: 12px 0;
    border-top: 1px solid var(--border);
}

.registration-summary-list dt {
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 0.73rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.registration-summary-list dd {
    margin: 0;
    color: var(--text);
    font-weight: 800;
    line-height: 1.45;
}

.registration-summary-message {
    margin-top: 18px;
    padding: 14px;
    border-left: 4px solid var(--secondary);
    border-radius: 8px;
    background: var(--accent-soft);
    color: var(--primary);
    line-height: 1.55;
}

.public-registration-form {
    overflow: hidden;
}

.registration-section {
    margin: 0;
    padding: 30px;
    border: 0;
    border-bottom: 1px solid var(--border);
}

.registration-section legend {
    width: 100%;
    padding: 0;
    color: var(--primary);
    font-size: 1.35rem;
    font-weight: 900;
}

.registration-help {
    margin: 10px 0 20px;
    color: var(--muted);
    line-height: 1.6;
}

.emphasized-help {
    padding: 13px 15px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--primary);
}

.bowler-count-options {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 11px;
}

.bowler-count-option {
    min-width: 0;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: white;
    cursor: pointer;
}

.bowler-count-option:has(input:checked) {
    border-color: var(--secondary);
    background: var(--accent-soft);
    box-shadow: 0 0 0 2px rgba(36, 91, 145, 0.1);
}

.bowler-count-option input {
    width: 19px;
    height: 19px;
    flex: 0 0 auto;
    accent-color: var(--secondary);
}

.bowler-count-option-copy {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.bowler-count-option-copy strong {
    color: var(--primary);
}

.bowler-count-option-copy small {
    color: var(--muted);
    line-height: 1.35;
}

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

.registration-field label {
    display: block;
    margin-bottom: 7px;
    color: var(--primary);
    font-size: 0.84rem;
    font-weight: 800;
}

.registration-field label > span:not(.optional-label) {
    color: var(--closed);
}

.optional-label {
    margin-left: 5px;
    color: var(--muted);
    font-size: 0.73rem;
    font-weight: 700;
}

.registration-field input,
.registration-field textarea {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: white;
    color: var(--text);
    font: inherit;
}

.registration-field input {
    min-height: 48px;
}

.registration-field textarea {
    min-height: 150px;
    resize: vertical;
    line-height: 1.55;
}

.registration-field input:focus,
.registration-field textarea:focus {
    outline: 3px solid rgba(36, 91, 145, 0.14);
    border-color: var(--secondary);
}

.registration-form-message {
    margin: 24px 30px 0;
    line-height: 1.5;
}

.registration-form-message:empty {
    display: none;
}

.registration-form-message.error {
    padding: 13px 15px;
    border-radius: 9px;
    background: #fff0f0;
    color: var(--closed);
    font-weight: 700;
}

.registration-submit-button {
    width: calc(100% - 60px);
    min-height: 52px;
    margin: 24px 30px 0;
    padding: 13px 20px;
    border: 0;
    border-radius: 10px;
    background: var(--primary);
    color: white;
    font-weight: 900;
    cursor: pointer;
}

.registration-submit-button:hover {
    background: var(--primary-dark);
}

.registration-submit-button:disabled {
    opacity: 0.65;
    cursor: wait;
}

.registration-submit-note {
    margin: 13px 30px 28px;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.55;
    text-align: center;
}

.registration-honeypot {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.registration-success {
    max-width: 700px;
    margin: 20px auto 0;
    padding: 44px;
    text-align: center;
}

.registration-success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #e5f6ed;
    color: var(--success);
    font-size: 2rem;
    font-weight: 900;
}

.registration-success h2 {
    margin: 0;
    color: var(--primary);
    font-size: 2.4rem;
}

.registration-success p:not(.section-label) {
    margin: 14px auto 0;
    max-width: 570px;
    color: var(--muted);
    line-height: 1.65;
}

.primary-registration-link {
    min-height: 48px;
    margin-top: 25px;
    padding: 12px 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    font-weight: 900;
}

@media (max-width: 800px) {
    .registration-layout {
        grid-template-columns: 1fr;
    }

    .registration-league-summary {
        position: static;
    }
}

@media (max-width: 580px) {
    .registration-main {
        width: min(100% - 24px, 1040px);
        padding-top: 36px;
    }

    .bowler-count-options,
    .registration-field-grid {
        grid-template-columns: 1fr;
    }

    .registration-section {
        padding: 24px 20px;
    }

    .registration-form-message {
        margin-right: 20px;
        margin-left: 20px;
    }

    .registration-submit-button {
        width: calc(100% - 40px);
        margin-right: 20px;
        margin-left: 20px;
    }

    .registration-submit-note {
        margin-right: 20px;
        margin-left: 20px;
    }

    .registration-success {
        padding: 32px 22px;
    }
}
