@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
    color-scheme: light;
    --font-display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
    --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;
    --netpadel: #123c37;
    --mint: #b7f3dc;
    --mint-strong: #58cfa5;
    --ink: #17211f;
    --muted: #62716d;
    --line: #d9e4df;
    --surface: #ffffff;
    --page: #f3f7f4;
    --danger: #b42318;
    --success: #1f7a4f;
    --shadow: 0 22px 60px rgba(18, 60, 55, 0.14);
}

* {
    box-sizing: border-box;
}

html,
body,
button,
input,
select,
textarea {
    font-family: var(--font-body);
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        linear-gradient(145deg, rgba(183, 243, 220, 0.52), rgba(255, 255, 255, 0) 34%),
        var(--page);
    color: var(--ink);
    line-height: 1.5;
}

button,
input,
select,
textarea {
    font: inherit;
}

.site-header {
    background: #000000;
    color: #ffffff;
    border-bottom: 4px solid var(--mint);
}

.site-header__inner {
    display: grid;
    grid-template-columns: minmax(150px, 220px) minmax(220px, 1fr) auto;
    align-items: center;
    gap: 24px;
    width: min(100% - 40px, 1440px);
    min-height: 82px;
    margin: 0 auto;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
}

.brand-logo {
    display: block;
    width: clamp(145px, 15vw, 205px);
    max-height: 52px;
    object-fit: contain;
}

.site-header__tournament {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    overflow: hidden;
}

.tournament-navbar-logo {
    display: block;
    width: min(100%, 430px);
    max-height: 68px;
    object-fit: contain;
}

.site-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    white-space: nowrap;
}

.site-nav a {
    border-radius: 8px;
    color: #ffffff;
    font-family: var(--font-display);
    font-size: 0.84rem;
    font-weight: 500;
    letter-spacing: 0.015em;
    text-decoration: none;
    padding: 9px 10px;
    transition: background-color 150ms ease, color 150ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a[aria-current="page"] {
    background: rgba(183, 243, 220, 0.16);
    color: var(--mint);
}

.page-shell {
    width: min(1040px, calc(100% - 32px));
    margin: 42px auto 64px;
}

.registration-card {
    background: var(--surface);
    border: 1px solid rgba(18, 60, 55, 0.12);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: clamp(24px, 4vw, 48px);
}

.registration-card__header {
    max-width: 760px;
    margin-bottom: 30px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--success);
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

h1,
h2,
h3,
.site-nav,
.eyebrow,
.registration-card__header h1,
.public-category__header h2,
button,
.button,
.modal__title {
    font-family: var(--font-display);
}

h1 {
    margin-bottom: 10px;
    color: var(--netpadel);
    font-size: clamp(2rem, 5vw, 3.3rem);
    font-weight: 600;
    letter-spacing: -0.035em;
    line-height: 1.05;
}

.registration-card__header p:last-child,
.section-help {
    color: var(--muted);
    font-size: 1.04rem;
}

.registration-form {
    display: grid;
    gap: 28px;
}

.form-section {
    margin: 0;
    padding: 28px 0 0;
    border: 0;
    border-top: 1px solid var(--line);
}

.form-section legend {
    padding: 0 14px 0 0;
    color: var(--netpadel);
    font-size: 1.25rem;
    font-weight: 600;
}

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

.field {
    display: grid;
    gap: 7px;
    margin-bottom: 18px;
}

.field label,
.consent-box label,
.switch-row {
    font-weight: 500;
}

label span[aria-hidden="true"] {
    color: var(--success);
}

input[type="text"],
input[type="tel"],
input[type="email"],
select {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdfc;
    color: var(--ink);
    padding: 12px 14px;
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

input:focus,
select:focus,
button:focus-visible,
.slot-option:has(input:focus-visible),
.switch-row:has(input:focus-visible) {
    border-color: var(--mint-strong);
    box-shadow: 0 0 0 4px rgba(88, 207, 165, 0.24);
}

input[aria-invalid="true"],
select[aria-invalid="true"] {
    border-color: var(--danger);
    background: #fffafa;
}

.field-error {
    min-height: 20px;
    margin: 0;
    color: var(--danger);
    font-size: 0.9rem;
    font-weight: 500;
}

.switch-row {
    width: fit-content;
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin: 8px 0 20px;
    padding: 8px 12px 8px 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
}

.switch-row input {
    position: absolute;
    opacity: 0;
}

.switch-visual {
    width: 48px;
    height: 28px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: #c9d8d4;
    position: relative;
    transition: background-color 160ms ease;
}

.switch-visual::after {
    content: "";
    width: 22px;
    height: 22px;
    position: absolute;
    top: 3px;
    left: 3px;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
    transition: transform 160ms ease;
}

.switch-row input:checked + .switch-visual {
    background: var(--netpadel);
}

.switch-row input:checked + .switch-visual::after {
    transform: translateX(20px);
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 22px;
}

.secondary-button,
.primary-button {
    min-height: 48px;
    border: 0;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.secondary-button {
    background: #e9f6f0;
    color: var(--netpadel);
    padding: 10px 14px;
}

.secondary-button:hover {
    background: #d7f0e6;
}

.primary-button {
    width: fit-content;
    min-width: 220px;
    background: var(--netpadel);
    color: #ffffff;
    padding: 13px 22px;
    box-shadow: 0 12px 26px rgba(18, 60, 55, 0.22);
}

.primary-button:hover:not(:disabled),
.secondary-button:hover {
    transform: translateY(-1px);
}

.primary-button:disabled {
    cursor: wait;
    opacity: 0.72;
}

.slot-groups {
    display: grid;
    gap: 22px;
}

.slot-group h2 {
    margin-bottom: 12px;
    color: var(--ink);
    font-size: 1rem;
}

.slot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.slot-option {
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdfc;
    padding: 11px 12px;
    cursor: pointer;
    transition: border-color 160ms ease, background-color 160ms ease;
}

.slot-option:hover {
    border-color: var(--mint-strong);
}

.slot-option:has(input:checked) {
    border-color: var(--netpadel);
    background: #e9f8f1;
}

.slot-option input,
.consent-box input {
    width: 19px;
    height: 19px;
    accent-color: var(--netpadel);
}

.public-registrations {
    display: grid;
    gap: 22px;
}

.public-registrations .registration-card__header {
    margin-bottom: 22px;
}

.public-registrations .eyebrow {
    margin-bottom: 6px;
    font-size: 0.72rem;
    font-weight: 600;
}

.public-registrations .registration-card__header h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3.25rem);
    font-weight: 600;
    letter-spacing: -0.035em;
}

.public-registrations .registration-card__header p {
    color: #7a8783;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 400;
}

.public-category-list {
    display: grid;
    gap: 16px;
}

.public-category {
    border: 1px solid rgba(18, 60, 55, 0.12);
    border-radius: 8px;
    background: #fbfdfc;
    overflow: hidden;
}

.public-category__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: var(--netpadel);
    color: #ffffff;
    padding: 12px 16px;
}

.public-category__header h2 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(0.95rem, 2vw, 1.15rem);
    font-weight: 600;
    line-height: 1.2;
}

.public-category__header span {
    flex: 0 0 auto;
    border-radius: 999px;
    background: rgba(183, 243, 220, 0.16);
    color: var(--mint);
    font-size: 0.74rem;
    font-weight: 600;
    padding: 4px 8px;
}

.public-category__empty {
    margin: 0;
    color: #7a8783;
    font-size: 0.88rem;
    font-weight: 400;
    padding: 13px 16px;
}

.public-pair-list {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.public-pair {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 12px;
    padding: 13px 16px;
}

.public-pair + .public-pair {
    border-top: 1px solid var(--line);
}

.public-pair__number {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: #e9f8f1;
    color: var(--netpadel);
    font-size: 0.78rem;
    font-weight: 600;
}

.public-pair__content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-width: 0;
}

.public-pair__names {
    min-width: 0;
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.public-pair__date {
    flex: 0 0 auto;
    color: var(--muted);
    font-family: var(--font-body);
    font-size: 0.76rem;
    font-weight: 400;
    text-align: right;
    white-space: nowrap;
}

.consent-box {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdfc;
    padding: 16px;
}

.consent-box label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.alert {
    margin-bottom: 24px;
    border-radius: 8px;
    padding: 14px 16px;
    font-weight: 600;
}

.alert--error {
    border: 1px solid rgba(180, 35, 24, 0.28);
    background: #fff2f0;
    color: var(--danger);
}

.alert--success {
    border: 1px solid rgba(31, 122, 79, 0.28);
    background: #eefbf4;
    color: var(--success);
}

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

.modal[hidden] {
    display: none;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    padding: clamp(16px, 4vw, 32px);
    overflow-y: auto;
}

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(11, 27, 24, 0.68);
    backdrop-filter: blur(5px);
}

.modal__panel {
    position: relative;
    z-index: 1;
    width: min(540px, 100%);
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    border: 1px solid rgba(18, 60, 55, 0.1);
    border-radius: 18px;
    background: #ffffff;
    padding: clamp(24px, 5vw, 38px);
    box-shadow: 0 28px 80px rgba(11, 27, 24, 0.28);
    animation: modal-enter 180ms ease-out both;
    outline: none;
}

.modal__header {
    display: grid;
    justify-items: center;
    gap: 16px;
    padding-right: 18px;
    text-align: center;
}

.modal__icon {
    display: grid;
    place-items: center;
    width: 62px;
    height: 62px;
    border-radius: 999px;
    background: linear-gradient(145deg, var(--mint), #e8fbf3);
    color: var(--success);
    box-shadow: 0 12px 30px rgba(31, 122, 79, 0.18);
}

.modal__icon span {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: #ffffff;
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1;
}

.modal__panel h2 {
    margin-bottom: 0;
    color: var(--netpadel);
    font-size: clamp(1.65rem, 5vw, 2.2rem);
    font-weight: 600;
    line-height: 1.12;
}

.modal__summary {
    display: grid;
    gap: 12px;
    margin: 26px 0 28px;
    border: 1px solid rgba(18, 60, 55, 0.1);
    border-radius: 12px;
    background: #f7fbf8;
    padding: clamp(16px, 4vw, 20px);
}

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

.modal__summary p:first-child {
    color: var(--ink);
    font-weight: 600;
}

.modal__actions {
    display: flex;
    justify-content: center;
}

.modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 999px;
    background: #eef5f2;
    color: var(--netpadel);
    font-size: 1.7rem;
    line-height: 1;
    cursor: pointer;
    transition: background 150ms ease, transform 150ms ease;
}

.modal__close:hover,
.modal__close:focus-visible {
    background: #dcebe5;
    transform: translateY(-1px);
}

@keyframes modal-enter {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 1050px) {
    .site-header__inner {
        grid-template-columns: 155px minmax(170px, 1fr) auto;
        gap: 14px;
    }

    .tournament-navbar-logo {
        width: min(100%, 310px);
        max-height: 56px;
    }

    .site-nav a {
        padding-inline: 8px;
        font-size: 0.78rem;
    }
}

@media (max-width: 760px) {
    .site-header__inner {
        grid-template-columns: minmax(110px, 0.8fr) minmax(150px, 1.2fr);
        gap: 10px 16px;
        width: min(100% - 24px, 100%);
        padding: 10px 0 12px;
    }

    .brand-logo {
        width: min(100%, 150px);
        max-height: 44px;
    }

    .tournament-navbar-logo {
        width: min(100%, 245px);
        max-height: 50px;
    }

    .site-nav {
        grid-column: 1 / -1;
        justify-content: center;
        flex-wrap: wrap;
        gap: 4px;
        width: 100%;
        white-space: normal;
    }

    .site-nav a {
        padding: 7px 8px;
        font-size: 0.74rem;
    }
}

@media (max-width: 720px) {
    .page-shell {
        width: min(100% - 20px, 1040px);
        margin: 20px auto 40px;
    }

    .registration-card {
        padding: 22px 16px;
    }

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

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

    .primary-button {
        width: 100%;
    }

    .modal {
        align-items: start;
    }

    .modal__panel {
        margin: auto 0;
        border-radius: 14px;
    }

    .modal__actions {
        display: block;
    }

    .public-category__header {
        align-items: flex-start;
        flex-direction: column;
    }

    .public-pair {
        grid-template-columns: 40px minmax(0, 1fr);
        padding: 12px 14px;
    }

    .public-pair__number {
        width: 32px;
        height: 32px;
    }

    .switch-row {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .public-pair__content {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .public-pair__date {
        text-align: left;
    }
}

@media (max-width: 420px) {
    .slot-grid {
        grid-template-columns: 1fr;
    }

    .quick-actions {
        display: grid;
    }
}
