/* Page connexion — split brand / formulaire */

body.login-body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: #ebe6df;
    color: #1c1410;
    -webkit-font-smoothing: antialiased;
}

body.login-body .app-header,
body.login-body .main,
body.login-body footer.app-footer {
    display: none;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 20px;
}

.login-frame {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    max-width: 960px;
    min-height: min(600px, calc(100vh - 48px));
    border-radius: 20px;
    overflow: hidden;
    box-shadow:
        0 4px 6px rgba(28, 20, 16, 0.04),
        0 24px 60px rgba(28, 20, 16, 0.14);
}

/* — Panneau marque (logo) — */
.login-brand {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 36px;
    background:
        radial-gradient(ellipse 90% 70% at 50% 40%, rgba(201, 164, 92, 0.12) 0%, transparent 60%),
        linear-gradient(165deg, #2a2118 0%, #1a120c 55%, #120d09 100%);
}

.login-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    pointer-events: none;
}

.login-brand-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 320px;
}

.login-logo {
    display: block;
    width: 100%;
    max-width: 260px;
    height: auto;
    border-radius: 16px;
    margin-bottom: 28px;
    box-shadow:
        0 0 0 1px rgba(201, 164, 92, 0.15),
        0 20px 50px rgba(0, 0, 0, 0.45);
}

.login-brand-title {
    margin: 0 0 6px;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #e8c878;
}

.login-brand-tag {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: rgba(232, 200, 120, 0.55);
    text-transform: uppercase;
}

/* — Panneau formulaire — */
.login-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 44px;
    background: #faf8f5;
}

.login-main-inner {
    width: 100%;
    max-width: 340px;
}

.login-head h1 {
    margin: 0 0 8px;
    font-size: 1.75rem;
    font-weight: 700;
    color: #1c1410;
    letter-spacing: -0.02em;
}

.login-head p {
    margin: 0 0 32px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #6b5d4f;
}

.login-flash {
    margin-bottom: 20px;
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 0.84rem;
    font-weight: 600;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-field label {
    display: block;
    margin-bottom: 7px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #3d342c;
}

.login-field input {
    width: 100%;
    box-sizing: border-box;
    padding: 13px 15px;
    font-size: 0.94rem;
    color: #1c1410;
    background: #fff;
    border: 1px solid #ddd5c8;
    border-radius: 10px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-field input::placeholder {
    color: #a89888;
}

.login-field input:hover {
    border-color: #c9b89e;
}

.login-field input:focus {
    outline: none;
    border-color: #c9a45c;
    box-shadow: 0 0 0 3px rgba(201, 164, 92, 0.18);
}

.login-submit {
    width: 100%;
    margin-top: 4px;
    padding: 14px 18px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.94rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #faf8f5;
    background: linear-gradient(180deg, #2a2118 0%, #1a120c 100%);
    box-shadow: 0 2px 8px rgba(28, 20, 16, 0.2);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.login-submit:hover {
    box-shadow: 0 4px 14px rgba(28, 20, 16, 0.28);
}

.login-submit:active {
    transform: translateY(1px);
}

@media (max-width: 768px) {
    .login-page {
        padding: 16px 12px;
        align-items: stretch;
    }

    .login-frame {
        grid-template-columns: 1fr;
        min-height: auto;
        max-width: 420px;
    }

    .login-brand {
        padding: 36px 28px 32px;
    }

    .login-logo {
        max-width: 200px;
        margin-bottom: 20px;
    }

    .login-brand-title {
        font-size: 1rem;
    }

    .login-main {
        padding: 36px 28px 40px;
    }

    .login-head p {
        margin-bottom: 24px;
    }
}

@media (max-width: 400px) {
    .login-brand {
        padding: 28px 20px 24px;
    }

    .login-logo {
        max-width: 168px;
    }

    .login-main {
        padding: 28px 22px 32px;
    }
}

.login-pwa {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid #e8e0d6;
}

.login-pwa-manual {
    margin-top: 12px;
    padding-top: 0;
    border-top: none;
}

.login-pwa-title {
    margin: 0 0 6px;
    font-size: 0.92rem;
    font-weight: 700;
    color: #1c1410;
}

.login-pwa-desc {
    margin: 0 0 12px;
    font-size: 0.82rem;
    color: #6b5c52;
    line-height: 1.45;
}

.login-pwa-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #005696, #083a5c);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 86, 150, 0.28);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.login-pwa-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 86, 150, 0.34);
}

.login-pwa-btn-outline {
    background: #fff;
    color: #005696;
    border: 2px solid #005696;
    box-shadow: none;
}

.login-pwa-refresh {
    margin-top: 10px;
    width: auto;
    min-width: 48px;
    padding: 10px 14px;
    display: none;
}

body.pwa-installed .login-pwa-refresh,
html.pwa-standalone .login-pwa-refresh {
    display: inline-flex;
}

.login-pwa-refresh svg {
    pointer-events: none;
}

.login-pwa-refresh.is-busy svg {
    animation: pwa-refresh-spin 0.8s linear infinite;
}

.login-pwa-icon {
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
