/* ============================================================
   Borne Visiteur — Ministère de la Transition Numérique (MTND)
   Couleurs : Drapeau de Côte d'Ivoire
   ============================================================ */

:root {
    --ci-orange:       #FF8200;
    --ci-orange-dark:  #D96E00;
    --ci-orange-darker: #B85E00;
    --ci-orange-light: #FFF0E0;
    --ci-orange-bg:    #FFF5EC;
    --ci-green:        #009E2C;
    --ci-green-light:  #E6F7EB;
    --ci-white:        #FFFFFF;
    --ci-text:         #1F2937;
    --ci-text-light:   #6B7280;
    /* Bordures neutres au repos ; l'accent orange n'apparaît qu'au focus/hover */
    --ci-border:       #D9DCE1;
    --ci-field-bg:     #FFFFFF;
    --ci-page-bg:      #F4F5F7;
    --ci-error:        #C0392B;
    --ci-error-bg:     #FDECEA;
    --radius:          12px;
    --card-radius:     14px;
    --shadow:          0 2px 12px rgba(17, 24, 39, 0.06);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.kiosk-body {
    background: var(--ci-page-bg);
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 16px 56px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                 'Helvetica Neue', Arial, sans-serif;
    color: var(--ci-text);
}

/* ---- Conteneur principal : carte blanche délimitée ---- */
.kiosk-container {
    background: var(--ci-white);
    border: 1px solid #E3E5E9;
    border-radius: var(--card-radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 640px;
    padding: 40px 44px;
}

.kiosk-container-success {
    max-width: 560px;
    text-align: center;
}

/* ---- Bande drapeau en haut de page ---- */
.kiosk-body::before {
    content: '';
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(to right, var(--ci-orange) 33.3%, var(--ci-white) 33.3%, var(--ci-white) 66.6%, var(--ci-green) 66.6%);
    z-index: 100;
}

.kiosk-container::before {
    display: none;
}

/* ---- En-tête ---- */
.kiosk-header {
    text-align: center;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid #E3E5E9;
}

.kiosk-logo {
    text-align: center;
    margin-bottom: 12px;
}

.kiosk-logo-img {
    max-width: 280px;
    width: 100%;
    height: auto;
    vertical-align: middle;
}

.kiosk-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--ci-orange);
    line-height: 1.3;
}

.kiosk-subtitle {
    font-size: 16px;
    color: var(--ci-text-light);
    margin-top: 2px;
}

.kiosk-divider {
    width: 60px;
    height: 3px;
    background: linear-gradient(to right, var(--ci-orange), var(--ci-green));
    margin: 18px auto;
    border-radius: 2px;
}

.kiosk-form-title {
    font-size: 16px;
    color: var(--ci-text);
    font-weight: 600;
}

/* Légende « * Informations obligatoires » : discrète, juste avant le bouton */
.kiosk-legend {
    font-size: 12px;
    color: var(--ci-text-light);
    opacity: 0.7;
    margin: 4px 0 12px;
}

.kiosk-palier-name {
    font-size: 16px;
    color: var(--ci-orange);
    font-weight: 700;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ---- Alertes ---- */
.kiosk-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;
}

.kiosk-alert-error {
    background: var(--ci-error-bg);
    color: var(--ci-error);
    border-left: 3px solid var(--ci-error);
}

.kiosk-alert-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    display: inline-flex;
}

.kiosk-alert-icon svg {
    width: 18px;
    height: 18px;
}

/* ---- Formulaire ---- */
.kiosk-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.kiosk-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ci-orange-dark);
    border-bottom: 1px solid #E3E5E9;
    padding-bottom: 8px;
    margin-top: 4px;
    margin-bottom: 4px;
}

.kiosk-optional-title {
    color: var(--ci-text-light);
    border-color: #EEEEEE;
}

.kiosk-optional-label {
    font-size: 11px;
    font-weight: 400;
    text-transform: none;
    color: #BBBBBB;
    letter-spacing: 0;
}

.kiosk-field-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.kiosk-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.kiosk-field label {
    font-size: 14px;
    font-weight: 600;
    color: var(--ci-text);
}

.kiosk-required {
    color: var(--ci-orange);
    margin-left: 2px;
}

.kiosk-input {
    width: 100%;
    padding: 11px 14px;
    font-size: 16px;
    border: 1px solid var(--ci-border);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    color: var(--ci-text);
    background: var(--ci-field-bg);
}

.kiosk-input::placeholder {
    color: #9CA3AF;
}

/* Accent orange UNIQUEMENT au focus */
.kiosk-input:focus {
    border-color: var(--ci-orange);
    box-shadow: 0 0 0 3px rgba(255, 130, 0, 0.15);
    background: var(--ci-white);
}

/* N° Badge : même gabarit que les autres champs, juste un peu appuyé */
.kiosk-input-large {
    font-weight: 600;
    letter-spacing: 0.04em;
}

.kiosk-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23FF8200' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

.kiosk-textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

/* ---- Bouton de validation : plat, plein, sans ombre diffuse ---- */
.kiosk-submit-zone {
    margin-top: 20px;
}

.kiosk-btn-submit {
    display: block;
    width: 100%;
    background: var(--ci-orange);
    color: var(--ci-white);
    border: 1px solid var(--ci-orange);
    border-radius: 8px;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
    box-shadow: none;
}

.kiosk-btn-submit:hover,
.kiosk-btn-submit:focus {
    background: var(--ci-orange-dark);
    border-color: var(--ci-orange-dark);
    box-shadow: none;
}

.kiosk-btn-submit:active {
    background: var(--ci-orange-darker);
}

/* ---- Page de confirmation ---- */
.kiosk-success-card {
    background: #F6FAF7;
    border: 1px solid #E3E5E9;
    border-radius: var(--radius);
    padding: 32px 36px;
    margin: 20px 0;
}

.kiosk-success-icon {
    margin: 0 auto 14px;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ci-green);
}

.kiosk-success-icon svg {
    width: 56px;
    height: 56px;
}

.kiosk-success-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--ci-green);
    margin-bottom: 6px;
}

.kiosk-success-civility {
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: var(--ci-text-light);
    margin-bottom: 2px;
}

.kiosk-success-name {
    font-size: 22px;
    font-weight: 600;
    color: var(--ci-orange);
    text-align: center;
    margin-bottom: 18px;
}

.kiosk-badge-display {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--ci-orange);
    color: var(--ci-white);
    border-radius: 8px;
    padding: 10px 24px;
    margin-bottom: 24px;
}

.kiosk-badge-label {
    font-size: 13px;
    opacity: 0.85;
}

.kiosk-badge-number {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.kiosk-success-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    text-align: left;
}

.kiosk-detail-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    color: var(--ci-text);
}

.kiosk-detail-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.kiosk-success-message {
    font-size: 15px;
    color: var(--ci-text-light);
    line-height: 1.6;
    margin-bottom: 28px;
}

.kiosk-btn-new {
    display: inline-block;
    background: var(--ci-orange);
    color: var(--ci-white);
    text-decoration: none;
    border-radius: 8px;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    transition: background-color 0.15s ease;
}

.kiosk-btn-new:hover {
    background: var(--ci-orange-dark);
    color: var(--ci-white);
    text-decoration: none;
}

/* ---- Pied de page ---- */
.kiosk-footer {
    margin-top: 28px;
    text-align: center;
    font-size: 12px;
    color: #BBBBBB;
    line-height: 1.5;
}

/* ---- Responsive tablette ---- */
@media (max-width: 768px) {
    .kiosk-container {
        padding: 28px 22px;
    }

    .kiosk-body {
        padding: 24px 12px 44px;
        align-items: stretch;
    }

    .kiosk-title {
        font-size: 18px;
    }

    .kiosk-form-title {
        font-size: 19px;
    }
}

/* ---- Responsive mobile ---- */
@media (max-width: 480px) {
    .kiosk-container {
        padding: 20px 16px;
    }

    .kiosk-field-group {
        grid-template-columns: 1fr;
    }

    .kiosk-title {
        font-size: 15px;
    }

    .kiosk-subtitle {
        font-size: 13px;
    }

    .kiosk-form-title {
        font-size: 17px;
    }

    .kiosk-logo {
        font-size: 38px;
    }

    .kiosk-input {
        font-size: 16px;
        padding: 12px 14px;
    }

    .kiosk-input-large {
        font-size: 18px;
    }

    .kiosk-btn-submit {
        width: 100%;
        padding: 16px;
        font-size: 16px;
    }

    .kiosk-section-title {
        font-size: 12px;
    }

    .kiosk-field label {
        font-size: 13px;
    }

    /* Page confirmation mobile */
    .kiosk-success-card {
        padding: 24px 16px;
    }

    .kiosk-success-title {
        font-size: 22px;
    }

    .kiosk-success-name {
        font-size: 18px;
    }

    .kiosk-badge-number {
        font-size: 18px;
    }

    .kiosk-btn-new {
        width: 100%;
        text-align: center;
        padding: 14px 20px;
    }
}

/* ---- Bouton plein écran ---- */
.kiosk-fullscreen-footer {
    text-align: center;
    margin-top: 12px;
    padding-bottom: 16px;
}

.kiosk-btn-fullscreen {
    background: transparent;
    color: var(--ci-text-light);
    border: 1px solid var(--ci-border);
    border-radius: 8px;
    width: 44px;
    height: 44px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.kiosk-btn-fullscreen svg {
    width: 18px;
    height: 18px;
}

.kiosk-btn-fullscreen:hover {
    background: var(--ci-orange);
    border-color: var(--ci-orange);
    color: #fff;
}

/* ---- Barre QR Code centrée ---- */
.kiosk-qr-footer {
    text-align: center;
    margin-top: 20px;
}

/* ---- Bouton QR Code ---- */
.kiosk-btn-qr {
    background: transparent;
    color: var(--ci-text-light);
    border: 1px solid var(--ci-border);
    border-radius: 8px;
    padding: 0 18px;
    height: 44px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.kiosk-btn-qr svg {
    width: 16px;
    height: 16px;
}

.kiosk-btn-qr:hover {
    background: var(--ci-orange);
    border-color: var(--ci-orange);
    color: #fff;
}

/* ---- QR Code Modal ---- */
.kiosk-qr-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    align-items: center;
    justify-content: center;
}

.kiosk-qr-modal-content {
    background: #fff;
    border-radius: 16px;
    padding: 32px 40px;
    text-align: center;
    max-width: 360px;
    width: 90%;
    position: relative;
    box-shadow: 0 8px 40px rgba(0,0,0,0.2);
}

.kiosk-qr-modal-content h3 {
    font-size: 18px;
    color: var(--ci-text);
    margin-bottom: 20px;
}

.kiosk-qr-img {
    width: 240px;
    height: 240px;
    margin: 0 auto 16px;
    display: block;
}

.kiosk-qr-url {
    font-size: 12px;
    color: var(--ci-text-light);
    word-break: break-all;
    margin-top: 8px;
}

.kiosk-qr-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #999;
    padding: 4px 8px;
    line-height: 1;
}

.kiosk-qr-close:hover {
    color: var(--ci-text);
}

/* ---- Pop-up « nouvel enregistrement » (écran partagé d'un palier, live) ---- */
.kiosk-live-toasts {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 300px;
    max-width: calc(100vw - 32px);
}

.kiosk-live-toast {
    position: relative;
    background: var(--ci-white);
    border: 1px solid var(--ci-border);
    border-left: 3px solid var(--ci-green);
    border-radius: 10px;
    padding: 14px 32px 14px 16px;
    box-shadow: 0 8px 24px rgba(17, 24, 39, .14);
    animation: kiosk-toast-in .18s ease-out;
}

.kiosk-live-toast-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--ci-green);
    margin-bottom: 4px;
}

.kiosk-live-toast-body {
    font-size: 14px;
    font-weight: 600;
    color: var(--ci-text);
}

.kiosk-live-toast-close {
    position: absolute;
    top: 6px;
    right: 6px;
    background: transparent;
    border: none;
    color: #9CA3AF;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    padding: 6px;
}

.kiosk-live-toast-close:hover {
    color: var(--ci-text);
}

@keyframes kiosk-toast-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: none; }
}

/* Écran partagé / desktop uniquement : pas de pop-up sur mobile */
@media (max-width: 768px) {
    .kiosk-live-toasts { display: none; }
}
