:root {
    --brand: #990000;
    --brand-dark: #710000;
    --ink: #241f1f;
    --muted: #6d6666;
    --line: #e7dddd;
    --surface: #ffffff;
    --soft: #f8f3f3;
    --focus: rgba(153, 0, 0, 0.18);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background: linear-gradient(180deg, #fff 0%, #fbf5f5 100%);
    font-family: Inter, Arial, sans-serif;
}

button,
input,
select {
    font: inherit;
}

.page-shell {
    min-height: 100vh;
}

.hero {
    position: relative;
    display: grid;
    min-height: 360px;
    overflow: hidden;
    color: #fff;
}

.hero__media {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(28, 0, 0, 0.82), rgba(70, 0, 0, 0.42) 48%, rgba(0, 0, 0, 0.12)),
        url("assets/quadra-futsal.jpg") center / cover no-repeat,
        linear-gradient(135deg, var(--brand), #1f5f86 58%, #d86f13);
    transform: scale(1.01);
}

.hero__content {
    position: relative;
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
    align-self: center;
    padding: 56px 0 72px;
}

.brand-logo {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
}

.form-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.eyebrow {
    display: inline-flex;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 0.84rem;
    font-weight: 700;
    text-transform: uppercase;
}

h1 {
    max-width: 760px;
    margin: 18px 0 14px;
    font-size: clamp(1.95rem, 4vw, 3.6rem);
    line-height: 1;
    text-shadow:
        0 2px 4px rgba(0, 0, 0, 0.78),
        0 8px 24px rgba(0, 0, 0, 0.72);
}

.hero p {
    max-width: 620px;
    margin: 0;
    color: rgba(255, 255, 255, 0.88);
    font-size: 1.08rem;
    line-height: 1.6;
    text-shadow:
        0 2px 4px rgba(0, 0, 0, 0.76),
        0 6px 18px rgba(0, 0, 0, 0.68);
}

.form-section {
    width: min(1120px, calc(100% - 40px));
    margin: -42px auto 56px;
    position: relative;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 24px 60px rgba(73, 18, 18, 0.16);
}

.tabs {
    display: flex;
    gap: 8px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--soft);
}

.tab-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    border: 0;
    border-radius: 6px;
    padding: 13px 16px;
    color: var(--muted);
    background: transparent;
    font-weight: 800;
    cursor: pointer;
}

.tab-button.is-active {
    color: #fff;
    background: var(--brand);
    box-shadow: 0 8px 18px rgba(153, 0, 0, 0.24);
}

.tab-panel {
    padding-top: 26px;
}

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

label {
    display: grid;
    gap: 8px;
    color: #3a3030;
    font-weight: 700;
}

label span,
.players-title h2,
.modal h2 {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

label > span {
    width: fit-content;
    max-width: 100%;
    padding: 5px 9px;
    border: 1px solid #990000;
    border-radius: 999px;
    color: #fff !important;
    background-color: #990000 !important;
    font-size: 0.84rem;
    font-weight: 800;
    box-shadow: 0 7px 16px rgba(153, 0, 0, 0.34);
}

label > span i {
    color: #fff;
}

label i,
.players-title h2 i,
.modal h2 i {
    color: var(--brand);
}

.form-group {
    position: relative;
    display: flex;
    align-items: center;
}

.form-group > i {
    position: absolute;
    left: 13px;
    z-index: 1;
    width: 18px;
    color: var(--brand);
    opacity: 0.82;
    text-align: center;
    pointer-events: none;
}

.form-group input,
.form-group select {
    padding-left: 42px;
}

.form-group select {
    appearance: none;
    padding-right: 38px;
    background-image:
        linear-gradient(45deg, transparent 50%, #7a6b6b 50%),
        linear-gradient(135deg, #7a6b6b 50%, transparent 50%);
    background-position:
        calc(100% - 19px) 50%,
        calc(100% - 13px) 50%;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.form-group:focus-within > i {
    opacity: 1;
}

.tab-button.is-active i,
.button--primary i {
    color: #fff;
}

.button--secondary i {
    color: var(--brand);
}

input,
select {
    width: 100%;
    min-height: 48px;
    border: 1px solid #d8caca;
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    padding: 11px 13px;
    outline: 0;
}

input:focus,
select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px var(--focus);
}

input.has-error {
    border-color: var(--brand);
    background: #fff6f6;
}

.field-message {
    min-height: 18px;
    color: var(--brand);
    font-size: 0.82rem;
}

.is-hidden {
    display: none;
}

.players-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 28px 0 16px;
}

.players-title h2 {
    margin: 0 0 4px;
    font-size: 1.25rem;
}

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

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

.player-card {
    position: relative;
    margin: 0;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffafa;
}

.player-card legend {
    padding: 0 8px;
    color: var(--brand);
    font-weight: 800;
}

.remove-player,
.modal__close {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    color: var(--brand);
    background: #f2e5e5;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.remove-player {
    position: absolute;
    top: 14px;
    right: 14px;
}

.actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 26px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 0 18px;
    font-weight: 800;
    cursor: pointer;
}

.button--primary {
    color: #fff;
    background: var(--brand);
}

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

.button--secondary {
    color: var(--brand);
    border-color: #e2c8c8;
    background: #fff;
}

.alert {
    margin-bottom: 16px;
    border-radius: 6px;
    padding: 13px 15px;
    font-weight: 700;
}

.alert--success {
    color: #14532d;
    background: #dcfce7;
}

.alert--error {
    color: var(--brand);
    background: #fee2e2;
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 20;
}

.modal.is-open {
    display: block;
}

.modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(18, 8, 8, 0.64);
}

.modal__dialog {
    position: relative;
    width: min(620px, calc(100% - 32px));
    max-height: calc(100vh - 32px);
    overflow: auto;
    margin: 16px auto;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 8px;
    background: #fff;
    padding: 26px;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.32);
}

.modal__close {
    position: absolute;
    top: 18px;
    right: 18px;
}

.modal h2 {
    margin: 0 42px 8px 0;
    font-size: 1.5rem;
}

.modal p {
    margin: 0 0 18px;
    color: var(--muted);
}

.summary {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    background: var(--soft);
}

.summary dl {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 10px 14px;
    margin: 0;
}

.summary dt {
    color: var(--muted);
    font-weight: 700;
}

.summary dd {
    margin: 0;
    font-weight: 800;
}

.summary-players {
    display: grid;
    gap: 10px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.summary-players li {
    display: grid;
    gap: 4px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.summary-players span {
    color: var(--muted);
}

.modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

@media (min-width: 980px) {
    body {
        background: #fff;
    }

    .page-shell {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(380px, 430px);
        gap: 28px;
        min-height: 100vh;
        padding: 28px;
        align-items: start;
    }

    .hero {
        min-height: calc(100vh - 56px);
        height: calc(100vh - 56px);
        border-radius: 14px;
        box-shadow: 0 22px 58px rgba(38, 12, 12, 0.2);
    }

    .hero__content {
        width: min(760px, calc(100% - 80px));
        padding: 52px 0;
    }

    .form-brand {
        margin-bottom: 14px;
        padding-bottom: 14px;
    }

    h1 {
        max-width: 640px;
        font-size: clamp(2rem, 3.3vw, 3.25rem);
    }

    .form-section {
        align-self: start;
        width: auto;
        max-width: 430px;
        margin: 0;
        padding: 18px;
        box-shadow: 0 20px 52px rgba(73, 18, 18, 0.14);
    }

    .tabs {
        gap: 6px;
        padding: 5px;
    }

    .tab-button {
        padding: 11px 10px;
        font-size: 0.9rem;
    }

    .tab-panel {
        padding-top: 18px;
    }

    .grid,
    .team-header {
        grid-template-columns: 1fr;
        gap: 13px;
    }

    label {
        gap: 6px;
        font-size: 0.92rem;
    }

    input,
    select {
        min-height: 42px;
        padding: 9px 11px;
    }

    .players-title {
        margin: 20px 0 12px;
    }

    .players-title h2 {
        font-size: 1.08rem;
    }

    .players-title p {
        font-size: 0.9rem;
    }

    .player-card {
        padding: 16px;
    }

    .button {
        min-height: 42px;
        padding: 0 14px;
    }

    .actions {
        margin-top: 18px;
    }
}

@media (max-width: 760px) {
    .hero {
        min-height: 440px;
    }

    .hero__content,
    .form-section {
        width: min(100% - 24px, 1120px);
    }

    .form-section {
        margin-top: -54px;
        padding: 16px;
    }

    .tabs,
    .players-title,
    .modal__actions {
        flex-direction: column;
    }

    .grid,
    .team-header,
    .summary dl {
        grid-template-columns: 1fr;
    }

    .actions,
    .modal__actions {
        align-items: stretch;
    }

    .button {
        width: 100%;
    }
}
