
/* =============================
   Login – redesign complet
   Utilise logo.jpg existant
   ============================= */

/* Important:
   - scoper le design uniquement sur la page login
   - éviter que .container bootstrap limite la largeur
*/

body.gs-login-page {
    background: #0b1220;
}

/* Animations légères (désactivables via OS setting) */
@media (prefers-reduced-motion: no-preference) {
    .gs-login__brand {
        animation: gsFadeDown .55s ease both;
    }

    .gs-login__card {
        animation: gsFadeUp .60s ease both;
        animation-delay: .08s;
    }
}

@keyframes gsFadeDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes gsFadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* annule les marges/largeurs de .container pour la page login */
body.gs-login-page .container {
    width: 100% !important;
    padding: 0 !important;
}

body.gs-login-page .gs-login__container-reset {
    display: block;
    width: 100%;
}

.gs-login {
    position: relative;
    min-height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    margin: 0;
    padding: 0;
}

.gs-login__bg {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(11, 18, 32, 0.86), rgba(11, 18, 32, 0.50)),
        url('../logo.jpg');
    background-size: cover;
    background-position: center;
    filter: saturate(1.08);
}

/* Texture légère + vignette pour un rendu plus pro */
.gs-login__bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(1200px 600px at 50% 10%, rgba(37, 99, 235, 0.18), transparent 60%),
        radial-gradient(900px 500px at 10% 60%, rgba(22, 163, 74, 0.10), transparent 55%),
        radial-gradient(900px 500px at 90% 60%, rgba(245, 158, 11, 0.10), transparent 55%),
        radial-gradient(900px 700px at 50% 95%, rgba(0, 0, 0, 0.35), transparent 55%);
    pointer-events: none;
}

.gs-login__wrap {
    position: relative;
    z-index: 1;
    width: 100%;
    display: flex;
    justify-content: center;
    flex: 1;
    align-items: center;
    padding: 0 16px 28px;
}

.gs-login__panel {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    width: 100%;
    max-width: 560px;
}

.gs-login__brand {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 28px 36px;
    margin: 28px auto 36px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    max-width: 1100px;
    width: calc(100% - 40px);
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.25),
        0 2px 12px rgba(255, 255, 255, 0.1) inset;
    transition: all 0.3s ease;
}

.gs-login__brand:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 
        0 12px 48px rgba(0, 0, 0, 0.3),
        0 2px 12px rgba(255, 255, 255, 0.12) inset;
}

.gs-login__logo {
    width: 100px;
    height: 100px;
    border-radius: 20px;
    object-fit: cover;
    box-shadow: 
        0 16px 48px rgba(0, 0, 0, 0.4),
        0 0 0 3px rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease;
}

.gs-login__logo:hover {
    transform: scale(1.05);
}

.gs-login__titles {
    color: #fff;
    flex: 1;
}

.gs-login__title {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-shadow: 
        0 2px 12px rgba(0, 0, 0, 0.3),
        0 1px 3px rgba(0, 0, 0, 0.5);
    line-height: 1.3;
    margin-bottom: 8px;
}

.gs-login__subtitle {
    margin-top: 6px;
    color: rgba(255, 255, 255, 0.96);
    font-weight: 700;
    font-size: 23px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    line-height: 1.4;
}

.gs-login__desc {
    margin-top: 12px;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.90);
    font-size: 17px;
    max-width: 60ch;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
    font-weight: 500;
}

.gs-login__card {
    width: 100%;
    max-width: 680px;
    background: rgba(255, 255, 255, 0.99);
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 20px;
    box-shadow:
        0 32px 80px rgba(0, 0, 0, 0.48),
        0 2px 0 rgba(255, 255, 255, 0.4) inset;
    overflow: visible !important; /* Changé de hidden à visible pour voir la checkbox */
    max-height: none !important; /* Pas de limite de hauteur */
}

.gs-login__cardHead {
    padding: 32px 32px 28px;
    border-bottom: 2px solid rgba(23, 31, 48, 0.08);
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.08), rgba(255, 255, 255, 0));
}

.gs-login__cardTitle {
    margin: 0;
    font-weight: 800;
    color: #0b1220;
    text-align: center;
    font-size: 28px;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    line-height: 1.4;
}

.gs-login__form {
    padding: 32px 36px 24px;
}

/* Donne plus d'air aux champs Bootstrap */
.gs-login .form-group { 
    margin-bottom: 24px;
    display: block !important;
    visibility: visible !important;
}

/* S'assurer que la checkbox est visible */
.gs-login .form-group.gs-login__row {
    display: flex !important;
    visibility: visible !important;
}

.gs-login .input-group-addon {
    background: #f3f4f6;
    border-color: rgba(17, 24, 39, 0.14);
    padding: 16px 18px;
    font-size: 16px;
}

.gs-login .form-control {
    height: 58px;
    font-size: 17px;
    padding: 16px 18px;
    border-width: 2px;
}

.gs-login .form-control::placeholder {
    color: rgba(107, 114, 128, 0.75);
}

.gs-login .btn {
    height: 60px;
    font-size: 19px;
    font-weight: 700;
    border-radius: 12px;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.gs-login .btn-primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border: none;
}

.gs-login .btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.gs-login .btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.gs-login__label {
    display: inline-block;
    margin-bottom: 12px;
    color: #111827;
    font-weight: 700;
    font-size: 17px;
    letter-spacing: 0.2px;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
}

/* Focus plus moderne (sans casser Bootstrap) */
body.gs-login-page .form-control:focus {
    border-color: rgba(37, 99, 235, .60);
    box-shadow: 0 0 0 5px rgba(37, 99, 235, .18);
}

.gs-login__hint {
    margin-top: 16px;
    padding: 18px 20px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(59, 130, 246, 0.06));
    border: 1px solid rgba(37, 99, 235, 0.15);
    color: #1e40af;
    line-height: 1.7;
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}

/* Alignement RTL: labels et hint à droite, mais inputs restent cohérents */
body[dir="rtl"] .gs-login__label,
body[dir="rtl"] .gs-login__hint {
    text-align: right;
}

body[dir="rtl"] .gs-login__cardTitle {
    text-align: center;
}

.gs-login__row {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important; /* Aligne tout le groupe à droite du formulaire (en RTL) */
    margin-bottom: 20px !important;
    padding: 12px 0 !important;
    min-height: 40px !important;
    width: 100% !important;
    overflow: visible !important;
}

.gs-login__checkbox {
    margin: 0 !important;
    color: #111827 !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    display: inline-flex !important;
    flex-direction: row-reverse !important; /* Inverse l'ordre : checkbox à droite, texte à gauche */
    align-items: center !important;
    cursor: pointer !important;
    gap: 10px !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 10 !important;
    width: auto !important;
    max-width: none !important;
    overflow: visible !important;
    direction: rtl !important;
    text-align: right !important;
}

.gs-login__checkbox input[type="checkbox"] {
    transform: scale(1.3);
    margin: 0 !important;
    cursor: pointer;
    width: 20px !important;
    height: 20px !important;
    accent-color: #2563eb;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    flex-shrink: 0 !important;
}

/* Firefox-specific fixes */
@-moz-document url-prefix() {
    .gs-login__checkbox input[type="checkbox"] {
        transform: scale(1.5) translateY(1px);
        margin: 0 !important;
    }
    
    .gs-login__checkbox {
        align-items: center !important;
        gap: 12px !important;
    }
    
    .gs-login__checkbox span {
        line-height: 1.3 !important;
        transform: translateY(0) !important;
    }
}

.gs-login__checkbox span {
    user-select: none !important;
    display: inline-block !important;
    color: #111827 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    visibility: visible !important;
    opacity: 1 !important;
    flex-shrink: 0 !important;
    min-width: auto !important;
    width: auto !important;
    max-width: none !important;
    overflow: visible !important;
    text-overflow: clip !important;
    line-height: 1.5 !important;
}

/* Override Bootstrap label styles */
label.gs-login__checkbox {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-bottom: 0 !important;
    font-weight: normal !important;
}

label.gs-login__checkbox span {
    position: static !important;
    left: auto !important;
    right: auto !important;
}

/* Password wrapper + toggle button */
.gs-login__password-wrapper {
    position: relative;
    width: 100%;
}

.gs-login__password-wrapper .input-group {
    width: 100%;
}

.gs-login__password-wrapper .form-control {
    padding-left: 68px;
}

.gs-login__toggle {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    height: 48px;
    width: 48px;
    min-width: 48px;
    border: 2px solid rgba(17, 24, 39, 0.18);
    background: rgba(255, 255, 255, 0.98);
    border-radius: 10px;
    cursor: pointer;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .18s ease;
    padding: 0;
    z-index: 10;
    font-size: 18px;
}

.gs-login__toggle:hover {
    border-color: rgba(37, 99, 235, 0.50);
    color: #2563eb;
    background: rgba(37, 99, 235, 0.08);
    transform: translateY(-50%) scale(1.05);
}

.gs-login__toggle:focus {
    outline: none;
    border-color: rgba(37, 99, 235, .65);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .15);
}

/* Alert polish */
.gs-login .alert-danger {
    margin: 18px 24px 0;
    border-radius: 14px;
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 576px) {
    .gs-login {
        min-height: calc(100vh - 60px);
    }
    
    .gs-login__wrap {
        padding: 0 10px 18px;
    }

    .gs-login__panel {
        padding: 0;
    }

    .gs-login__brand {
        margin: 12px auto 16px;
        width: calc(100% - 20px);
        padding: 12px 14px;
    }

    .gs-login__logo {
        width: 56px;
        height: 56px;
        border-radius: 14px;
    }

    .gs-login__title {
        font-size: 18px;
    }
    
    .gs-login__subtitle {
        font-size: 15px;
    }
    
    .gs-login__desc {
        font-size: 13px;
    }
    
    .gs-login__cardTitle {
        font-size: 18px;
    }
    
    .gs-login .form-control,
    .gs-login .btn {
        height: 44px;
        font-size: 14px;
    }
    
    .gs-login__toggle {
        width: 38px;
        height: 38px;
    }
}
