/* ============================================================
   AFEBAS – Site d’inscription
   CSS unifié (layout + formulaires + popups)
   ============================================================ */

/* ------------------------------
   0. Variables de thème
   ------------------------------ */

:root {
    --afb-bg-page: #031b4b;      /* fond global bleu AFEBAS */
    --afb-surface: #ffffff;      /* cartes / contenu */
    --afb-surface-soft: #f3f4f6;
    --afb-border: #e5e7eb;

    --afb-primary: #0f172a;      /* titres / header */
    --afb-primary-soft: #1e293b;
    --afb-accent: #facc15;       /* jaune AFEBAS */
    --afb-accent-soft: #eab308;

    --afb-text-main: #111827;
    --afb-text-soft: #4b5563;

    --afb-radius-md: 10px;
    --afb-radius-lg: 14px;
    --afb-shadow-soft: 0 10px 25px rgba(15, 23, 42, 0.25);
}

/* ------------------------------
   1. Reset / base
   ------------------------------ */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
                 Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--afb-text-main);
    background-color: var(--afb-bg-page);
}

a {
    color: var(--afb-primary-soft);
    text-decoration: none;
    transition: color 0.15s ease, background-color 0.15s ease;
}
a:hover,
a:focus {
    color: var(--afb-accent-soft);
}

h1, h2, h3, h4 {
    margin: 0 0 0.75rem 0;
    font-weight: 600;
    color: var(--afb-primary);
}

p {
    margin: 0 0 0.75rem 0;
    color: var(--afb-text-soft);
}

/* ------------------------------
   2. Structure globale
   ------------------------------ */

#body_bg {
    min-height: 100vh;
    padding-top: 70px;
    background: var(--afb-bg-page);
}

#wrapper {
    max-width: min(1800px, 98vw); /* 1440px sur grands écrans, 92% sur les autres */
    margin: 0 auto;
    padding: 0 24px 40px;        /* un peu plus de “soufflet” interne */
    box-sizing: border-box;
}

/* ===== Header + logo ===== */

#header {
    padding: 8px 0 24px;
}

.logo_container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo {
    margin: 0;
}

.logo a {
    display: inline-block;
    text-decoration: none;
}

/* Logo image AFEBAS bien visible */
.logo a span {
    display: block;
    width: 260px;
    height: 70px;
    background: url("https://www.afebas.org/wp-content/uploads/2022/09/cropped-cropped-test-2022_v3-2048x499.png")
                center/contain no-repeat;
    text-indent: -9999px;
}

/* Bandeau nav (si #top / #hornav utilisés) */

#top {
    margin: 0 0 16px;
    padding: 4px 18px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--afb-primary) 0%, #020617 100%);
    color: #e5e7eb;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.4);
}

#top ul.menu,
#hornav ul.menu {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
    margin: 0;
    padding: 0;
}

#top ul.menu > li > a,
#hornav ul.menu > li > a {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #e5e7eb;
}

#top ul.menu > li:first-child > a,
#hornav ul.menu > li:first-child > a {
    background-color: rgba(250, 204, 21, 0.18);
    color: var(--afb-accent);
}

#top ul.menu > li > a:hover,
#hornav ul.menu > li > a:hover {
    background-color: rgba(250, 204, 21, 0.25);
    color: var(--afb-accent-soft);
}

/* ------------------------------
   3. Layout principal
   (#sidecol + #content80)
   ------------------------------ */

#content_wrapper {
    width: 100%;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.35);
    padding: 24px 24px 28px;
}

.content_wrapper {
    width: 100%;
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

/* Colonne gauche : panier + menu */
#sidecol {
    flex: 0 0 260px;
    box-sizing: border-box;
    float: none !important;
}

.sidecol_block {
    width: 100%;
}

/* Colonne droite : contenu principal */
#content80,
#content100 {
    flex: 1;
    min-width: 0;
    margin-left: 0;
    background: var(--afb-surface);
    border-radius: var(--afb-radius-lg);
    padding: 1.25rem 1.6rem 1.8rem;
    box-shadow: var(--afb-shadow-soft);
    box-sizing: border-box;
    min-height: 200px;
    float: none !important;
}

/* Contenu interne */
.spacer {
    height: 8px;
}

.auth-actions {
    font-size: 0.9rem;
    color: var(--afb-text-soft);
}

.auth-actions a {
    margin-left: 8px;
}

/* Séparateur sous le bandeau connexion */
.item-separator {
    height: 4px;
    margin: 10px 0 16px;
    border-radius: 999px;
    background: #020617;
}

/* Base héritée inutile */
#base,
#base_bg,
#base_wrapper {
    display: none;
}

/* Footer */

footer.copyright {
    margin-top: 20px;
    padding: 8px 0 16px;
    text-align: center;
    font-size: 0.85rem;
    color: #6b7280;
}

footer.copyright a {
    text-decoration: none;
    color: inherit;
}

/* Nettoyage des floats */
#content_wrapper::after,
.content_wrapper::after,
#wrapper::after {
    content: "";
    display: block;
    clear: both;
}

/* ------------------------------
   4. Modules / menu gauche
   ------------------------------ */

.main-module {
    background: rgba(15, 23, 42, 0.96);
    border-radius: var(--afb-radius-lg);
    padding: 1rem 1rem 1.25rem;
    color: #e5e7eb;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.45);
    margin-top: 0.75rem;
}

.main-module .module + .module {
    margin-top: 0.9rem;
}

/* Titres menu gauche */
.main-module h3,
.sidecol_block h3 {
    margin: 0 0 0.6rem 0;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--afb-accent);
}

/* Listes de menu */
.main-module ul.menu,
.sidecol_block ul.menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-module ul.menu li,
.sidecol_block ul.menu li {
    margin: 0 0 0.3rem 0;
}

.main-module ul.menu li a,
.sidecol_block ul.menu li a {
    display: block;
    padding: 0.32rem 0.3rem;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #e5e7eb;
}
.main-module ul.menu li a:hover,
.sidecol_block ul.menu li a:hover {
    background: rgba(148, 163, 184, 0.2);
    color: var(--afb-accent);
}

/* ------------------------------
   5. Tableaux généraux
   ------------------------------ */

table,
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    background: var(--afb-surface);
}

table th,
.table th,
table td,
.table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--afb-border);
    font-size: 0.9rem;
    vertical-align: middle;
}

table th,
.table th {
    background: var(--afb-primary);
    color: #e5e7eb;
    text-align: left;
    font-weight: 600;
}

table tr:nth-child(even) td,
.table tr:nth-child(even) td {
    background: var(--afb-surface-soft);
}

/* ------------------------------
   6. Formulaires / boutons
   ------------------------------ */

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
select,
textarea {
    width: 100%;
    max-width: 100%;
    padding: 0.45rem 0.6rem;
    border-radius: 6px;
    border: 1px solid var(--afb-border);
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--afb-text-main);
    background-color: #ffffff;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--afb-accent-soft);
    box-shadow: 0 0 0 2px rgba(234, 179, 8, 0.25);
}

/* Boutons */

button,
input[type="submit"],
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    border: none;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    background: var(--afb-primary-soft);
    color: #e5e7eb;
    transition: background-color 0.15s ease, transform 0.1s ease;
}

button:hover,
input[type="submit"]:hover,
.btn:hover {
    background: var(--afb-accent-soft);
    transform: translateY(-1px);
}

/* ------------------------------
   7. Menus desktop vs mobile
   ------------------------------ */

/* Desktop par défaut : UL visibles, SELECT cachés */
.menu.menu-desktop {
    display: block;
}
.menu-mobile {
    display: none;
}

/* ------------------------------
   8. Profil / licence joueur
   ------------------------------ */

.profil-cards {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.profil-card {
    position: relative;
    background: var(--afb-surface);
    border-radius: var(--afb-radius-lg);
    padding: 1rem 1.25rem 1.25rem;
    box-shadow: var(--afb-shadow-soft);
    overflow: hidden;
}

.profil-card.important,
.profil-card.clip {
    border-left: 4px solid var(--afb-accent);
}

.profil-card__title {
    margin: 0 0 0.6rem 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--afb-primary);
}

.profil-fields {
    margin: 0.3rem 0 0;
    padding: 0;
}

.profil-field {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
}

.profil-field dt {
    min-width: 120px;
    font-weight: 500;
    color: var(--afb-text-soft);
}

.profil-field dd {
    margin: 0;
    font-weight: 600;
    color: var(--afb-text-main);
}

/* Image licence */

.licence-img {
    float: right;
    max-width: 260px;
    height: auto;
    margin: 0 0 0.75rem 1rem;
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.4);
}

/* Photo joueur */

.photo-joueur {
    float: right;
    width: 140px;
    height: 140px;
    margin: 0 0 0.75rem 1rem;
    border-radius: 999px;
    object-fit: cover;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.45);
}

/* Bouton licence */

.btn-licence {
    margin-top: 0.8rem;
    background: var(--afb-accent);
    color: #111827;
}
.btn-licence:hover {
    background: var(--afb-accent-soft);
}

/* ------------------------------
   9. Module "Tournoi en cours"
   ------------------------------ */

.module-now {
    background: linear-gradient(135deg, var(--afb-accent) 0%, #fef08a 40%, #fefce8 100%);
    border-radius: var(--afb-radius-lg);
    padding: 0.7rem 0.9rem 0.95rem;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.35);
    margin-top: 0.5rem;
}

.module-now h3 {
    margin-bottom: 0.6rem;
    color: #111827;
}

.module-now .link-now {
    display: block;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    text-align: center;
    background: #020617;
    color: #fefce8;
    font-weight: 600;
    font-size: 0.92rem;
}

.module-now .link-now:hover {
    background: #111827;
    color: var(--afb-accent);
}

/* ------------------------------
   10. Page CONNEXION – layout
   ------------------------------ */

.auth-layout {
    max-width: 900px;
    margin: 20px auto 60px;
    padding: 0 15px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.auth-card {
    position: relative;
    width: 100%;
    max-width: 960px;
    background: var(--afb-surface);
    border-radius: var(--afb-radius-lg);
    padding: 1.5rem 2rem 2rem;
    box-shadow: var(--afb-shadow-soft);
    font-size: 1rem;
    line-height: 1.5;
}

.auth-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.auth-title {
    margin: 0 0 0.25rem 0;
    font-size: 1.5em;
    font-weight: 700;
    color: var(--afb-primary);
}

.auth-subtitle {
    margin: 0;
    font-size: 0.95em;
    color: var(--afb-text-soft);
}

.auth-header-side {
    text-align: right;
}

.auth-register-link {
    font-size: 0.95em;
    font-weight: 600;
    color: var(--afb-primary-soft);
    white-space: nowrap;
    padding: 0.35em 0.8em;
    border-radius: 999px;
    border: 1px solid #0066cc;
    background: #ffffff;
    text-decoration: none;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.auth-register-link:hover {
    background: #0066cc;
    color: #ffffff;
    box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.15);
}

.auth-message {
    margin-bottom: 0.75rem;
    font-size: 0.95em;
}

.auth-form {
    margin-top: 0.75rem;
}

.auth-form-row {
    margin-bottom: 0.85rem;
}

.auth-form-row label {
    display: block;
    font-size: 0.95em;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--afb-text-main);
}

.auth-form-row input[type="text"],
.auth-form-row input[type="password"] {
    width: 100%;
    border-radius: 6px;
    border: 1px solid var(--afb-border);
    padding: 0.55em 0.75em;
    font-size: 1em;
    box-sizing: border-box;
}

.auth-form-actions {
    margin-top: 0.6rem;
}

/* Bouton principal Connexion */
.btn.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1em;
    font-weight: 600;
    padding: 0.55em 1.6em;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    background: linear-gradient(90deg, #facc15, #0066cc);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.auth-forgot {
    margin-top: 0.75rem;
    font-size: 0.9em;
    color: var(--afb-text-soft);
}

/* Séparateur "ou" */

.auth-divider {
    margin: 1.2rem 0 0.9rem;
    text-align: center;
    position: relative;
    font-size: 0.85em;
    color: var(--afb-text-soft);
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 42%;
    height: 1px;
    background: var(--afb-border);
}
.auth-divider::before { left: 0; }
.auth-divider::after  { right: 0; }

.auth-divider span {
    background: var(--afb-surface);
    padding: 0 0.6rem;
}

/* Bloc social */

.auth-social-block {
    margin-top: 0.4rem;
}

.auth-social-title {
    margin: 0 0 0.6rem 0;
    font-size: 0.95em;
    color: var(--afb-primary);
}

.auth-social-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.auth-social-buttons .btn {
    flex: 1 1 0;
    text-align: center;
}

.btn-google {
    background: #ffffff;
    color: #111827;
    border: 1px solid #e5e7eb;
}
.btn-google:hover {
    background: #f3f4f6;
    color: #111827;
}

.btn-facebook {
    background: #1d4ed8;
    color: #f9fafb;
    border: 1px solid #1d4ed8;
}
.btn-facebook:hover {
    background: #1e40af;
    color: #f9fafb;
}

.auth-register-bottom {
    margin-top: 1.1rem;
    font-size: 0.9em;
    color: var(--afb-text-soft);
}
.auth-register-bottom a {
    font-weight: 600;
}

/* Bouton de fermeture popup login */

.auth-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: none;
    background: rgba(148, 163, 184, 0.15);
    color: #0f172a;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.auth-close:hover {
    background: rgba(148, 163, 184, 0.28);
    color: #020617;
    transform: translateY(-1px);
}

/* ------------------------------
   11. Popup score plein écran
   ------------------------------ */

.score-popup {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
}

.score-popup.is-open {
    display: flex;
    align-items: center;
    justify-content: center;
}

.score-popup-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
}

.score-popup-dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 900px;
    max-height: calc(100vh - 40px);
    background: #ffffff;
    border-radius: 14px;
    padding: 18px 16px 20px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.6);
    overflow-y: auto;
}

.score-popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: none;
    background: rgba(148, 163, 184, 0.15);
    color: #0f172a;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s, transform 0.1s;
}
.score-popup-close:hover {
    background: rgba(148, 163, 184, 0.3);
    color: #020617;
    transform: translateY(-1px);
}

/* ------------------------------
   12. Responsive
   ------------------------------ */

@media screen and (max-width: 1024px) {

    body {
        font-size: 15px;
    }

    #body_bg {
        padding-top: 50px;
    }

    #wrapper {
        padding: 0 12px 24px;
    }

    .content_wrapper {
        flex-direction: column;
    }

    #sidecol,
    #content80,
    #content100 {
        flex: none;
        width: 100%;
        margin: 0 0 1rem 0;
    }

    #content80,
    #content100 {
        padding: 1rem 1.1rem 1.3rem;
    }

    /* Menus : UL cachés, SELECT visibles */
    .menu.menu-desktop {
        display: none;
    }
    .menu-mobile {
        display: block;
        width: 100%;
    }

    .profil-cards {
        grid-template-columns: minmax(0, 1fr);
    }

    .licence-img,
    .photo-joueur {
        float: none;
        display: block;
        margin: 0 auto 0.9rem auto;
    }
}

@media screen and (max-width: 640px) {

    body {
        font-size: 14px;
    }

    #wrapper {
        padding: 0 8px 20px;
    }

    #content80,
    #content100 {
        padding: 0.9rem 0.75rem 1.1rem;
    }

    .logo a span {
        width: 200px;
        height: 56px;
    }

    .main-module {
        padding: 0.7rem 0.7rem 0.9rem;
        box-shadow: 0 6px 16px rgba(15, 23, 42, 0.5);
    }

    .main-module h3 {
        font-size: 0.85rem;
    }

    .main-module ul li a {
        font-size: 0.85rem;
        padding: 0.3rem 0.25rem;
    }

    table th,
    table td,
    .table th,
    .table td {
        font-size: 0.8rem;
        padding: 0.4rem 0.45rem;
    }

    /* Popup login plein écran */
    .auth-layout {
        position: fixed;
        inset: 0;
        z-index: 9999;
        background: rgba(0, 0, 0, 0.65);
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 16px;
        margin: 0;
        max-width: 100%;
    }

    .auth-card {
        width: 100%;
        max-width: 420px;
        max-height: calc(100vh - 40px);
        overflow-y: auto;
        border-radius: 12px;
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.6);
        padding: 18px 16px 20px;
        background: #ffffff;
    }

    .auth-social-buttons {
        flex-direction: column;
    }

    .auth-social-buttons .btn {
        width: 100%;
    }

    .auth-close {
        top: 10px;
        right: 10px;
        width: 38px;
        height: 38px;
        font-size: 26px;
    }

    /* Popup score plein écran */
    .score-popup-dialog {
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .score-popup-close {
        width: 38px;
        height: 38px;
        font-size: 26px;
    }
}
