.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background);
}

/* ===== LEFT PANEL ===== */
.login-brand {
    background: linear-gradient(160deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: #fff;
    padding: 48px 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.login-brand::before {
    content: '';
    position: absolute;
    width: 480px;
    height: 480px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    top: -180px;
    right: -160px;
}

.login-brand::after {
    content: '';
    position: absolute;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    bottom: -140px;
    left: -100px;
}

.brand-top {
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1;
}

.brand-logo-mark {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.brand-name {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.brand-name span {
    color: var(--accent);
}

.brand-middle {
    z-index: 1;
    max-width: 460px;
}

.brand-middle h1 {
    font-size: 34px;
    line-height: 1.25;
    margin-bottom: 18px;
    letter-spacing: -0.01em;
}

.brand-middle p {
    font-size: 15px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.82);
}

.brand-stats {
    display: flex;
    gap: 32px;
    z-index: 1;
    margin-bottom: 28px;
}

.brand-stats .stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.brand-stats .stat b {
    font-size: 22px;
    font-weight: 700;
}

.brand-stats .stat span {
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.65);
}

.brand-quote {
    z-index: 1;
    font-size: 13.5px;
    font-style: italic;
    color: rgba(255, 255, 255, 0.7);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-top: 20px;
}

/* ===== RIGHT PANEL ===== */
.login-form-panel {
    background: var(--background);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.login-form-wrap {
    width: 100%;
    max-width: 444px;
}

.mobile-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
}

.login-logo {
    height: 138px !important;
    width: auto;
    display: block;
    margin: 0 auto;
}

.login-form-header {
    margin-bottom: 30px;
}

.login-form-header h2 {
    font-size: 26px;
    margin-bottom: 12px;
}

/* Filet doré (couleur secondaire de la marque) sous le titre. */
.login-form-header h2::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    margin-top: 8px;
    border-radius: 2px;
    background: var(--accent);
}

.login-form-header p {
    color: var(--text-secondary);
    font-size: 14.5px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

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

.field-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    display: flex;
}

.input-wrap input {
    width: 100%;
    padding: 14px 14px 14px 44px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 15px;
    background: var(--surface);
    color: var(--text-primary);
    transition: all var(--transition);
}

.input-wrap input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.input-wrap input.error {
    border-color: var(--danger);
}

.input-wrap input.error:focus {
    box-shadow: 0 0 0 3px var(--danger-bg);
}

.input-wrap input::placeholder {
    color: var(--text-muted);
}

.toggle-password {
    position: absolute;
    right: 12px;
    color: var(--text-muted);
    padding: 4px;
    display: flex;
    border-radius: 5px;
}

.toggle-password:hover {
    color: var(--text-primary);
    background: var(--surface-hover);
}

.form-row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 4px 0 22px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
}

.remember-me input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.forgot-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
}

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

.btn-login {
    width: 100%;
    justify-content: center;
    padding: 15px;
    font-size: 16px;
    position: relative;
}

.btn-login .spinner {
    display: none;
}

.btn-login.loading .spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.btn-login.loading {
    background: var(--primary-dark);
    pointer-events: none;
}

.btn-login.success {
    background: var(--success);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.alert-banner {
    display: none;
    gap: 10px;
    align-items: flex-start;
    background: var(--danger-bg);
    color: var(--danger);
    padding: 13px 16px;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 18px;
    border: 1px solid rgba(201, 58, 58, 0.2);
}

.alert-banner.show {
    display: flex;
    animation: fadeSlide 200ms var(--ease);
}

@keyframes fadeSlide {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.demo-accounts {
    margin-top: 22px;
}

.demo-accounts-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
    margin-bottom: 10px;
    text-align: center;
}

.demo-accounts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.demo-account-card {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 10px;
    background: var(--info-bg);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    text-align: left;
    transition: var(--transition);
}

.demo-account-card:hover {
    border-color: var(--info);
    transform: translateY(-1px);
}

.demo-account-role {
    font-size: 11px;
    font-weight: 700;
    color: var(--info);
    text-transform: uppercase;
    letter-spacing: .02em;
}

.demo-account-email {
    font-size: 11px;
    color: var(--text-primary);
    word-break: break-all;
}

.demo-account-password {
    font-size: 11px;
    color: var(--text-muted);
}

@media (max-width: 480px) {
    .demo-accounts-grid {
        grid-template-columns: 1fr;
    }
}

/* Écran étroit (POS Sunmi V2, ~320-360px) : le logo/titre de connexion
   prenaient trop de place verticale avant même d'atteindre les champs. */
@media (max-width: 360px) {
    .login-logo { height: 92px !important; }
    .mobile-logo { margin-bottom: 18px; }
    .login-form-header { margin-bottom: 20px; }
    .login-form-header h2 { font-size: 21px; }
    .form-group { margin-bottom: 15px; }
    .input-wrap input { padding: 11px 12px 11px 40px; font-size: 14px; }
}

.login-footer-note {
    text-align: center;
    margin-top: 24px;
    color: var(--text-muted);
    font-size: 12px;
}