/* ===== Page connexion — design pro ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html:has(.login-page),
html:has(.login-page) body,
body.login-page {
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 100%;
}

.login-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px 12px 28px;
    background: linear-gradient(145deg, #e8f0fe 0%, #f0f4f8 45%, #e2e8f0 100%);
    position: relative;
    overflow-x: hidden;
    overflow-y: visible;
    width: 100%;
    max-width: 100vw;
}

/* Fond : petites icônes vêtements, chaussures, voitures… */
.login-page__bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    width: 100%;
    height: 100%;
}

.login-page__icons {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 28px 20px;
    padding: 32px 24px;
    width: 100%;
    max-width: 100%;
    margin: 0;
    opacity: 0.22;
}

.login-page__icons i {
    font-size: clamp(14px, 2.2vw, 22px);
    color: #1e40af;
    text-align: center;
    transform: rotate(-12deg);
}

.login-page__icons i:nth-child(3n) { color: #2563eb; transform: rotate(8deg); }
.login-page__icons i:nth-child(4n) { color: #0d47a1; transform: rotate(-6deg); }
.login-page__icons i:nth-child(5n) { color: #1565c0; transform: rotate(14deg); }
.login-page__icons i:nth-child(7n) { font-size: clamp(12px, 1.8vw, 18px); opacity: 0.85; }

.login-page__main {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 380px;
    min-width: 0;
    flex-shrink: 0;
    margin: 0 auto;
}

.login-card {
    background: #ffffff;
    border: 1.5px solid rgba(148, 163, 184, 0.45);
    border-radius: 14px;
    padding: 18px 18px 16px;
    box-shadow:
        0 4px 6px rgba(15, 23, 42, 0.04),
        0 12px 28px rgba(30, 64, 175, 0.1);
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: visible;
}

.login-card__logo {
    display: flex;
    justify-content: center;
    margin-bottom: 6px;
}

.login-card__logo img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 16px;
    border: 2px solid rgba(37, 99, 235, 0.2);
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.12);
    pointer-events: none;
}

.login-card__brand {
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #2563eb;
    margin-bottom: 12px;
}

.login-box {
    text-align: left;
}

.login-box__title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 2px;
    text-align: center;
}

.login-box__subtitle {
    font-size: 12px;
    color: #64748b;
    text-align: center;
    margin-bottom: 12px;
    line-height: 1.35;
}

.login-messages {
    margin-bottom: 14px;
}

.login-message {
    font-size: 13px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #b91c1c;
}

.login-message--success {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #15803d;
}

.login-field {
    margin-bottom: 10px;
}

.login-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 4px;
}

.login-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.login-input-wrap__icon {
    position: absolute;
    left: 10px;
    font-size: 12px;
    color: #94a3b8;
    pointer-events: none;
    z-index: 1;
}

.login-input-wrap input {
    width: 100%;
    max-width: 100%;
    min-height: 36px;
    padding: 8px 36px 8px 32px;
    font-size: 13px;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    color: #0f172a;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.login-input-wrap input:focus {
    outline: none;
    border-color: #2563eb;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.login-input-wrap input:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.login-input-wrap__toggle,
.password-container .toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

.login-input-wrap__toggle:hover,
.password-container .toggle:hover {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.08);
}

.login-error {
    font-size: 12px;
    color: #dc2626;
    margin-top: 4px;
    min-height: 0;
}

.login-forgot {
    display: block;
    text-align: right;
    font-size: 11px;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
    margin: -2px 0 10px;
}

.login-forgot:hover {
    text-decoration: underline;
}

.login-submit {
    width: 100%;
    min-height: 36px;
    padding: 8px 12px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
    border: none !important;
    background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
    color: #ffffff !important;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.login-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4);
}

.login-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0 10px;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.login-divider::before,
.login-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.login-signup {
    text-align: center;
    font-size: 12px;
    color: #475569;
    font-weight: 500;
}

.login-signup a {
    color: #2563eb;
    font-weight: 700;
    text-decoration: none;
}

.login-signup a:hover {
    text-decoration: underline;
}

.login-page--auth-form {
    align-items: flex-start;
    padding-top: 16px;
    padding-bottom: 24px;
}

.login-card--signup {
    max-height: none;
    overflow-x: hidden;
    overflow-y: visible;
}

.login-box {
    overflow-x: hidden;
    overflow-y: visible;
    min-width: 0;
    max-width: 100%;
}

.login-hint {
    display: block;
    font-size: 10px;
    font-weight: 400;
    color: #94a3b8;
    margin-top: 3px;
    line-height: 1.35;
}

.login-alt-link {
    text-align: center;
    margin-top: 8px;
    font-size: 12px;
}

.login-alt-link a {
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.login-alt-link a:hover {
    text-decoration: underline;
}

.login-legal {
    margin-top: 10px;
    font-size: 10px;
    line-height: 1.5;
    color: #64748b;
    text-align: center;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.login-legal a {
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
}

.login-legal a:hover {
    text-decoration: underline;
}

.login-info {
    font-size: 12px;
    color: #64748b;
    text-align: center;
    line-height: 1.5;
    margin-bottom: 14px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.login-info-box {
    text-align: center;
}

.login-info-icon {
    font-size: 2.25rem;
    color: #2563eb;
    margin: 0 0 10px;
    line-height: 1;
}

.login-info-icon .fa-circle-check {
    color: #059669;
}

.login-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    font-size: 12px;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
}

.login-back:hover {
    text-decoration: underline;
}

/* Legacy selectors (autres pages auth anciennes) */
body:not(.login-page) {
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

body:not(.login-page) .container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
    position: absolute;
    top: 2px;
}

body:not(.login-page) .login-box {
    background: var(--bg-color);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
}

@media (max-width: 768px) {
    .login-page,
    .login-page--auth-form {
        padding: 12px 10px 20px;
        align-items: flex-start;
        padding-top: 16px;
    }

    .login-card {
        padding: 14px 14px 12px;
        border-radius: 12px;
    }

    .login-card__logo img {
        width: 64px;
        height: 64px;
    }

    .login-page__icons {
        grid-template-columns: repeat(6, 1fr);
        gap: 18px 12px;
        opacity: 0.18;
    }

    .login-box__title {
        font-size: 1.05rem;
    }

    .login-input-wrap input {
        font-size: 13px;
        padding: 8px 34px 8px 30px;
        min-height: 34px;
    }
}
