﻿/* ===========================
   Global Layout
   =========================== */
/* Pendant de login.css : le theme vient de l'URL, pas du cookie. color-scheme force les
   controles natifs en sombre meme si app.css a pose data-theme="light" sur <html>. */
body {
    margin: 0;
    color-scheme: dark;
    background-color: #171717;
    background-image: url("/images/bg3dark.jpg") !important;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-top: 0;
    color: rgb(145, 145, 145); /* subtle gray text */
}

/* ===========================
   Card Container
   =========================== */
.card {
    position: relative; /* required for overlay */
    width: 400px;
    background-color: #212121; /* Dark card background */
    border-radius: 8px;
    box-shadow: 0px 8px 25px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    color: rgb(145, 145, 145);
}

    /* Pattern overlay inside card */
    .card.bg-pattern::before {
        content: "";
        position: absolute;
        inset: 0;
        background-image: url("/images/bg-pattern-2.png");
        background-size: cover;
        background-position: center;
        opacity: 0.08; /* faint */
        pointer-events: none;
    }

    .card > * {
        position: relative;
        z-index: 1; /* keep content above overlay */
    }

/* ===========================
   Logo
   =========================== */
.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 32px;
}

    .logo-container img {
        width: 140px;
        height: 140px;
        object-fit: contain;
    }

/* ===========================
   Header
   =========================== */
.card-header {
    margin-top: 8px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100px;
}

    .card-header h5 {
        padding: 4px;
        font-size: 1rem;
        font-weight: 500;
        text-align: center;
        color: #ffffff; /* brighter title */
    }

    .card-header small {
        margin-top: 4px;
        color: rgb(145, 145, 145);
    }

/* ===========================
   Card Content
   =========================== */
.card-content {
    padding: 24px;
}

/* ===========================
   Form Inputs
   =========================== */
.form-group {
    margin-bottom: 16px;
    position: relative;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 8px 36px 8px 12px;
    border: 1px solid #333;
    border-radius: 4px;
    font-size: 1rem;
    background-color: #171717;
    color: #e0e0e0;
}

input::placeholder {
    color: #777;
}

input:focus {
    outline: none;
    border-color: #00b358; /* green highlight */
}

/* Password toggle icon */
.password-toggle-icon {
    position: absolute;
    right: 10px;
    top: 10px;
    cursor: pointer;
}

/* ===========================
   Checkbox
   =========================== */
.checkbox-group {
    display: flex;
    align-items: center;
    margin-top: 12px;
}

    .checkbox-group input {
        margin-right: 8px;
    }

/* ===========================
   Buttons
   =========================== */
button {
    width: 100%;
    padding: 10px 12px;
    background-color: #00b358; /* Green accent */
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.3s ease;
}

    button:hover {
        background-color: #018136;
    }

/* Spinner inside button */
.spinner-border {
    width: 1rem;
    height: 1rem;
    border: 2px solid #fff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.show {
    display: inline-block;
}

/* ===========================
   Messages & Validation
   =========================== */
.error {
    font-size: 10pt;
    color: #ff6b6b;
    margin-bottom: 0.9rem;
}

.message {
    text-align: center;
    margin-top: 12px;
    font-size: 0.9rem;
}

    .message.info {
        color: #00b358;
    }

    .message.error {
        color: #ff6b6b;
    }

    .message.success {
        color: #4caf50;
    }

/* ===========================
   Footer
   =========================== */
.footer {
    margin-top: 24px;
    text-align: center;
    font-size: 0.9rem;
    color: rgb(145, 145, 145);
    background-color: #171717;
    border-top: 1px solid #333;
}

    .footer a {
        text-decoration: none;
        color: inherit;
    }

    .suggestions-list {
        position: absolute;
        top: 100%; /* Position it right below the input */
        left: 0;
        right: 0;
        background-color: #212121;
        border: 1px solid #333;
        border-top: none;
        border-radius: 0 0 4px 4px;
        box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.5);
        z-index: 1000; /* Ensure it appears above other elements */
        max-height: 200px;
        overflow-y: auto;
    }

    .suggestion-item {
        padding: 10px 12px;
        cursor: pointer;
        font-size: 1rem;
        color: #e0e0e0;
    }

    .suggestion-item:hover {
        background-color: #333;
    }

    .suggestion-item strong {
        font-weight: 600; /* Make the domain part bold */
        color: #ffffff;
    }
    .suggestion-item.suggestion-active {
        background-color: #00b358;
        color: #ffffff;
    }

        /* --- Customize Browser Autofill Styles --- */
    input:-webkit-autofill,
    input:-webkit-autofill:hover,
    input:-webkit-autofill:focus,
    input:-webkit-autofill:active {
        /* Set the text color */
        -webkit-text-fill-color: #e0e0e0; /* Your desired text color */
        /* Set the background color */
        -webkit-box-shadow: 0 0 0px 1000px #2e2d2d inset; /* Your desired background color */
        /* Optional: Transition for a smoother effect */
        transition: background-color 5000s ease-in-out 0s;
    }

    /* ===========================
       Theme Toggle Button
       =========================== */
    .theme-toggle-container {
        position: absolute;
        top: 16px;
        right: 16px;
        z-index: 10;
    }

    .theme-toggle-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background-color: rgba(128, 128, 128, 0.2);
        cursor: pointer;
        transition: background-color 0.3s ease;
        border: 1px solid transparent;
    }

    .theme-toggle-btn:hover {
        background-color: rgba(128, 128, 128, 0.4);
        border-color: #444;
    }

    .theme-toggle-btn svg {
        width: 20px;
        height: 20px;
        stroke: #919191; /* subtle gray icon color */
    }
/* ===========================
   Connexion par carte d'accès + code PIN (option Carte_Acces_PIN)
   =========================== */
.separateur { display: flex; align-items: center; gap: 12px; margin: 20px 0 4px; color: #777; font-size: .85rem; }
.separateur::before, .separateur::after { content: ""; flex: 1; height: 1px; background: #333; }
button.carte-toggle { background: transparent; color: #00b358; border: 1px solid #00b358; margin-top: 12px; }
button.carte-toggle:hover { background: rgba(0, 179, 88, .12); }
.carte-form { display: none; margin-top: 16px; }
.carte-form.ouvert { display: block; }
.carte-form .pin-label { font-size: .85rem; color: #bbb; margin: 12px 0 8px; text-align: center; }
input.pwd-mask { -webkit-text-security: disc; }
.pin-boxes { display: flex; gap: 12px; justify-content: center; }
.pin-boxes input.pin-box {
    width: 52px; height: 60px; padding: 0; box-sizing: border-box;
    border: 2px solid #333; border-radius: 12px; text-align: center;
    font-size: 1.75rem; font-weight: 600; background: #171717; color: #e0e0e0;
    -webkit-text-security: disc; caret-color: #00b358; transition: border-color .15s, box-shadow .15s;
}
.pin-boxes input.pin-box:focus { outline: none; border-color: #00b358; box-shadow: 0 0 0 3px rgba(0, 179, 88, .2); }

/* Second facteur : six cases plus étroites, lien secondaire, zone du code de récupération */
.pin-boxes.six { gap: 8px; }
.pin-boxes.six input.pin-box { width: 44px; height: 54px; font-size: 1.5rem; }
a.lien { display: block; text-align: center; margin-top: 14px; font-size: .9rem; color: #00b358; cursor: pointer; text-decoration: underline; }
.zone-recup { display: none; margin-top: 12px; }
.zone-recup.ouvert { display: block; }
