:root {
    --bg: #f5f7fb;
    --card: #ffffff;
    --ink: #152033;
    --muted: #687386;
    --line: #e5e9f0;
    --accent: #F6AE2D;
    --accent2: #F29E03;
    --dark: #172033;
    --success: #159957;
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--ink)
}

.hero {
    background: linear-gradient(135deg, #151d31 0%, #202d49 65%, #ff5a36 180%);
    color: white;
    padding: 34px 20px 92px
}

.wrap {
    max-width: 1050px;
    margin: auto
}

.top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px
}

.brand {
    font-weight: 900;
    letter-spacing: .08em;
    font-size: 14px
}

.badge {
    border: 1px solid rgba(255, 255, 255, .2);
    background: rgba(255, 255, 255, .08);
    padding: 9px 13px;
    border-radius: 999px;
    font-size: 13px
}

.hero h1 {
    font-size: clamp(40px, 7vw, 76px);
    line-height: .95;
    margin: 62px 0 16px;
    letter-spacing: -.055em
}

.hero p {
    max-width: 620px;
    color: #d7deea;
    font-size: 18px;
    line-height: 1.55;
    margin: 0
}

.layout {
    max-width: 1050px;
    margin: -58px auto 70px;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 330px;
    gap: 22px;
    position: relative
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: 0 18px 50px rgba(22, 32, 51, .08);
    padding: 10px;
}

.form {
    padding: 32px
}

.side {
    padding: 26px;
    height: max-content
}

.eyebrow {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--accent)
}

h2 {
    margin: 7px 0 7px;
    font-size: 28px;
    letter-spacing: -.03em
}

.intro {
    
    margin: 0 0 28px
}

label {
    display: block;
    font-weight: 750;
    font-size: 14px;
    margin: 0 0 8px
}

input,
select {
    width: 100%;
    border: 1px solid #dce2ea;
    border-radius: 13px;
    padding: 14px 15px;
    font-size: 15px;
    outline: none;
    background: white;
    color: var(--ink);
    transition: .2s
}

input:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(255, 90, 54, .1)
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px
}

.field {
    margin-bottom: 20px
}

.players {
    margin-top: 10px;
    border-top: 1px solid var(--line);
    padding-top: 24px
}

.player-row {
    display: grid;
    grid-template-columns: 1fr 145px;
    gap: 10px;
    margin-bottom: 10px
}

.club-toggle {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fafbfc
}

.club-toggle input {
    width: auto;
    accent-color: var(--accent)
}

.level {
    margin: 7px 0 26px;
    padding: 18px;
    border-radius: 17px;
    background: #fff5f1;
    border: 1px solid #ffd7ca
}

.level strong {
    font-size: 20px
}

.level small {
    display: block;
    color: #7b665f;
    margin-top: 4px;
    line-height: 1.45
}

.submit {
    width: 100%;
    border: 0;
    border-radius: 14px;
    padding: 16px;
    background: var(--accent);
    color: #fff;
    font-weight: 850;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(255, 90, 54, .23)
}

.submit:hover {
    background: #F29E03;
    transform: translateY(-1px)
}

.rules {
    display: grid;
    gap: 13px;
    margin-top: 18px
}

.rule {
    display: flex;
    gap: 11px;
    align-items: flex-start;
    color: #596578;
    font-size: 14px;
    line-height: 1.45
}

.icon {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    background: #f1f4f8;
    display: grid;
    place-items: center;
    flex: none
}

.summary {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--line)
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 9px 0;
    font-size: 14px
}

.summary-row span:last-child {
    font-weight: 800
}

.success {
    display: none;
    text-align: center;
    padding: 60px 25px
}

.success .check {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #eaf8f1;
    color: var(--success);
    display: grid;
    place-items: center;
    font-size: 30px;
    margin: 0 auto 18px
}

@media(max-width:820px) {
    .layout {
        grid-template-columns: 1fr
    }

    .side {
        order: 2
    }

    .hero {
        padding-bottom: 82px
    }
}

@media(max-width:580px) {
    .grid {
        grid-template-columns: 1fr
    }

    .form {
        padding: 23px
    }

    .hero h1 {
        margin-top: 45px
    }

    .player-row {
        grid-template-columns: 1fr
    }

    .top {
        align-items: flex-start
    }

}

#backOfficeButton {
    --color: #151d31;
    font-family: inherit;
    display: inline-block;
    width: 6em;
    height: 2.6em;
    line-height: 2.5em;
    overflow: hidden;
    cursor: pointer;
    margin: 20px;
    font-size: 17px;
    z-index: 1;
    color: var(--color);
    border: 2px solid var(--color);
    border-radius: 6px;
    position: relative;
}

#backOfficeButton::before {
    position: absolute;
    content: "";
    background: var(--color);
    width: 150px;
    height: 200px;
    z-index: -1;
    border-radius: 50%;
    top: 100%;
    left: 100%;
    transition: 0.3s all;
}

#backOfficeButton:hover {
    color: white;
}

#backOfficeButton:hover::before {
    top: -30px;
    left: -30px;
}

#errorMessage {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.error {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    width: 320px;
    padding: 12px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: start;
    background: #ff5a36;
    border-radius: 8px;
    box-shadow: 0px 0px 5px -3px #111;
}

.error__icon {
    width: 20px;
    height: 20px;
    transform: translateY(-2px);
    margin-right: 8px;
}

.error__icon path {
    fill: #fff;
}

.error__title {
    font-weight: 500;
    font-size: 14px;
    color: #fff;
}

.error__close {
    width: 20px;
    height: 20px;
    cursor: pointer;
    margin-left: auto;
}

.error__close path {
    fill: #fff;
}

nav {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;

    a {
        text-decoration: none;
        color: var(--accent);
        font-weight: 600;
    }

    a:hover {
        text-decoration: underline;
    }

    a.active {
        color: var(--accent2);
        font-weight: 800;
        text-decoration: underline;
    }
}


.teams-wrap {
    width: min(1100px, 100%);
    margin: 0 auto;
    min-height: 100vh;
    padding: 34px 20px 92px
}

.page-header {
    margin-bottom: 28px
}

.page-header h1 {
    margin: 8px 0 10px
}

.page-header p {
    margin: 0;
    opacity: .75;
    max-width: 680px
}

.actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 22px
}

.action-button {
    border: 0;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 12px;
    font: inherit;
    font-weight: 700;
    background: var(--accent);
    color: #fff
}
.action-button:hover {
    background: var(--accent2);
    transform: translateY(-1px)
}
.teams-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px
}

.search-box {
    position: relative;
    flex: 1 1 300px
}

.search-box input {
    width: 100%;
    box-sizing: border-box;
    min-height: 48px;
    padding: 0 16px;
    border: 1px solid rgba(0, 0, 0, .12);
    border-radius: 13px;
    background: #fff;
    font: inherit;
    outline: none
}

.search-box input:focus {
    border-color: rgba(0, 0, 0, .35);
    box-shadow: 0 0 0 4px rgba(0, 0, 0, .05)
}

.filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap
}

.filter-button {
    border: 1px solid rgba(0, 0, 0, .1);
    background: #fff;
    color: inherit;
    border-radius: 999px;
    padding: 9px 14px;
    cursor: pointer;
    font: inherit;
    font-weight: 650
}

.filter-button:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent2) ;
    transform: translateY(-2px);
    box-shadow: 0 14px 36px rgba(0, 0, 0, .08)
}

.filter-button.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent2);

}

.team-count {
    margin: 0 0 16px;
    font-size: .95rem;
    opacity: .65
}

.team-count.is-loading {
    display: flex;
    align-items: center;
    gap: 9px;
    opacity: 1
}

.team-count.is-loading::before {
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    content: "";
    animation: team-loading .7s linear infinite
}

@keyframes team-loading {
    to {
        transform: rotate(360deg)
    }
}

@media (prefers-reduced-motion: reduce) {
    .team-count.is-loading::before {
        animation: none
    }
}

.teams-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px
}

.team-card {
    position: relative;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .07);
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .05);
    transition: transform .18s ease, box-shadow .18s ease
}

.team-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 36px rgba(0, 0, 0, .08)
}

.team-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 22px
}

.team-number {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: var(--accent);
    font-weight: 800;
    flex: 0 0 auto;
    color: white;
}

.level-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 7px 11px;
    font-size: .78rem;
    font-weight: 800;
    white-space: nowrap
}

.level-badge.loisir {
    background: #e9f7ee;
    color: #23713e
}

.level-badge.intermediaire {
    background: #fff3d8;
    color: #8a5b00
}

.level-badge.confirme {
    background: #fbe5e5;
    color: #9b3030
}

.team-name {
    margin: 0 0 7px;
    font-size: 1.35rem;
    line-height: 1.15
}

.captain {
    margin: 0;
    opacity: .7
}

.captain strong {
    opacity: 1
}

.empty-state {
    display: none;
    text-align: center;
    padding: 55px 20px;
    border: 1px dashed rgba(0, 0, 0, .16);
    border-radius: 18px;
    background: rgba(255, 255, 255, .55)
}

.empty-icon {
    font-size: 2rem;
    margin-bottom: 10px
}

@media(max-width:760px) {
    .teams-page {
        padding: 28px 14px 50px
    }

    .teams-grid {
        grid-template-columns: 1fr
    }

    .team-card {
        padding: 18px
    }
}