/*
 * ETP App Style — Charte TMSX / SmartAdmin 5.5 inspired
 * Pages publiques : connexion, mot de passe oublié, etc.
 *
 * Palette : Rouge #e74e3e | Vert #34a647 | Sombre #1e2228 | Gris #616161 | Cyan #4acad5
 */

/* --- Full-page dark background --- */
html#extr-page,
html#extr-page body {
    background: linear-gradient(135deg, #1e2228 0%, #252830 50%, #2c3038 100%) !important;
    min-height: 100vh !important;
    overflow-x: hidden;
}

/* --- Vanta.js animated background --- */
#vanta-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* --- Reset SmartAdmin default login layout --- */
html#extr-page #main,
#extr-page #main {
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 100vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative;
    z-index: 1;
}

html#extr-page #content,
#extr-page #content {
    width: 100% !important;
    max-width: 440px !important;
    padding: 20px !important;
}

/* --- Hide SmartAdmin default hero/left panel --- */
#extr-page .hero,
#extr-page .login-header-big,
#extr-page .about-heading,
#extr-page .login-desc-box-l {
    display: none !important;
}

/* --- Override SmartAdmin container/well --- */
#extr-page .container {
    width: auto !important;
    max-width: 440px !important;
    border: none !important;
}

#extr-page .well {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

/* --- Header connexion (navbar) --- */
#header-connexion {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    height: 64px;
    padding: 0 30px;
    margin: 0;
    border: none !important;
    background: transparent !important;
    display: flex;
    align-items: center;
}

#header-connexion img {
    width: 160px;
    height: auto;
}

/* --- Login card (translucent dark) --- */
.auth-card {
    background: rgba(30, 34, 40, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 40px 35px;
    color: #ffffff;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    animation: authFadeIn 0.5s ease-out;
}

@keyframes authFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.auth-card .auth-logo {
    text-align: center;
    margin-bottom: 30px;
}

.auth-card .auth-logo img {
    width: 180px;
    height: auto;
}

.auth-card .auth-title {
    font-size: 22px;
    font-weight: 600;
    color: #ffffff;
    text-align: center;
    margin-bottom: 6px;
}

.auth-card .auth-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    margin-bottom: 28px;
}

/* --- Form fields --- */
.auth-card .auth-field {
    margin-bottom: 20px;
}

.auth-card .auth-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 6px;
}

.auth-card .auth-field input[type="email"],
.auth-card .auth-field input[type="password"],
.auth-card .auth-field input[type="text"] {
    display: block;
    width: 100%;
    height: 44px;
    padding: 8px 14px;
    font-size: 15px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    box-sizing: border-box;
}

.auth-card .auth-field input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.auth-card .auth-field input:focus {
    border-color: #e74e3e;
    background: rgba(255, 255, 255, 0.12);
}

/* --- Submit button --- */
.auth-card .auth-submit {
    display: block;
    width: 100%;
    height: 46px;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    background: rgba(231, 78, 62, 0.8);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    margin-top: 6px;
}

.auth-card .auth-submit:hover {
    background: #e74e3e;
    transform: translateY(-1px);
}

.auth-card .auth-submit:active {
    transform: translateY(0);
}

.auth-card .auth-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* --- Links --- */
.auth-card a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: color 0.2s;
}

.auth-card a:hover,
.auth-card a:focus {
    color: #ffffff;
    text-decoration: none;
}

.auth-card .auth-link {
    display: block;
    text-align: center;
    margin-top: 18px;
    font-size: 13px;
}

.auth-card .auth-link-forgot {
    text-align: right;
    margin-top: -10px;
    margin-bottom: 20px;
    font-size: 13px;
}

/* --- Secondary button --- */
.auth-card .auth-btn-secondary {
    display: inline-block;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.auth-card .auth-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    text-decoration: none;
}

/* --- Alerts inside card --- */
.auth-card .alert {
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.auth-card .alert-danger {
    background: rgba(244, 66, 54, 0.15);
    border: 1px solid rgba(244, 66, 54, 0.3);
    color: #ff8a80;
}

.auth-card .alert-success {
    background: rgba(52, 166, 71, 0.15);
    border: 1px solid rgba(52, 166, 71, 0.3);
    color: #81c784;
}

.auth-card .alert-warning {
    background: rgba(255, 193, 7, 0.15);
    border: 1px solid rgba(255, 193, 7, 0.3);
    color: #ffd54f;
}

.auth-card .alert .close {
    color: inherit;
    opacity: 0.6;
    text-shadow: none;
}

/* --- Divider --- */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: rgba(255, 255, 255, 0.25);
    font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.auth-divider span {
    padding: 0 12px;
}

/* --- Footer note --- */
.auth-card .auth-footer {
    text-align: center;
    margin-top: 28px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.3);
}

/* --- Success state --- */
.auth-card .auth-success-icon {
    text-align: center;
    font-size: 56px;
    color: #34a647;
    margin-bottom: 15px;
}


/* --- Responsive --- */
@media (max-width: 480px) {
    .auth-card {
        padding: 30px 22px;
        border-radius: 12px;
    }
    .auth-card .auth-title {
        font-size: 19px;
    }
    #header-connexion {
        padding: 0 15px;
    }
    #header-connexion img {
        width: 130px;
    }
}

/* --- Accueil : grille de boutons carrés --- */
html#extr-page #content.accueil-content,
#extr-page #content.accueil-content {
    max-width: 600px !important;
    width: 100% !important;
}

.accueil-card {
    max-width: 100%;
    padding: 40px 30px;
}

.accueil-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 10px;
    justify-items: center;
    max-width: 440px;
    margin-left: auto;
    margin-right: auto;
}

.accueil-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    min-height: 140px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.15s, color 0.2s;
}

.accueil-btn i {
    font-size: 42px;
    margin-bottom: 14px;
    color: #e74e3e;
    transition: transform 0.2s;
}

.accueil-btn:hover,
.accueil-btn:focus {
    background: rgba(231, 78, 62, 0.15);
    border-color: rgba(231, 78, 62, 0.5);
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-3px);
}

.accueil-btn:hover i {
    transform: scale(1.1);
}

.accueil-btn:active {
    transform: translateY(0);
}

/* Accueil responsive : 1 colonne sur mobile étroit */
@media (max-width: 380px) {
    .accueil-grid {
        grid-template-columns: 1fr;
    }
}

/* Accueil responsive : tablette — max 3 colonnes */
@media (min-width: 768px) {
    .accueil-content {
        max-width: 700px !important;
    }
    .accueil-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* --- Toggle Super Admin : bouton bascule desktop/mobile sur accueil.php --- */
.accueil-toggle-admin {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.7);
    font-size: 20px;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    z-index: 10;
}

.accueil-toggle-admin:hover {
    background: rgba(231, 78, 62, 0.3);
    color: #fff;
    text-decoration: none;
}

/* --- Wizard Checklist (interface mobile) --- */

/* En-tête d'étape */
.wizard-step-header {
    text-align: center;
    margin-bottom: 25px;
}

.wizard-step-badge {
    display: inline-block;
    background: rgba(231, 78, 62, 0.2);
    color: #e74e3e;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 4px 14px;
    border-radius: 20px;
    margin-bottom: 12px;
}

.wizard-step-title {
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.wizard-step-subtitle {
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

/* Sections */
.wizard-section {
    margin-bottom: 20px;
}

/* Boutons wizard */
.wizard-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    box-sizing: border-box;
}

.wizard-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
    text-decoration: none;
}

.wizard-btn-lg {
    padding: 20px;
    font-size: 17px;
    flex-direction: column;
    gap: 8px;
}

.wizard-btn-outline {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.6);
}

.wizard-btn-primary {
    background: rgba(52, 166, 71, 0.2);
    border-color: rgba(52, 166, 71, 0.4);
    color: #34a647;
}

.wizard-btn-primary:hover {
    background: rgba(52, 166, 71, 0.35);
    color: #fff;
}

.wizard-btn-success {
    background: #34a647;
    border-color: #34a647;
    color: #fff;
}

.wizard-btn-success:hover {
    background: #2d8e3d;
    transform: translateY(-2px);
}

.wizard-btn-danger {
    background: rgba(231, 78, 62, 0.15);
    border-color: rgba(231, 78, 62, 0.4);
    color: #e74e3e;
}

/* Input immatriculation */
.wizard-immat-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wizard-immat-input {
    display: block;
    width: 100%;
    padding: 18px 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 5px;
    text-transform: uppercase;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    font-family: monospace, 'Courier New', Courier;
}

.wizard-immat-input::placeholder {
    color: rgba(255, 255, 255, 0.2);
    letter-spacing: 8px;
    font-weight: 400;
}

.wizard-immat-input:focus {
    border-color: rgba(231, 78, 62, 0.6);
    box-shadow: 0 0 0 3px rgba(231, 78, 62, 0.15);
}

/* Séparateur */
.wizard-separator {
    text-align: center;
    color: rgba(255, 255, 255, 0.25);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    position: relative;
    margin: 25px 0;
}

.wizard-separator span {
    background: rgba(37, 40, 48, 0.95);
    padding: 0 15px;
    position: relative;
    z-index: 1;
}

.wizard-separator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

/* Carte véhicule trouvé */
.wizard-vehicule-card {
    background: rgba(30, 34, 40, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

/* Bandeau immatriculation en haut de la carte */
.wvt-header {
    background: rgba(231, 78, 62, 0.12);
    border-bottom: 1px solid rgba(231, 78, 62, 0.25);
    padding: 16px;
    text-align: center;
}

.wvt-header-immat {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 4px;
    color: #fff;
    font-family: monospace, 'Courier New', Courier;
}

.wvt-header-sub {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Lignes de détail sous le bandeau */
.wvt-details {
    padding: 8px 0;
}

.wvt-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.wvt-row:last-child {
    border-bottom: none;
}

.wvt-label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    font-weight: 400;
}

.wvt-value {
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    text-align: right;
    max-width: 60%;
    word-break: break-word;
}

.wvt-badge {
    display: inline-block;
    background: rgba(74, 202, 213, 0.15);
    color: #4acad5;
    padding: 5px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.wvt-badge-ambiant { background: rgba(150, 150, 150, 0.15); color: #aaa; }
.wvt-badge-mono    { background: rgba(52, 166, 71, 0.15);   color: #34a647; }
.wvt-badge-bi      { background: rgba(74, 202, 213, 0.15);  color: #4acad5; }
.wvt-badge-tri     { background: rgba(231, 78, 62, 0.15);   color: #e74e3e; }

/* Alerte erreur */
.wizard-alert-danger {
    background: rgba(231, 78, 62, 0.1);
    border: 1px solid rgba(231, 78, 62, 0.3);
    border-radius: 14px;
    padding: 16px;
    color: #e74e3e;
    font-size: 14px;
    margin-top: 20px;
    line-height: 1.5;
}

.wizard-alert-danger i {
    margin-right: 8px;
}

/* Label centré au-dessus d'un élément */
.wizard-label-center {
    text-align: center;
    color: rgba(255, 255, 255, 0.55);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

/* Bouton carré caméra QR */
.wizard-qr-zone {
    display: flex;
    justify-content: center;
}

.wizard-btn-square {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    min-height: 140px;
    width: 100%;
    max-width: 200px;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.5);
    font-size: 56px;
    cursor: pointer;
    transition: all 0.25s;
}

.wizard-btn-square:hover {
    border-color: rgba(231, 78, 62, 0.5);
    background: rgba(231, 78, 62, 0.08);
    color: #e74e3e;
    transform: scale(1.05);
}

.wizard-btn-square-active {
    border-color: #e74e3e;
    border-style: solid;
    background: rgba(231, 78, 62, 0.15);
    color: #e74e3e;
}

/* Select stylisé */
.wizard-select {
    display: block;
    width: 100%;
    padding: 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.wizard-select:focus {
    border-color: rgba(231, 78, 62, 0.6);
    box-shadow: 0 0 0 3px rgba(231, 78, 62, 0.12);
}

.wizard-select option {
    background: #2c3038;
    color: #fff;
    padding: 10px;
}

/* Loading spinner */
.wizard-loading {
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
    padding: 16px;
}

/* Alerte warning */
.wizard-alert-warning {
    background: rgba(255, 165, 0, 0.1);
    border: 1px solid rgba(255, 165, 0, 0.3);
    border-radius: 14px;
    padding: 16px;
    color: #ffa500;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
}

.wizard-alert-warning i {
    margin-right: 8px;
}

/* --- Bandeau véhicule actif --- */
.accueil-vehicule-bandeau {
    background: rgba(52, 166, 71, 0.12);
    border: 1px solid rgba(52, 166, 71, 0.3);
    border-radius: 12px;
    padding: 14px 16px;
    text-align: center;
}

.accueil-vehicule-immat {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 2px;
}

.accueil-vehicule-immat i {
    color: #34a647;
    margin-right: 8px;
}

.accueil-vehicule-info {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 4px;
}

/* --- EDL Mobile : en-tête --- */
.edl-mobile-immat {
    text-align: center;
    font-size: 32px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 5px;
    font-family: monospace, 'Courier New', Courier;
    margin-bottom: 8px;
}

.edl-mobile-posname {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: #e74e3e;
    margin-bottom: 15px;
}

.edl-mobile-poscount {
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    margin: 8px 0 0 0;
    letter-spacing: 1px;
}

/* --- EDL Mobile : contenu --- */

.edl-preview-container {
    width: 100%;
    aspect-ratio: 4 / 3;
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
}

.edl-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 14px;
}

.edl-no-photo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.25);
    font-size: 14px;
}

.edl-no-photo i {
    font-size: 48px;
}

.edl-textarea {
    display: block;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 14px;
    outline: none;
    resize: vertical;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.edl-textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.edl-textarea:focus {
    border-color: rgba(231, 78, 62, 0.5);
}

.edl-nav {
    display: flex;
    gap: 10px;
}

.edl-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.edl-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    transition: all 0.2s;
}

.edl-dot-active {
    background: #e74e3e !important;
    transform: scale(1.3);
}

/* --- Highlight table (pages internes) --- */
td.highlight {
    font-weight: bold;
    color: #e74e3e;
}
