@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

body, .card, .form-control, .btn { font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif; }
body { background-color: #F7F5F0; }

.container { max-width: 460px; padding: 0.75rem; }
@media (min-width: 576px) { .container { padding-top: 2rem; } }

.card { border: none; border-radius: 16px; box-shadow: 0 4px 18px rgba(0,0,0,0.06); }
.card-body { padding: 1.5625rem; }
@media (min-width: 576px) { .card-body { padding: 2.1875rem; } }

.logo { max-width: 140px; height: auto; margin: 0 auto 1rem !important; display: block; }
@media (min-width: 576px) { .logo { max-width: 160px; } }

.title { border: none; border-radius: 12px; padding: 0.75rem 0.5rem; background-color: #f1e9f5; margin-bottom: 0.75rem !important; }
.title h1 { font-size: 1.35rem; color: #5b2a6e; font-weight: 700; margin: 0; line-height: 1.3; }
@media (min-width: 576px) { .title h1 { font-size: 1.5rem; } }

.help { border: none; border-radius: 12px; background-color: #fdf3e7; padding: 0.9rem 1rem; font-size: 0.95rem; line-height: 1.6; letter-spacing: 0.02em; color: #4a3b2a; margin-bottom: 0.9375rem !important; }
.help i { font-size: 1.1rem; color: #d98c3f; margin-right: 0.25rem; }
.help strong.lefil-sendtoken-title { font-size: 1.05rem; display: block; margin-bottom: 0.35rem; line-height: 1.6; }
.help .lefil-sendtoken-important { color: #b23b3b; font-weight: 600; }
@media (min-width: 576px) { .help { font-size: 1rem; padding: 1rem 1.1rem; } .help strong.lefil-sendtoken-title { font-size: 1.1rem; } }

.alert-info { border: none; border-radius: 12px; background-color: #eef4f6; padding: 1rem; margin-bottom: 0 !important; }
.form-horizontal .col-form-label { font-size: 0.95rem; font-weight: 600; color: #333; padding-bottom: 0.3rem; }
@media (min-width: 576px) { .form-horizontal .col-form-label { font-size: 1rem; padding-top: 0.6rem; } }

.input-group { border-radius: 10px; overflow: hidden; }
.input-group-text { font-size: 1.1rem; padding: 0 0.85rem; background-color: #fff; border: 1px solid #ccc; border-right: none; color: #666; display: flex; align-items: center; }
.form-control { height: 3rem; font-size: 1.05rem; padding: 0.4rem 0.85rem; border: 1px solid #ccc; border-left: none; }
.form-control::placeholder { color: #666; font-size: 1rem; }
.form-control:focus { box-shadow: 0 0 0 0.2rem rgba(232, 121, 44, 0.2); border-color: #E8792C; }
@media (min-width: 576px) { .form-control { height: 3.2rem; font-size: 1.1rem; } .input-group-text { height: 3.2rem; font-size: 1.15rem; } }

.btn-success { width: 100%; height: 3.2rem; font-size: 1.1rem; font-weight: 700; background-color: #E8792C; border-color: #E8792C; border-radius: 10px; margin-top: 0.75rem; display: flex; align-items: center; justify-content: center; gap: 0.4rem; }
.btn-success:hover, .btn-success:focus { background-color: #d06d24; border-color: #d06d24; }
.btn-success i { font-size: 1.1rem; }
@media (min-width: 576px) { .btn-success { height: 3.4rem; font-size: 1.15rem; } }

@media (max-width: 575.98px) {
    .form-horizontal .row { display: block; }
    .form-horizontal .col-sm-4,
    .form-horizontal .col-sm-8,
    .form-horizontal .offset-sm-4 { width: 100%; max-width: 100%; padding: 0; margin: 0; }
    .form-horizontal .col-form-label { text-align: left !important; display: block; margin-bottom: 0.3rem; }
}



/* =========================================================
   LEFIL-FINAL — Page de connexion + confirmation
   Logo en haut partout. Titre cache sur confirmation. Coche unique.
   ========================================================= */

.card-body {
    display: flex;
    flex-direction: column;
}

/* Logo EN PREMIER sur toutes les pages */
.card-body > a:has(> img.logo) {
    order: 1;
    margin: 0 auto 1.25rem;
    display: block;
    text-align: center;
}
.card-body > a:has(> img.logo) img.logo {
    max-width: 90px;
    height: auto;
}

/* Page de connexion : ordre titre, aide, formulaire */
.card-body > .title      { order: 2; }
.card-body > .help       { order: 3; }
.card-body > .alert-info { order: 4; }

/* Page de confirmation : cacher le titre redondant, cacher l'icone SSP */
.card-body:has(.lefil-tok-title) > .title {
    display: none;
}
.card-body:has(.lefil-tok-title) > .alert-success:not(.title) > i:first-child {
    display: none;
}
.card-body:has(.lefil-tok-title) > .alert-success:not(.title) {
    order: 2;
    background-color: #e8f5ec;
    border: none;
    border-radius: 12px;
    padding: 1.5rem 1.25rem;
    margin-bottom: 0;
}

/* Typographie du message de confirmation */
.lefil-tok-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1f5c33;
    line-height: 1.3;
    margin: 0 0 1.25rem 0;
    position: relative;
    padding-left: 2rem;
}
.lefil-tok-title::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0;
    font-size: 1.5rem;
    color: #1f5c33;
    font-weight: 700;
}
.lefil-tok-body {
    font-size: 1.05rem;
    line-height: 1.65;
    letter-spacing: 0.02em;
    color: #2c2c2c;
    margin: 0 0 1.25rem 0;
}
.lefil-tok-note {
    font-size: 0.98rem;
    line-height: 1.6;
    letter-spacing: 0.02em;
    color: #4a4a4a;
    margin: 0;
}

@media (min-width: 576px) {
    .lefil-tok-title { font-size: 1.5rem; }
    .lefil-tok-body  { font-size: 1.1rem; }
    .card-body > a:has(> img.logo) img.logo { max-width: 110px; }
}

/* =========================================================
   LEFIL-RESET — Page "Choisissez votre nouveau mot de passe"
   ========================================================= */
body:has(input[name="newpassword"]) .form-horizontal .row {
    display: block;
}
body:has(input[name="newpassword"]) .form-horizontal .col-sm-4,
body:has(input[name="newpassword"]) .form-horizontal .col-sm-8,
body:has(input[name="newpassword"]) .form-horizontal .offset-sm-4 {
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin: 0;
}
body:has(input[name="newpassword"]) .form-horizontal .col-form-label {
    text-align: left !important;
    display: block;
    margin-bottom: 0.4rem;
    padding-bottom: 0;
}
body:has(input[name="newpassword"]) .btn-success {
    height: auto;
    min-height: 3.2rem;
    padding: 0.9rem 1rem;
    white-space: normal;
    line-height: 1.3;
    word-break: break-word;
}


/* =========================================================
   LEFIL-COMPACT2 — Page reset : titre cache, zero scroll
   ========================================================= */

body:has(input[type="password"]) .title,
body:has(input[type="password"]) .card-body > .title {
    display: none !important;
}
body:has(input[type="password"]) .container {
    max-width: 420px;
    padding: 0.35rem;
}
body:has(input[type="password"]) .card-body {
    padding: 0.55rem;
}
body:has(input[type="password"]) .logo {
    max-width: 60px !important;
    margin: 0 auto 0.35rem !important;
}
body:has(input[type="password"]) .help {
    padding: 0.55rem 0.8rem;
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 0.35rem !important;
}
body:has(input[type="password"]) .help p {
    margin: 0 0 0.3rem 0;
    font-size: 18px;
}
body:has(input[type="password"]) .help p:last-child {
    margin-bottom: 0;
}
body:has(input[type="password"]) .help .fs-5 {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #5b2a6e;
}
body:has(input[type="password"]) .alert-info {
    padding: 0.6rem 0.7rem;
}
body:has(input[type="password"]) .form-horizontal .row {
    margin-bottom: 0.35rem !important;
}
body:has(input[type="password"]) .form-horizontal .col-form-label {
    font-size: 18px;
    margin-bottom: 0.1rem;
    padding-bottom: 0;
}
body:has(input[type="password"]) .form-control {
    height: 52px;
    font-size: 17px;
    padding: 0.25rem 0.65rem;
}
body:has(input[type="password"]) .input-group-text {
    height: 52px;
    padding: 0 0.55rem;
    font-size: 16px;
}
body:has(input[type="password"]) .btn-success {
    height: auto;
    min-height: 56px;
    padding: 0.5rem 0.85rem;
    font-size: 17px;
    margin-top: 12px;
    white-space: normal;
    line-height: 1.2;
}
body:has(input[type="password"]) .alert-danger {
    padding: 0.5rem 0.7rem;
    font-size: 0.86rem;
    margin-bottom: 0.35rem !important;
    border-radius: 10px;
}

/* =========================================================
   LEFIL-ALERTE — Bandeau d'erreur tres visible (page 3)
   ========================================================= */
body:has(input[type="password"]) .alert-danger,
body:has(input[type="password"]) .alert-warning:not(.help),
body:has(input[type="password"]) > .card-body > .alert:not(.alert-info):not(.title):not(.help) {
    background-color: #d32f2f !important;
    color: #ffffff !important;
    border: 3px solid #b71c1c !important;
    border-radius: 12px !important;
    padding: 1rem 1.1rem !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    line-height: 1.6 !important;
    box-shadow: 0 4px 14px rgba(183, 28, 28, 0.35) !important;
    margin-bottom: 0.75rem !important;
    text-align: left !important;
}
body:has(input[type="password"]) .alert-danger i,
body:has(input[type="password"]) .alert-warning:not(.help) i {
    color: #ffffff !important;
    font-size: 1.3rem !important;
    margin-right: 0.5rem !important;
    vertical-align: middle;
}
body:has(input[type="password"]) .alert-danger a,
body:has(input[type="password"]) .alert-warning:not(.help) a {
    color: #ffffff !important;
    text-decoration: underline;
}

