/**
 * Login CSS - Cor principal: #187ee0
 */

/* Página e formulário – degradê suave */
.login-page {
    background: linear-gradient(180deg, #dbeafe 0%, #e0f2fe 25%, #f0f9ff 55%, #f8fafc 100%);
}

.login-wrap {
    min-height: 100vh;
    background: linear-gradient(180deg, #dbeafe 0%, #e0f2fe 25%, #f0f9ff 55%, #f8fafc 100%);
}

.login-form-side {
    background: linear-gradient(180deg, #dbeafe 0%, #e0f2fe 25%, #f0f9ff 55%, #f8fafc 100%);
}

.login-title,
.login-label,
.login-desc {
    color: #0c4a6e;
}

.login-input {
    color: #0c4a6e;
    border-color: rgba(24, 126, 224, 0.25);
}
.login-input:focus {
    border-color: #187ee0;
    outline: none;
    box-shadow: 0 0 0 3px rgba(24, 126, 224, 0.2);
}

.login-btn {
    background-color: #187ee0;
}
.login-btn:hover:not(:disabled) {
    background-color: #1568c7;
}

.login-toggle-pwd {
    color: #187ee0;
}
.login-toggle-pwd:hover {
    color: #0c4a6e;
}

.login-back {
    color: #0c4a6e;
}
.login-back:hover {
    color: #187ee0;
}

/* Container direito: logo + título atrativo */
.login-brand-side {
    background: white;
}

.login-brand-copy {
    text-align: center;
}

.login-brand-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #0c4a6e;
    line-height: 1.25;
    margin: 0 0 0.75rem;
    letter-spacing: -0.01em;
}

@media (min-width: 1024px) {
    .login-brand-title {
        font-size: 1.75rem;
    }
}

.login-brand-desc {
    font-size: 0.95rem;
    color: #64748b;
    line-height: 1.6;
    margin: 0;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================
   PRELOADER - Cor #187ee0
   ============================================ */
.login-preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    background: #187ee0;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.login-preloader.active {
    opacity: 1;
}

.preloader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

.preloader-logo-wrapper {
    animation: preloaderPulse 1.6s ease-in-out infinite;
}

.preloader-logo {
    max-width: 120px;
    height: auto;
    object-fit: contain;
    filter: brightness(0) invert(1); /* Branco */
    display: block;
}

.preloader-logo-text {
    font-size: 42px;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: 2px;
    text-align: center;
}

/* Dots loading animation */
.preloader-dots {
    display: flex;
    align-items: center;
    gap: 8px;
}

.preloader-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    animation: preloaderDot 1.2s ease-in-out infinite;
}

.preloader-dot:nth-child(2) {
    animation-delay: 0.15s;
}

.preloader-dot:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes preloaderPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.06);
        opacity: 0.85;
    }
}

@keyframes preloaderDot {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Spinner para botão de login */
.spinner {
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

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

/* ============================================
   RESPONSIVIDADE PARA TELAS PEQUENAS
   ============================================ */

/* Responsividade */
@media (max-width: 768px) {
    html, body {
        overflow-y: auto !important;
        overflow-x: hidden !important;
        height: auto !important;
        min-height: 100vh !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .login-page {
        background: linear-gradient(180deg, #dbeafe 0%, #e0f2fe 40%, #f8fafc 100%) !important;
    }

    body > .login-wrap {
        min-height: 100vh !important;
        height: auto !important;
        flex-direction: column !important;
        background: linear-gradient(180deg, #dbeafe 0%, #e0f2fe 40%, #f8fafc 100%) !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .login-form-side {
        width: 100% !important;
        min-height: 100vh !important;
        height: auto !important;
        padding: 2rem 1.5rem !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        background: linear-gradient(180deg, #dbeafe 0%, #e0f2fe 40%, #f8fafc 100%) !important;
        margin: 0 !important;
    }

    .login-form-side .max-w-\\[420px\\],
    .login-form-side [class*="max-w"] {
        width: 100%;
        max-width: 100%;
        padding-bottom: 2rem;
    }

    .login-wrap.flex-col {
        min-height: 100vh !important;
        height: auto !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        width: 100% !important;
    }

    * {
        max-width: 100%;
        box-sizing: border-box;
    }
}

@media (max-width: 480px) {
    .login-page {
        background: linear-gradient(180deg, #dbeafe 0%, #e0f2fe 40%, #f8fafc 100%) !important;
    }

    .login-form-side {
        width: 100% !important;
        padding: 1.5rem 1rem !important;
        min-height: 100vh !important;
    }

    .login-input,
    .login-btn {
        min-height: 44px;
    }

    .login-form-side [class*="max-w"] {
        padding-bottom: 3rem;
    }
}

@media (min-width: 768px) {
    .login-brand-side {
        position: relative;
    }

    .login-brand-side > div:first-child {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
    }

    .login-brand-side > div:last-child {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        display: flex;
        justify-content: center;
        align-items: flex-end;
    }
}
