/* ============================================================
   SwissPass Login — Reproduction exacte de login.swisspass.ch
   Structure : header blanc + fond avec image + carte blanche
   ============================================================ */

/* ---- Reset de base ---- */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: SBB-Light, SBB, 'Helvetica Neue', Arial, sans-serif;
    background-color: #c51416;
    color: #fff;
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   HEADER BLANC — comme login.swisspass.ch
   ============================================================ */
.skel-header,
.skel-header-provider {
    background-color: #ffffff !important;
    border-bottom: 1px solid #e0e0e0;
    padding: 16px 0;
    width: 100%;
}

/* Injecter le header SwissPass avant le formulaire */
#skelWrapOuter::before {
    content: '';
    display: block;
}
/* Hide the default checkbox */
.mod-formelem__check input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

/* Style the custom checkbox wrapper */
.mod-formelem--wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-left: 5px;
}

/* Custom checkbox icon */
.mod-formelem--icon {
    display: inline-block;
    width: 22px;
    height: 22px;
    min-width: 22px;
    border: 2px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    position: relative;
    transition: all 0.2s ease;
}

/* Checked state - using the sibling selector */
.mod-formelem__check input[type="checkbox"]:checked ~ .mod-formelem--wrapper .mod-formelem--icon,
.mod-formelem__check input[type="checkbox"]:checked + .mod-formelem--wrapper .mod-formelem--icon {
    background-color: #c51416; /* SwissPass red */
    border-color: #c51416;
}

/* Checkmark using pseudo-element */
.mod-formelem__check input[type="checkbox"]:checked ~ .mod-formelem--wrapper .mod-formelem--icon::after,
.mod-formelem__check input[type="checkbox"]:checked + .mod-formelem--wrapper .mod-formelem--icon::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 16px;
    font-weight: bold;
}

/* Hover effect */
.mod-formelem--wrapper:hover .mod-formelem--icon {
    border-color: #999;
}

/* Focus state for accessibility */
.mod-formelem__check input[type="checkbox"]:focus + .mod-formelem--wrapper .mod-formelem--icon {
    outline: 2px solid #c51416;
    outline-offset: 2px;
}

/* Disabled state */
.mod-formelem__check input[type="checkbox"]:disabled + .mod-formelem--wrapper {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Text styling */
.mod-formelem--text {
    font-size: 14px;
    color: #333;
}
/* ============================================================
   LAYOUT PRINCIPAL — image de fond SwissPass avec la femme
   ============================================================ */
#skelWrapOuter,
.skel-wrap-outer {
    background-color: #c51416;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#skelWrapInner,
.skel-wrap-inner {
    background-color: transparent;
}

/* Zone principale avec image de fond */
.skel-main,
#mainContent {
    background-image: url('../img/login_bg.jpg') !important;
    background-size: cover !important;
    background-position: center right !important;
    background-repeat: no-repeat !important;
    flex: 1;
    position: relative;
}

/* Overlay rouge semi-transparent sur l'image pour garder la lisibilité */
.skel-main::before,
#mainContent::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(197, 20, 22, 0.55);
    pointer-events: none;
    z-index: 0;
}

#mainContentBg,
.mod-content,
.mod-content--root {
    background-color: transparent;
    position: relative;
    z-index: 1;
    flex: 1;
}

.mod-login {
    background-color: transparent !important;
    display: flex !important;
    justify-content: center !important;
    align-items: flex-start !important;
    min-height: calc(100vh - 120px) !important;
    padding: 40px 16px !important;
}

.mod-login-swisspass {
    width: 100%;
    max-width: 480px;
}

.mod-login-swisspass-inner {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ============================================================
   LOGO SWISSPASS — vraie image swisspw.PNG
   ============================================================ */
.mod-login--logo-action {
    background-color: transparent !important;
    box-shadow: none !important;
    padding: 0 0 24px 0 !important;
    margin-bottom: 0 !important;
}

.mod-metamenu--logo {
    display: block;
    text-decoration: none !important;
}

/* Logo image pleine largeur */
.swisspass-logo-img {
    display: block !important;
    width: 100% !important;
    max-width: 480px !important;
    height: auto !important;
    border-radius: 2px;
}

/* ============================================================
   CARTE BLANCHE DU FORMULAIRE
   ============================================================ */
.mod-login--action {
    background-color: #ffffff !important;
    padding: 32px !important;
    border-radius: 2px !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18) !important;
    margin-bottom: 0 !important;
    color: #333333 !important;
}

/* Le bloc logo n'a pas de fond blanc */
.mod-login--logo-action,
.mod-login--action:first-child {
    background-color: transparent !important;
    box-shadow: none !important;
    padding: 0 0 24px 0 !important;
    margin-bottom: 0 !important;
    color: #ffffff !important;
}

/* Le bloc notifications n'a pas de fond blanc */
.mod-login--notifications {
    background-color: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    color: #ffffff !important;
}

/* Titres dans la carte */
.mod-login--action h2 {
    color: #333333 !important;
    font-size: 1.1rem;
    font-weight: 400;
    margin-bottom: 20px;
}

/* ============================================================
   CHAMPS DE SAISIE — fond blanc, texte sombre, bordure fine
   ============================================================ */
.form-group {
    margin-bottom: 0 !important;
}

.mod-formstate__background {
    background: transparent !important;
}

/* Cacher les labels flottants visuels */
/* .control-label,
.js-floatlabel--label {
    display: none !important;
} */

/* Inputs */
.form-control,
input[type="email"],
input[type="password"],
input[type="text"] {
    display: block !important;
    width: 100% !important;
    background-color: #ffffff !important;
    border: 1px solid #cccccc !important;
    border-radius: 2px !important;
    color: #333333 !important;
    font-size: 1rem !important;
    font-family: SBB-Light, SBB, 'Helvetica Neue', Arial, sans-serif !important;
    font-weight: 300 !important;
    padding: 14px 12px !important;
    height: auto !important;
    outline: none !important;
    box-shadow: none !important;
    -webkit-appearance: none !important;
    transition: border-color 0.15s;
    margin-bottom: 16px;
}

.form-control::placeholder,
input[type="email"]::placeholder,
input[type="password"]::placeholder {
    color: #999999 !important;
    font-weight: 300 !important;
}

.form-control:focus,
input[type="email"]:focus,
input[type="password"]:focus {
    border-color: #c51416 !important;
    box-shadow: 0 0 0 2px rgba(197,20,22,0.15) !important;
    outline: none !important;
}

/* Autofill */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0px 1000px #ffffff inset !important;
    -webkit-text-fill-color: #333333 !important;
}

/* ============================================================
   CHECKBOXES — texte sombre dans la carte blanche
   ============================================================ */
.form-group__login__remember-me {
    margin-bottom: 8px !important;
    background: transparent !important;
}

.mod-formelem--text {
    color: #333333 !important;
    font-size: 0.875rem;
}

.mod-formelem__check .mod-formelem--icon {
    border-color: #aaaaaa !important;
    background-color: #ffffff !important;
}

/* Tous les textes dans la carte blanche */
.mod-login--action label,
.mod-login--action span,
.mod-login--action p {
    color: #333333;
}

/* ============================================================
   MESSAGES D'ERREUR
   ============================================================ */
.mod-formstate__error .form-control {
    border-color: #c51416 !important;
}

.js-tooltip--js__message {
    color: #c51416 !important;
    font-size: 0.82rem;
    margin-top: 4px;
    display: block;
}

/* ============================================================
   BOUTON "Anmelden" — rouge SwissPass
   ============================================================ */
.btn-sso-login,
button#login_button,
.btn.btn-primary.btn-lg {
    display: block !important;
    width: 100% !important;
    background-color: #c51416 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 2px !important;
    font-size: 1rem !important;
    font-weight: 400 !important;
    font-family: SBB-Light, SBB, 'Helvetica Neue', Arial, sans-serif !important;
    padding: 14px 28px !important;
    cursor: pointer !important;
    text-align: center !important;
    transition: background-color 0.15s;
    -webkit-appearance: none;
    margin-top: 8px;
}

.btn-sso-login:hover,
button#login_button:hover,
.btn.btn-primary.btn-lg:hover {
    background-color: #a01012 !important;
}

.btn-provider-login-submit {
    width: 100%;
    padding-bottom: 0 !important;
    float: none !important;
}

/* ============================================================
   LIENS SECONDAIRES — "Passwort vergessen?" / "Registrieren"
   ============================================================ */
.mod-login--panel {
    margin-top: 16px;
}

.mod-valign {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mod-login--panel-aside {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.btn-meta,
.btn.btn-meta,
.btn.btn-meta.btn-md {
    background: transparent !important;
    color: #c51416 !important;
    border: none !important;
    font-size: 0.875rem !important;
    padding: 0 !important;
    text-decoration: underline !important;
    cursor: pointer;
    display: inline !important;
}

.btn-meta:hover,
.btn.btn-meta:hover {
    color: #a01012 !important;
}

.link-pw-reset,
.link-register {
    color: #c51416 !important;
    text-decoration: underline !important;
    font-size: 0.875rem;
}

/* ============================================================
   SÉPARATEUR "oder" + lien registrieren
   ============================================================ */
.separator-container {
    margin: 20px 0 12px;
    text-align: center;
    position: relative;
}

.separator-container hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 0;
}

.self-service-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    font-size: 0.9rem;
    color: #555555;
}

/* ============================================================
   NOTIFICATIONS / ZONE DE MESSAGES
   ============================================================ */
.mod-login--notifications {
    margin-bottom: 0;
}

/* ============================================================
   MASQUER LES ÉLÉMENTS DUPLIQUÉS MOBILE
   ============================================================ */
.mod-login--action__secondary.visible-xs,
.mod-valign--el.visible-xs {
    display: none !important;
}

/* ============================================================
   LIENS GÉNÉRAUX
   ============================================================ */
a {
    color: #c51416;
}

a:hover {
    color: #a01012;
}

/* ============================================================
   SCROLLBAR MASQUÉE
   ============================================================ */
@media screen and (min-width: 768px) {
    html { scrollbar-width: none; }
    ::-webkit-scrollbar { width: 0; height: 0; }
}

/* ============================================================
   RESPONSIVE MOBILE
   ============================================================ */
@media screen and (max-width: 767px) {
    .mod-login {
        padding: 24px 12px !important;
    }

    .mod-login--action:last-child {
        padding: 24px 20px;
    }

    .mod-login--panel-aside {
        flex-direction: column;
    }

    .mod-login--action__secondary.visible-xs {
        display: flex !important;
    }

    .mod-login--panel-aside.hidden-xs {
        display: none !important;
    }
}

/* ============================================================
   DIVERS
   ============================================================ */
.hidden { display: none !important; }

#no-script-container, #noCookies {
    display: flex;
    flex-direction: row;
    justify-content: center;
    margin: 1em;
}
