/**
 * CSS para página de Login
 * Layout dividido: formulário à esquerda, logo à direita
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    overflow: hidden;
    height: 100vh;
}

/* Permitir scroll em mobile */
@media (max-width: 768px) {
    body {
        overflow-y: auto;
        height: auto;
        min-height: 100vh;
    }
}

.login-container {
    display: flex;
    width: 100%;
    height: 100vh;
}

/* Em mobile, container ocupa toda altura sem divisão */
@media (max-width: 768px) {
    .login-container {
        height: auto;
        min-height: 100vh;
        flex-direction: column;
    }
}

/* ============================================
   SEÇÃO ESQUERDA: FORMULÁRIO
   ============================================ */
.login-left {
    width: 40%;
    min-width: 400px;
    background: linear-gradient(135deg, #C4E0FF 0%, #B6D7FE 50%, #A8CEFD 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 50px;
    position: relative;
    overflow-y: auto;
}

.login-content {
    width: 100%;
    max-width: 420px;
}

/* Logo no lado esquerdo */
.login-logo {
    text-align: center;
    margin-bottom: 50px;
}

.logo-img {
    max-width: 200px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.logo-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.logo-primary {
    font-size: 28px;
    font-weight: 700;
    color: #1E3A5F;
    letter-spacing: 1px;
}

.logo-secondary {
    font-size: 28px;
    font-weight: 700;
    color: #D4A574;
    letter-spacing: 1px;
}

/* Título e Subtítulo */
.login-title {
    font-size: 32px;
    font-weight: 700;
    color: #1E3A5F;
    margin-bottom: 12px;
    line-height: 1.2;
}

.login-subtitle {
    font-size: 16px;
    color: #1E3A5F;
    margin-bottom: 40px;
    line-height: 1.5;
}

/* Mensagem de Erro */
.login-error {
    background-color: #FEE;
    border-left: 4px solid #E74C3C;
    color: #C0392B;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 24px;
    font-size: 14px;
}

.login-error p {
    margin: 0;
}

/* Formulário */
.login-form {
    width: 100%;
}

.form-field {
    margin-bottom: 24px;
}

.form-field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1E3A5F;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #D1D9E0;
    border-radius: 8px;
    font-size: 16px;
    background: #FFFFFF;
    color: #1E3A5F;
    outline: none;
}

.form-input:focus {
    border-color: #AED2FE;
    box-shadow: 0 0 0 3px rgba(174, 210, 254, 0.2);
}

.form-input::placeholder {
    color: #9CA3AF;
}

/* Password Wrapper */
.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #AED2FE;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    color: #1E3A5F;
}

.password-toggle svg {
    width: 20px;
    height: 20px;
}

/* Botão de Login */
.login-button {
    width: 100%;
    padding: 16px;
    background: #1E3A5F;
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

.login-button:hover {
    background: #152A47;
}

.login-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.spinner {
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

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

/* ============================================
   SEÇÃO DIREITA: LOGO CENTRALIZADA
   ============================================ */
.login-right {
    width: 60%;
    background: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.logo-center {
    text-align: center;
}

.logo-img-large {
    max-width: 400px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.logo-text-large {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.logo-primary-large {
    font-size: 80px;
    font-weight: 700;
    color: #1E3A5F;
    letter-spacing: 3px;
}

.logo-secondary-large {
    font-size: 80px;
    font-weight: 700;
    color: #D4A574;
    letter-spacing: 3px;
}

/* ============================================
   RESPONSIVIDADE
   Breakpoints padrão:
   - Desktop Grande: > 1440px (padrão)
   - Desktop: 1024px - 1440px
   - Tablet: 768px - 1023px
   - Mobile Grande: 480px - 767px
   - Mobile: < 480px
   ============================================ */

/* Desktop Médio (1024px - 1440px) */
@media (max-width: 1440px) {
    .login-left {
        padding: 50px 40px;
    }
    
    .logo-img-large {
        max-width: 350px;
    }
    
    .logo-primary-large,
    .logo-secondary-large {
        font-size: 70px;
    }
}

/* Tablet e Desktop Pequeno (768px - 1023px) */
@media (max-width: 1024px) {
    .login-left {
        width: 50%;
        min-width: 350px;
        padding: 50px 40px;
    }
    
    .login-right {
        width: 50%;
    }
    
    .login-title {
        font-size: 30px;
    }
    
    .logo-img {
        max-width: 180px;
    }
    
    .logo-img-large {
        max-width: 280px;
    }
    
    .logo-primary-large,
    .logo-secondary-large {
        font-size: 55px;
        letter-spacing: 2px;
    }
}

/* Tablet Portrait (768px - 1023px) */
@media (max-width: 1023px) and (min-width: 769px) {
    .login-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }
    
    .login-left {
        width: 100%;
        min-width: auto;
        height: auto;
        min-height: 60vh;
        padding: 50px 40px;
    }
    
    .login-right {
        width: 100%;
        height: auto;
        min-height: 40vh;
        padding: 40px 20px;
    }
    
    .login-content {
        max-width: 500px;
        margin: 0 auto;
    }
}

/* Mobile Grande e Tablet Pequeno (480px - 767px) */
@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }
    
    .login-left {
        width: 100%;
        min-width: auto;
        height: 100vh;
        min-height: 100vh;
        padding: 40px 30px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .login-right {
        display: none; /* Esconde a coluna branca com logo em mobile */
    }
    
    .login-logo {
        margin-bottom: 36px;
    }
    
    .logo-img {
        width: 82%;
        max-width: 300px;
    }
    
    .logo-primary,
    .logo-secondary {
        font-size: 30px;
    }
    
    .login-title {
        font-size: 26px;
    }
    
    .login-subtitle {
        font-size: 14px;
        margin-bottom: 35px;
    }
    
    .form-field {
        margin-bottom: 20px;
    }
    
    .logo-img-large {
        max-width: 200px;
    }
    
    .logo-primary-large,
    .logo-secondary-large {
        font-size: 42px;
        letter-spacing: 2px;
    }
}

/* Mobile (320px - 479px) */
@media (max-width: 480px) {
    .login-left {
        width: 100%;
        height: 100vh;
        min-height: 100vh;
        padding: 30px 20px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .login-right {
        display: none;
    }
    
    .login-logo {
        margin-bottom: 28px;
    }
    
    .logo-img {
        width: 88%;
        max-width: 280px;
    }
    
    .logo-primary,
    .logo-secondary {
        font-size: 26px;
    }
    
    .login-title {
        font-size: 22px;
        margin-bottom: 10px;
    }
    
    .login-subtitle {
        font-size: 13px;
        margin-bottom: 30px;
    }
    
    .form-input {
        padding: 12px 14px;
        font-size: 16px; /* Evita zoom no iOS */
    }
    
    .login-button {
        padding: 14px;
        font-size: 16px;
    }
    
    .logo-img-large {
        max-width: 150px;
    }
    
    .logo-primary-large,
    .logo-secondary-large {
        font-size: 32px;
        letter-spacing: 1px;
        gap: 6px;
    }
}

/* Mobile Muito Pequeno (< 360px) */
@media (max-width: 360px) {
    .login-left {
        padding: 25px 15px;
    }
    
    .login-right {
        padding: 20px 10px;
    }
    
    .logo-img {
        width: 90%;
        max-width: 240px;
    }
    
    .logo-primary,
    .logo-secondary {
        font-size: 22px;
    }
    
    .login-title {
        font-size: 20px;
    }
    
    .login-subtitle {
        font-size: 12px;
    }
    
    .logo-img-large {
        max-width: 120px;
    }
    
    .logo-primary-large,
    .logo-secondary-large {
        font-size: 28px;
    }
}

/* Orientação Landscape em Mobile - Mantém apenas formulário */
@media (max-width: 768px) and (orientation: landscape) {
    .login-left {
        width: 100%;
        height: 100vh;
        min-height: 100vh;
        padding: 20px 30px;
    }
    
    .login-right {
        display: none; /* Esconde também em landscape mobile */
    }
    
    .login-logo {
        margin-bottom: 20px;
    }
    
    .login-title {
        font-size: 24px;
        margin-bottom: 8px;
    }
    
    .login-subtitle {
        font-size: 13px;
        margin-bottom: 20px;
    }
    
    .form-field {
        margin-bottom: 15px;
    }
}
