/* =======================================================================
   RECLAMO PLANNING — PAGE DE CONNEXION
   Feuille complète et autonome pour login.php uniquement.
   À charger APRÈS assets/style.css.
   ======================================================================= */
@font-face {
    font-family: "Flame";
    src: url("https://reclamo.sbs/Reclamo/static/img/server/2/iconBK/font/typo.1011") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Flame";
    src: url("https://reclamo.sbs/Reclamo/static/img/server/2/iconBK/font/typo.144") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
:root {
    --login-brown: #502314;
    --login-brown-soft: #79594c;
    --login-orange: #ff8732;
    --login-red: #d62300;
    --login-cream: #fffaf5;
    --login-line: rgba(226, 148, 99, .38);
    --login-card-width: 500px;
    --login-radius: 26px;
    --login-shadow: 0 26px 75px rgba(35, 15, 8, .34);
}
.auth-card h1 {
    font-family: "Flame", sans-serif;
    font-weight: 700;
}

.auth-card p {
    font-family: "Flame", sans-serif;
    font-weight: 400;
}

.auth-submit {
    font-family: "Flame", sans-serif;
    font-weight: 700;
}

.auth-card input {
    font-family: "Flame", sans-serif;
    font-weight: 400;
}
/* Dimensions prévisibles malgré les règles globales de style.css. */
body.auth-body,
body.auth-body *,
body.auth-body *::before,
body.auth-body *::after {
    box-sizing: border-box;
}

html:has(body.auth-body) {
    width: 100%;
    min-width: 320px;
    min-height: 100%;
    overflow-x: hidden;
}


/* =======================================================================
   RECLAMO PLANNING — PAGE DE CONNEXION
   Feuille complète et autonome pour login.php uniquement.
   À charger APRÈS assets/style.css.
   ======================================================================= */

:root {
    --login-brown: #502314;
    --login-brown-soft: #79594c;
    --login-orange: #ff8732;
    --login-red: #d62300;
    --login-cream: #fffaf5;
    --login-line: rgba(226, 148, 99, .38);
    --login-card-width: 500px;
    --login-radius: 26px;
    --login-shadow: 0 26px 75px rgba(35, 15, 8, .34);
}

/* Dimensions prévisibles malgré les règles globales de style.css. */
body.auth-body,
body.auth-body *,
body.auth-body *::before,
body.auth-body *::after {
    box-sizing: border-box;
}

html:has(body.auth-body) {
    width: 100%;
    min-width: 320px;
    min-height: 100%;
    overflow-x: hidden;
}

body.auth-body {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 320px;
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    margin: 0;
    padding:
        max(24px, env(safe-area-inset-top))
        max(20px, env(safe-area-inset-right))
        max(24px, env(safe-area-inset-bottom))
        max(20px, env(safe-area-inset-left));
    overflow-x: clip;
    color: var(--login-brown);
    background-color: #6b351f;
    background-image:
        linear-gradient(115deg, rgba(38, 16, 8, .58), rgba(80, 35, 20, .28) 48%, rgba(38, 16, 8, .57)),
        url("img/login-background"),
        linear-gradient(135deg, #9c4b21, #f6b16f 48%, #592615);
    background-position: center, center, center;
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: scroll;
    font-family: Flame, "Trebuchet MS", Arial, sans-serif;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}
/* Désactive les anciennes formes décoratives dessinées en pseudo-éléments. */
body.auth-body::before,
body.auth-body::after {
    display: none !important;
    content: none !important;
}

/* Carte centrée, avec défilement possible sur les écrans bas. */
.auth-wrap {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    width: min(100%, var(--login-card-width));
    min-width: 0;
    margin: auto;
    animation: auth-card-in .42s cubic-bezier(.2, .75, .25, 1) both;
}

.auth-card {
    position: relative;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: clamp(24px, 4.5vw, 42px);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .78);
    border-radius: var(--login-radius);
    color: var(--login-brown);
    background: linear-gradient(145deg, rgba(255, 253, 250, .98), rgba(255, 246, 237, .97));
    box-shadow: var(--login-shadow), 0 8px 24px rgba(80, 35, 20, .12), inset 0 1px 0 rgba(255, 255, 255, .95);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}

.auth-card::before {
    display: none;
    content: none;
}

/* Marque / logo */
.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 13px;
    width: 100%;
    min-width: 0;
    margin: 0 0 clamp(22px, 4vh, 30px);
    text-align: left;
}

.auth-brand .brand-mark {
    display: grid;
    flex: 0 0 54px;
    place-items: center;
    width: 54px;
    height: 54px;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, .42);
    border-radius: 17px;
    color: #fff;
    background: linear-gradient(145deg, #f0440b, #c91f00);
    box-shadow: 0 8px 19px rgba(214, 35, 0, .22), inset 0 1px 0 rgba(255, 255, 255, .25);
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
}

.auth-brand > div,
.auth-brand > span,
.auth-brand > a {
    min-width: 0;
}

.auth-brand strong {
    display: block;
    margin: 0;
    color: var(--login-brown);
    font-size: clamp(20px, 4vw, 23px);
    font-weight: 800;
    letter-spacing: -.045em;
    line-height: 1.12;
}

.auth-brand small {
    display: block;
    margin-top: 5px;
    color: #a65a39;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .18em;
    line-height: 1.35;
}

/* Titres et texte */
.auth-eyebrow-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    margin: 0 0 8px;
    text-align: center;
}

.auth-eyebrow-row::before,
.auth-eyebrow-row::after {
    flex: 0 1 42px;
    width: 42px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #ef9b69);
    content: "";
}

.auth-eyebrow-row::after { transform: rotate(180deg); }

.auth-eyebrow-row .eyebrow,
.auth-card > .eyebrow,
.auth-card form > .eyebrow {
    color: #d65320;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .18em;
    line-height: 1.4;
}

.auth-card h1 {
    margin: 0 0 10px;
    color: var(--login-brown);
    font-size: clamp(29px, 5.5vw, 39px);
    font-weight: 800;
    letter-spacing: -.055em;
    line-height: 1.12;
    text-align: center;
    overflow-wrap: anywhere;
}

.auth-card > p {
    width: 100%;
    max-width: 370px;
    margin: 0 auto 25px;
    color: #80685d;
    font-size: 13px;
    line-height: 1.65;
    text-align: center;
    overflow-wrap: break-word;
}

/* Formulaires : connexion et première installation */
.auth-card .form-stack,
.auth-form.form-stack {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    width: 100%;
    min-width: 0;
    margin: 0;
}

.auth-card .form-stack > label,
.auth-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
    width: 100%;
    min-width: 0;
    margin: 0;
    color: #775548;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.4;
}

.auth-field-label {
    display: block;
    padding-left: 2px;
    letter-spacing: .035em;
}

/*
 * CORRECTION DES ICÔNES :
 * le conteneur est un bloc de référence, puis les icônes sont centrées
 * avec top:50% + translateY(-50%). Cela évite les décalages causés
 * par les styles flex ou les règles globales de assets/style.css.
 */
body.auth-body .auth-card .auth-input-wrap {
    position: relative !important;
    display: block !important;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    line-height: 1;
}

body.auth-body .auth-card .auth-input-icon {
    position: absolute !important;
    top: 50% !important;
    left: 15px !important;
    right: auto !important;
    z-index: 3;
    display: grid !important;
    flex: 0 0 19px;
    place-items: center;
    width: 19px !important;
    min-width: 19px;
    height: 19px !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #a64d2b;
    line-height: 0 !important;
    pointer-events: none;
    transform: translateY(-50%) !important;
}

body.auth-body .auth-card .auth-input-icon svg,
body.auth-body .auth-card .auth-password-toggle svg {
    display: block !important;
    flex: none;
    width: 19px !important;
    min-width: 19px;
    max-width: 19px;
    height: 19px !important;
    min-height: 19px;
    max-height: 19px;
    margin: 0 !important;
    padding: 0 !important;
    fill: none !important;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.9;
    overflow: visible;
}

/* Les champs font au moins 16px pour éviter le zoom automatique sur iOS. */
body.auth-body .auth-card input:not([type="hidden"]),
body.auth-body .auth-card .auth-input-wrap input {
    display: block !important;
    width: 100% !important;
    min-width: 0;
    min-height: 54px !important;
    height: 54px;
    margin: 0 !important;
    border: 1px solid #e9c7b1;
    border-radius: 12px;
    padding: 12px 52px 12px 47px !important;
    color: var(--login-brown);
    background: rgba(255, 255, 255, .88);
    box-shadow: inset 0 1px 2px rgba(80, 35, 20, .025);
    font-family: inherit;
    font-size: 16px !important;
    font-weight: 500;
    line-height: 1.35;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

body.auth-body .auth-card input::placeholder {
    color: #a18a7f;
    opacity: 1;
}

body.auth-body .auth-card input:hover { border-color: #dfaa8c; }

body.auth-body .auth-card input:focus,
body.auth-body .auth-card input:focus-visible {
    border-color: var(--login-orange);
    outline: none;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(255, 135, 50, .14), 0 5px 16px rgba(80, 35, 20, .05);
}

body.auth-body .auth-card input:disabled {
    opacity: .65;
    cursor: not-allowed;
}

/* Bouton œil : centrage indépendant de la hauteur/ligne du champ. */
body.auth-body .auth-card .auth-password-toggle {
    position: absolute !important;
    top: 50% !important;
    right: 6px !important;
    left: auto !important;
    z-index: 4;
    display: grid !important;
    place-items: center;
    width: 42px !important;
    min-width: 42px;
    max-width: 42px;
    height: 42px !important;
    min-height: 42px;
    max-height: 42px;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 10px;
    padding: 0 !important;
    color: #95604b;
    background: transparent;
    font: inherit;
    line-height: 0 !important;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
    transform: translateY(-50%) !important;
    transition: color .18s ease, background .18s ease;
}

body.auth-body .auth-card .auth-password-toggle:hover {
    color: var(--login-red);
    background: #fff0e5;
}

body.auth-body .auth-card .auth-password-toggle:focus-visible {
    outline: 3px solid rgba(214, 35, 0, .22);
    outline-offset: 1px;
}

/* Bouton de connexion */
.auth-card .btn-block { width: 100%; }

.auth-submit.btn,
.auth-card .btn-primary.btn-block {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    min-height: 54px;
    margin: 5px 0 0;
    overflow: hidden;
    border: 1px solid rgba(177, 31, 0, .35);
    border-radius: 13px;
    padding: 13px 48px 13px 18px;
    color: #fff;
    background: linear-gradient(105deg, #e13a08, #c91f00 55%, #ed4c0b);
    box-shadow: 0 10px 22px rgba(214, 35, 0, .2), inset 0 1px 0 rgba(255, 255, 255, .22);
    font-family: inherit;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.3;
    text-align: center;
    white-space: normal;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.auth-submit.btn::before {
    position: absolute;
    top: 0;
    left: -80%;
    width: 55%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .2), transparent);
    content: "";
    transform: skewX(-20deg);
    transition: left .55s ease;
    pointer-events: none;
}

.auth-submit.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 13px 25px rgba(214, 35, 0, .27);
    filter: saturate(1.08);
}

.auth-submit.btn:hover::before { left: 130%; }
.auth-submit.btn:active { transform: translateY(0); }
.auth-submit.btn:disabled { opacity: .72; cursor: wait; transform: none; filter: none; }
.auth-submit-label { position: relative; z-index: 1; }
.auth-submit-arrow { position: absolute; right: 17px; z-index: 1; font-size: 20px; line-height: 1; }

/* Retour AJAX */
.auth-feedback {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    min-width: 0;
    min-height: 0;
    margin: 0;
    border: 1px solid transparent;
    border-radius: 11px;
    padding: 0 12px;
    font-size: 12px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.auth-feedback[hidden] { display: none !important; }
.auth-feedback:not([hidden]) { min-height: 43px; padding-top: 10px; padding-bottom: 10px; }
.auth-feedback.is-loading { color: #8b4d1b; border-color: #f1d3a4; background: #fff8e9; }
.auth-feedback.is-error { color: #a3200a; border-color: #ffc6b8; background: #fff0ec; }
.auth-feedback.is-success { color: #176b34; border-color: #bfe5c8; background: #effaf2; }
.auth-feedback-dot { flex: 0 0 8px; width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: currentColor; }
.auth-feedback.is-loading .auth-feedback-dot { animation: auth-pulse 1s ease-in-out infinite; }

/* Première installation */
.auth-card .form-divider {
    width: 100%;
    height: 1px;
    margin: 4px 0;
    background: #efd9ca;
}

.auth-card .form-stack > .eyebrow {
    margin: 1px 0 0;
    color: #c75a2b;
}

.auth-card .alert {
    margin: 0 0 18px;
    border-radius: 11px;
    padding: 11px 13px;
    font-size: 12px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

/* Pied de carte */
.auth-foot {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
    margin: 23px 0 0;
    padding: 16px 0 0;
    border-top: 1px solid rgba(226, 148, 99, .32);
    color: #97786a;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.45;
    text-align: center;
}

.auth-foot svg {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    fill: none;
    stroke: #c1542a;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

/* Signature tricolore et version tout en bas de la carte. */
.auth-tricolor {
    display: flex;
    width: min(150px, 46%);
    height: 4px;
    margin: 15px auto 0;
    overflow: hidden;
    border-radius: 999px;
    box-shadow: 0 1px 2px rgba(80, 35, 20, .12);
}

.auth-tricolor span {
    display: block;
    flex: 1 1 33.333%;
    min-width: 0;
}

.auth-tricolor .is-green { background: #168447; }
.auth-tricolor .is-white { background: #fff; border-top: 1px solid #e8dfd9; border-bottom: 1px solid #e8dfd9; }
.auth-tricolor .is-red { background: #d62332; }

.auth-version {
    display: block;
    width: 100%;
    margin: 7px 0 0;
    color: #a28b80;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .07em;
    line-height: 1.4;
    text-align: center;
}

/* Focus clavier */
.auth-card button:focus-visible,
.auth-card a:focus-visible {
    outline: 3px solid rgba(214, 35, 0, .28);
    outline-offset: 3px;
}

/* Tablettes et petits ordinateurs */
@media (min-width: 601px) and (max-width: 1024px) {
    body.auth-body {
        padding: 30px max(28px, env(safe-area-inset-right)) 30px max(28px, env(safe-area-inset-left));
    }

    .auth-wrap { width: min(100%, 510px); }
    .auth-card { padding: clamp(30px, 5vw, 42px); }
}

/* Téléphones */
@media (max-width: 600px) {
    body.auth-body {
        justify-content: flex-start;
        padding:
            max(14px, env(safe-area-inset-top))
            max(12px, env(safe-area-inset-right))
            max(14px, env(safe-area-inset-bottom))
            max(12px, env(safe-area-inset-left));
        background-attachment: scroll;
    }

    .auth-wrap {
        width: 100%;
        max-width: 480px;
        margin-block: auto;
        animation-duration: .3s;
    }

    .auth-card {
        padding: clamp(22px, 6vw, 30px) clamp(17px, 5vw, 24px) 21px;
        border-radius: 21px;
        box-shadow: 0 18px 48px rgba(35, 15, 8, .3), 0 5px 15px rgba(80, 35, 20, .1);
    }

    .auth-brand { gap: 11px; margin-bottom: 22px; }
    .auth-brand .brand-mark { flex-basis: 46px; width: 46px; height: 46px; border-radius: 14px; font-size: 24px; }
    .auth-brand strong { font-size: 21px; }
    .auth-brand small { font-size: 8px; letter-spacing: .16em; }

    .auth-eyebrow-row { gap: 9px; margin-bottom: 7px; }
    .auth-eyebrow-row::before,
    .auth-eyebrow-row::after { flex-basis: 28px; width: 28px; }
    .auth-eyebrow-row .eyebrow,
    .auth-card > .eyebrow,
    .auth-card form > .eyebrow { font-size: 9px; letter-spacing: .15em; }

    .auth-card h1 { margin-bottom: 8px; font-size: clamp(28px, 8vw, 34px); }
    .auth-card > p { margin-bottom: 20px; font-size: 12px; line-height: 1.55; }
    .auth-card .form-stack,
    .auth-form.form-stack { gap: 12px; }

    .auth-field,
    .auth-card .form-stack > label { gap: 6px; font-size: 11px; }

    body.auth-body .auth-card input:not([type="hidden"]),
    body.auth-body .auth-card .auth-input-wrap input {
        min-height: 50px !important;
        height: 50px;
        padding: 11px 49px 11px 44px !important;
        font-size: 16px !important;
    }

    body.auth-body .auth-card .auth-input-icon { left: 13px !important; }
    body.auth-body .auth-card .auth-password-toggle { right: 4px !important; width: 42px !important; height: 42px !important; }

    .auth-submit.btn,
    .auth-card .btn-primary.btn-block { min-height: 52px; margin-top: 3px; font-size: 14px; }
    .auth-foot { gap: 7px; margin-top: 18px; padding-top: 13px; font-size: 9px; }
    .auth-tricolor { margin-top: 12px; }
    .auth-version { margin-top: 6px; font-size: 8px; }
    .auth-card .alert { margin-bottom: 14px; }
}

/* Très petits téléphones (320–360 px) */
@media (max-width: 360px) {
    body.auth-body {
        padding-left: max(9px, env(safe-area-inset-left));
        padding-right: max(9px, env(safe-area-inset-right));
    }

    .auth-card { padding: 21px 15px 18px; border-radius: 18px; }
    .auth-brand { gap: 9px; margin-bottom: 19px; }
    .auth-brand .brand-mark { flex-basis: 42px; width: 42px; height: 42px; border-radius: 13px; font-size: 22px; }
    .auth-brand strong { font-size: 19px; }
    .auth-brand small { font-size: 7px; letter-spacing: .13em; }
    .auth-card h1 { font-size: 27px; }
    .auth-card > p { font-size: 11px; }
    .auth-card .form-stack,
    .auth-form.form-stack { gap: 11px; }
    .auth-foot { font-size: 8px; }
}

/* Paysage sur mobile : on réduit les espacements et on laisse défiler la carte. */
@media (max-width: 900px) and (orientation: landscape) {
    body.auth-body {
        justify-content: flex-start;
        padding-top: max(10px, env(safe-area-inset-top));
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }

    .auth-wrap { margin-block: 10px; }
    .auth-card { padding-top: 22px; padding-bottom: 18px; }
    .auth-brand { margin-bottom: 15px; }
    .auth-brand .brand-mark { width: 42px; height: 42px; flex-basis: 42px; }
    .auth-card h1 { font-size: 28px; }
    .auth-card > p { margin-bottom: 14px; }
    .auth-card .form-stack,
    .auth-form.form-stack { gap: 10px; }
    .auth-foot { margin-top: 14px; padding-top: 10px; }
}

/* Écrans très bas ou clavier virtuel ouvert : priorité au défilement. */
@media (max-height: 680px) {
    body.auth-body { justify-content: flex-start; }
    .auth-wrap { margin-block: 8px; }
    .auth-card { padding-top: 23px; padding-bottom: 20px; }
    .auth-brand { margin-bottom: 17px; }
    .auth-card > p { margin-bottom: 17px; }
    .auth-foot { margin-top: 16px; padding-top: 11px; }
}

/* Grands écrans */
@media (min-width: 1400px) {
    .auth-wrap { width: min(100%, 520px); }
    .auth-card { padding: 44px; }
}

/* Navigateurs sans backdrop-filter */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .auth-card { background: rgba(255, 250, 245, .98); }
}

@keyframes auth-card-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes auth-pulse {
    0%, 100% { opacity: .35; transform: scale(.8); }
    50% { opacity: 1; transform: scale(1.15); }
}

@media (prefers-reduced-motion: reduce) {
    .auth-wrap { animation: none; }
    .auth-card *,
    .auth-card *::before,
    .auth-card *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
    .auth-feedback.is-loading .auth-feedback-dot { animation: none; }
}
