.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100%;
    padding: 20px 16px;
    box-sizing: border-box;
}

.login-card {
    display: flex;
    width: 820px;
    min-height: 520px;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 60px color-mix(in srgb, var(--primary-color) 20%, transparent);
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Lado esquerdo - Branding */
.login-brand {
    width: 320px;
    background: linear-gradient(160deg,
        color-mix(in srgb, var(--primary-color) 100%, black 20%) 0%,
        color-mix(in srgb, var(--primary-color) 85%, black 10%) 40%,
        color-mix(in srgb, var(--primary-color) 70%, white 10%) 100%
    );
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

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

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

.brand-content {
    text-align: center;
    z-index: 1;
    margin-top: 40px;
}

.brand-logo {
    width: 100%;
    max-width: 220px;
    height: auto;
    border-radius: 12px;
    margin-bottom: 30px;
    position: relative;
    z-index: 2;
}

.login-brand h2 {
    color: #fff;
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.login-brand p {
    color: rgba(255, 255, 255, 0.65);
    font-size: 14px;
    margin: 0;
}

.btn-back {
    z-index: 1;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 10px 30px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    width: 100%;
    max-width: 200px;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateX(-3px);
}

/* Lado direito - Formulário */
.login-form-area {
    flex: 1;
    background: var(--sidebar-bg);
    padding: 50px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
}

.form-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 5px 0;
}

.form-subtitle {
    color: color-mix(in srgb, var(--text-color) 55%, transparent);
    font-size: 14px;
    margin: 0 0 10px 0;
}

/* Input groups */
.input-group {
    display: flex;
    align-items: center;
    background: var(--button-bg);
    border-radius: 12px;
    padding: 0 15px;
    margin-bottom: 16px;
    border: 2px solid transparent;
    transition: all 0.3s;
    position: relative;
}

.input-group:focus-within {
    border-color: var(--primary-color);
    background: var(--sidebar-bg);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary-color) 12%, transparent);
}

.input-group > i:first-child {
    color: color-mix(in srgb, var(--text-color) 40%, transparent);
    font-size: 16px;
    width: 20px;
    text-align: center;
    transition: color 0.3s;
}

.input-group:focus-within > i:first-child {
    color: var(--primary-color);
}

.input-wrapper {
    flex: 1;
    position: relative;
    padding: 8px 0 8px 12px;
}

.input-wrapper input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: 15px;
    color: var(--text-color);
    padding: 14px 0 0 0;
    font-family: inherit;
}

.input-wrapper label {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: color-mix(in srgb, var(--text-color) 45%, transparent);
    font-size: 14px;
    pointer-events: none;
    transition: all 0.2s ease;
    margin: 0;
}

.input-wrapper input:focus ~ label,
.input-wrapper input:not(:placeholder-shown) ~ label {
    top: 10px;
    font-size: 11px;
    color: var(--primary-color);
    font-weight: 600;
}

/* Toggle senha */
.toggle-pwd {
    color: color-mix(in srgb, var(--text-color) 35%, transparent);
    cursor: pointer;
    padding: 10px 5px;
    font-size: 14px;
    transition: color 0.3s;
}

.toggle-pwd:hover {
    color: var(--primary-color);
}

/* Checkbox */
.remember-row { margin-bottom: 24px; }

.checkbox-custom {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: color-mix(in srgb, var(--text-color) 60%, transparent);
    margin: 0;
}

.checkbox-custom input { display: none; }

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.checkbox-custom input:checked ~ .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-custom input:checked ~ .checkmark::after {
    content: '✓';
    color: #fff;
    font-size: 12px;
    font-weight: bold;
}

/* Botão login */
.btn-login {
    width: 100%;
    padding: 14px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
    font-family: inherit;
    margin-top: 8px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px color-mix(in srgb, var(--primary-color) 40%, transparent);
    background: var(--headerbar-btn-hover);
}

.btn-login:active { transform: translateY(0); }

.btn-login img { height: 22px; }

/* Erro */
.login-error {
    margin-top: 16px;
    padding: 12px 16px;
    background: #fff5f5;
    border: 1px solid #fecaca;
    border-radius: 10px;
    color: #dc2626;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Autocomplete */
input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 30px var(--button-bg) inset !important;
    -webkit-text-fill-color: var(--text-color) !important;
    transition: background-color 5000s ease-in-out 0s;
}

.input-group:focus-within input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 30px var(--sidebar-bg) inset !important;
}

/* Legenda senha */
.pw-legend {
    background: var(--button-bg);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 12px;
    font-size: 12px;
}

.pw-legend-title {
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-color);
}

#pw-legend-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px 12px;
    list-style: none;
    padding: 0;
    margin: 0 0 6px 0;
    line-height: 1.5;
}

#pw-strength {
    font-size: 12px;
    color: color-mix(in srgb, var(--text-color) 55%, transparent);
}

/* Responsivo */
@media screen and (max-width: 700px) {
    .input-wrapper input,
    .input-wrapper select { font-size: 16px; }
    .login-container {
        align-items: flex-start;
        padding: 16px;
        min-height: 100vh;
        box-sizing: border-box;
    }

    .login-card {
        flex-direction: column;
        width: 100%;
        max-width: 100%;
        min-height: auto;
        border-radius: 16px;
    }

    .login-brand {
        width: 100%;
        padding: 30px 24px 24px;
        min-height: auto;
    }

    .brand-content { margin-top: 0; }
    .brand-logo { max-width: 120px; margin-bottom: 10px; }
    .login-brand h2 { font-size: 17px; }
    .login-brand p { font-size: 13px; }
    .btn-back { max-width: 160px; padding: 8px 20px; margin-top: 12px; }
    .login-form-area { padding: 28px 24px; }
    .form-title { font-size: 22px; }
    #pw-legend-list { grid-template-columns: 1fr; }
}
