/* Polices hébergées localement : aucune requête vers un tiers. */
@font-face {
    font-family: 'Barlow Semi Condensed';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/barlow-semi-condensed-400-latin-ext-4e39f3e579fe37a6720a95075e6a87d4.woff2") format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Barlow Semi Condensed';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/barlow-semi-condensed-400-latin-2b73fb5699f1346813965777e307a783.woff2") format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Barlow Semi Condensed';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/barlow-semi-condensed-600-latin-ext-b3e6bc7e0b38232a3bc4623c60466d94.woff2") format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Barlow Semi Condensed';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/barlow-semi-condensed-600-latin-caf5593f552a05c04d3d1686e2bae9f7.woff2") format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Barlow Semi Condensed';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url("../fonts/barlow-semi-condensed-800-latin-ext-92cdc735a9927c4f8f9b808c5045f691.woff2") format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Barlow Semi Condensed';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url("../fonts/barlow-semi-condensed-800-latin-9e4aa8679d47e9fedca793cbb13e3036.woff2") format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* La page doit pouvoir défiler : sur mobile, le clavier réduit de moitié la
   hauteur visible pendant la saisie. */
html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    background-color: #367fc2;
    font-family: 'Barlow Semi Condensed', sans-serif;
}

/* Page d'accueil : atteinte au QR code, donc pensée pour le mobile. */
.landing {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    box-sizing: border-box;
    padding: 32px 18px;
}

.logo-bds {
    width: 100%;
    height: auto;
    max-width: 420px;
}

.landing h1 {
    font-weight: bold;
    text-transform: uppercase;
    font-size: 2em;
    letter-spacing: 1px;
    text-align: center;
    color: #ffffff;
    margin: 22px 0 20px;
}

/* Le formulaire est posé sur du blanc : lisible en plein soleil, et l'œil va
   directement à la seule action attendue. */
.card {
    width: 100%;
    max-width: 440px;
    box-sizing: border-box;
    background-color: #ffffff;
    border-radius: 14px;
    padding: 24px 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
}

.card-intro {
    margin: 0 0 20px;
    font-size: 1.05em;
    line-height: 1.5;
    text-align: center;
}
/* Sur la page de fermeture, le texte est seul dans la carte : sa marge basse
   creuserait un vide. */
.card > *:last-child {
    margin-bottom: 0;
}

.landing-note {
    margin: 18px 0 0;
    max-width: 440px;
    font-size: .95em;
    line-height: 1.6;
    text-align: center;
    color: #ffffff;
}
.landing-note a {
    color: #ffffff;
}

/* Page de contenu : plus large que la carte du formulaire, faite pour lire. */
.page {
    display: flex;
    justify-content: center;
    padding: 32px 18px 60px;
}
.card-wide {
    max-width: 720px;
}
.page h1 {
    font-size: 1.7em;
    text-transform: uppercase;
    margin: 0 0 6px;
}
.page h2 {
    font-size: 1.15em;
    margin: 28px 0 8px;
}
.page p {
    line-height: 1.6;
    margin: 0 0 12px;
}
.page-lead {
    color: #555;
}
.page-back {
    margin-top: 32px;
    padding-top: 18px;
    border-top: 1px solid #e4e4e4;
}

/* FORM */
form {
    display: flex;
    flex-direction: column;
    width: 100%;
    align-items: center;
}
.form-group {
    display: flex;
    flex-direction: column;
    margin: 0 0 18px;
    gap: 10px;
    width: 100%;
    align-items: center;
}

.iti.iti--allow-dropdown.iti--show-flags {
    display: flex;
    font-size: 17px;
    height: 52px;
    width: 100%;
}
#sms_request_phoneNumber {
    width: 100%;
    font-size: 17px;
    border: 1px solid #c4c4c4;
    border-radius: 8px;
    transition: border-color .18s ease;
}
#sms_request_phoneNumber:focus {
    outline: none;
    border-color: #367fc2;
}
#sms_request_phoneNumber.is-invalid {
    border-color: #96122f;
}

.field-error {
    width: 100%;
    margin: 0;
    font-size: .92em;
    line-height: 1.45;
    color: #96122f;
}
.field-error.is-shaken {
    animation: shake .3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

button.btn, a.btn {
    background-color: #000000 !important;
    color: #ffffff !important;
    padding: 15px 20px !important;
    border-radius: 30px;
    text-transform: uppercase;
    font-weight: bold;
    border: none;
    font-family: inherit;
    font-size: 1em;
    /* Retour visuel à l'appui : sans lui, on doute d'avoir bien cliqué. */
    transition: background-color .18s ease, transform .12s ease, box-shadow .18s ease;
}
.landing button.btn {
    width: 100%;
}
button.btn:hover, a.btn:hover {
    cursor: pointer;
    background-color: #262626 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .2);
}
button.btn:active {
    transform: translateY(1px);
    box-shadow: none;
}
button.btn.btn-secondary {
    background-color: #ffffff !important;
    color: #1a1a1a !important;
    border: 1px solid #c4c4c4;
}
button.btn.btn-secondary:hover {
    background-color: #f2f2f2 !important;
}

/* Iti (intl-tel-input) */
.iti .iti__selected-dial-code {
    margin-bottom: 2px;
}
.iti__search-input {
    height: 40px;
    font-size: 16px;
}

/* Le calcul anti-robot ne demande aucune action : le widget est masqué, mais
   doit rester rendu pour produire son jeton. */
altcha-widget {
    display: none;
}

/* Champ piège : hors de l'écran, mais présent dans le formulaire. */
.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    background-color: rgba(0, 0, 0, .55);
    width: 100%;
    height: 100%;
    z-index: 10;
    align-items: center;
    justify-content: center;
    padding: 18px;
    box-sizing: border-box;
}
.modal.is-open {
    display: flex;
    animation: fade-in .18s ease;
}
.modal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 400px;
    box-sizing: border-box;
    padding: 26px 22px;
    background-color: #ffffff;
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, .3);
    animation: rise-in .18s ease;
}
.modal-content h3 {
    font-size: 1.5em;
    text-transform: uppercase;
    margin: 0 0 12px;
}
.modal-content p {
    font-size: 1.05em;
    line-height: 1.5;
    text-align: center;
    margin: 0;
}
.modal-content .modal-buttons {
    width: 100%;
    display: flex;
    gap: 12px;
    margin-top: 24px;
}
.modal-status {
    margin: 16px 0 0;
    font-size: .95em;
    line-height: 1.5;
    text-align: center;
    color: #96122f;
}
button.btn:disabled {
    opacity: .6;
    cursor: default;
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes rise-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

/* Les animations disparaissent si le système en fait la demande. */
@media (prefers-reduced-motion: reduce) {
    .modal.is-open,
    .modal-content,
    .field-error.is-shaken {
        animation: none;
    }
    button.btn, a.btn, #sms_request_phoneNumber {
        transition: none;
    }
}

/* Messages : dans le flux de la carte, pour ne rien recouvrir et pouvoir
   s'étendre sur plusieurs lignes. */
.card .alert {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 18px;
    line-height: 1.45;
    text-align: center;
}
.card .alert.alert-success {
    background-color: #e3f4ed;
    color: #005c40;
}
.card .alert.alert-danger {
    background-color: #fdeaee;
    color: #96122f;
}

@media (max-width: 420px) {
    .landing {
        padding: 22px 14px;
    }
    h1 {
        font-size: 1.65em;
    }
    .card {
        padding: 20px 16px;
    }
    .modal-content .modal-buttons {
        flex-direction: column-reverse;
    }
}






/* Connexion à l'administration */
.login-form {
    align-items: stretch;
}
.login-form label {
    font-weight: 600;
    font-size: .92em;
    margin-bottom: 6px;
}
.login-form label + input {
    margin-bottom: 16px;
}
.login-form input {
    padding: 12px;
    font-size: 16px;
    border: 1px solid #c4c4c4;
    border-radius: 8px;
    transition: border-color .18s ease;
}
.login-form input:focus {
    outline: none;
    border-color: #367fc2;
}
.login-form button {
    margin-top: 8px;
}

/* ══ Interface d'administration ══
   Outil de gestion : fond neutre, pleine largeur, lignes denses. */
body.admin-page {
    height: auto;
    overflow: auto;
    background-color: #ffffff;
    color: #1a1a1a;
}
body.admin-page form {
    display: block;
    width: auto;
}

.admin-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 18px 32px;
    border-bottom: 2px solid #1a1a1a;
}
.admin-header h1 {
    font-size: 1.6em;
    margin: 0;
    letter-spacing: 0;
    font-weight: bold;
    text-transform: uppercase;
}
.admin-header h1 span {
    font-weight: 400;
    text-transform: none;
    font-size: 0.65em;
    color: #666;
    margin-left: 8px;
}
.admin-logout {
    color: #1a1a1a;
    font-size: 0.95em;
}

.admin-main {
    padding: 24px 32px 60px;
}

/* Chiffres clés */
.admin-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 28px;
}
.admin-stats div {
    flex: 1 1 140px;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 14px 16px;
}
.admin-stats strong {
    display: block;
    font-size: 1.9em;
    line-height: 1.1;
}
.admin-stats span {
    font-size: 0.9em;
    color: #666;
}

/* État du service, visible à chaque visite : une mauvaise date ne produit
   aucune erreur, seule cette bande le signale. */
.admin-period {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    margin-bottom: 24px;
    border-radius: 6px;
    border: 1px solid;
}
.admin-period.is-open {
    border-color: #b7e0d0;
    background-color: #f0f9f5;
}
.admin-period.is-closed {
    border-color: #f0c2ce;
    background-color: #fdf3f5;
}
.admin-period-state strong {
    display: block;
    font-size: 1.05em;
}
.admin-period.is-open .admin-period-state strong {
    color: #005c40;
}
.admin-period.is-closed .admin-period-state strong {
    color: #96122f;
}
.admin-period-state span {
    font-size: .9em;
    color: #555;
}
.admin-period-form {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: .9em;
}
.admin-period-form input {
    padding: 7px 10px;
    border: 1px solid #bbb;
    border-radius: 4px;
    font-family: inherit;
}

.admin-stats div.is-expired {
    border-color: #f0c2ce;
    background-color: #fdf3f5;
}
.admin-stats div.is-expired strong {
    color: #96122f;
}

/* Rappel permanent tant que des données dépassent la durée de conservation. */
.admin-purge {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    padding: 14px 16px;
    margin-bottom: 28px;
    border: 1px solid #f0c2ce;
    background-color: #fdf3f5;
    border-radius: 6px;
    font-size: .95em;
}

/* Formulaires */
.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    margin-bottom: 28px;
}
.admin-form {
    flex: 1 1 320px;
}
.admin-form label {
    display: block;
    font-weight: 600;
    font-size: 0.9em;
    margin-bottom: 6px;
}
.admin-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.admin-row input[type="text"] {
    flex: 1 1 220px;
    padding: 9px 12px;
    font-size: 15px;
    border: 1px solid #bbb;
    border-radius: 4px;
}
/* Le sélecteur de pays hérite sinon de la hauteur de la page d'accueil. */
.admin-page .iti {
    flex: 1 1 240px;
}
.admin-page .iti.iti--allow-dropdown.iti--show-flags {
    height: auto;
    width: auto;
    font-size: 15px;
}
.admin-page .iti input[type="text"] {
    width: 100%;
}
.admin-page .btn {
    padding: 9px 16px !important;
    border-radius: 4px;
    font-size: 0.9em;
}
.admin-page .btn.btn-secondary {
    background-color: #ffffff !important;
    color: #1a1a1a !important;
    border: 1px solid #bbb;
}
.admin-clear {
    color: #666;
    font-size: 0.9em;
}
.admin-hint {
    margin: 8px 0 0;
    font-size: 0.85em;
    color: #666;
    line-height: 1.5;
}
.admin-hint code {
    background-color: #f4f4f4;
    padding: 1px 5px;
    border-radius: 3px;
}

/* Filtres */
.admin-filters {
    display: flex;
    align-items: center;
    gap: 4px;
    border-bottom: 1px solid #ddd;
    margin-bottom: 4px;
}
.admin-filters a {
    padding: 8px 14px;
    color: #666;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.admin-filters a.is-active {
    color: #1a1a1a;
    font-weight: 600;
    border-bottom-color: #1a1a1a;
}
.admin-count {
    margin-left: auto;
    font-size: 0.9em;
    color: #666;
}

/* Tableau */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}
.admin-table th {
    text-align: left;
    font-size: 0.78em;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #666;
    padding: 12px 10px;
    border-bottom: 1px solid #ddd;
}
.admin-table td {
    padding: 11px 10px;
    border-bottom: 1px solid #eee;
    text-align: left;
}
.admin-table tr:hover td {
    background-color: #fafafa;
}
.admin-table code {
    font-size: 0.92em;
    color: #444;
}
.admin-empty {
    color: #666;
    padding: 30px 10px !important;
}

.badge {
    display: inline-block;
    font-size: 0.8em;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
}
.badge.is-available {
    background-color: #e6f4ef;
    color: #00714f;
}
.badge.is-used {
    background-color: #f0f0f0;
    color: #555;
}

.admin-obsolete {
    font-size: 0.8em;
    color: #b0173a;
    margin-left: 6px;
}

.copy {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1em;
    color: #666;
    padding: 2px 6px;
}
.copy:hover {
    color: #1a1a1a;
}
.copy.is-copied {
    color: #00714f;
}

.admin-page .btn.delete {
    background-color: transparent !important;
    color: #999 !important;
    padding: 4px 8px !important;
    font-size: 1em;
}
.admin-page .btn.delete:hover {
    color: #df204d !important;
}

.admin-page .alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    word-break: break-all;
}
.admin-page .alert.alert-success {
    background-color: #e6f4ef;
    color: #00714f;
}
.admin-page .alert.alert-danger {
    background-color: #fdeaee;
    color: #b0173a;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 24px;
    font-size: 0.95em;
}

@media screen and (max-width: 760px) {
    .admin-header,
    .admin-main {
        padding-left: 16px;
        padding-right: 16px;
    }
    .admin-table thead {
        display: none;
    }
    .admin-table tr {
        display: block;
        border-bottom: 2px solid #ddd;
        padding: 8px 0;
    }
    .admin-table td {
        display: flex;
        justify-content: space-between;
        gap: 16px;
        border: none;
        padding: 5px 0;
    }
    .admin-table td::before {
        content: attr(data-label);
        font-size: 0.78em;
        text-transform: uppercase;
        color: #666;
    }
}
