* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-blue: #1a4d7a;
    --primary-blue-dark: #0d3d5f;
    --primary-blue-light: #2e6a9e;
    --accent-gold: #d4af37;
    --accent-green: #4caf50;
    --accent-green-light: #81c784;
    --text-white: #ffffff;
    --text-dark: #212121;
    --text-gray: #616161;
    --text-light-gray: #9e9e9e;
    --bg-white: #ffffff;
    --bg-light: #f5f5f5;
    --bg-input: #f8f9fa;
    --border-color: #e0e0e0;
    --error-color: #d32f2f;
    --error-light: #ffebee;
    --success-color: #2e7d32;
    --success-light: #e8f5e9;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: var(--bg-light);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

.login-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-container {
    width: 100%;
    max-width: 1000px;
    animation: fadeInUp 0.6s ease-out;
}

.login-box {
    background: var(--bg-white);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    width: 100%;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

/* Layout em 2 colunas */
.login-content {
    display: flex;
    min-height: 350px;
}

.form-column {
    flex: 1;
    padding: 40px 30px;
    background: linear-gradient(135deg, #2e6a9e 0%, #1a4d7a 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.welcome-title {
    color: var(--text-white);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 25px;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.form-section {
    background: transparent;
    padding: 0;
}

.logos-column {
    flex: 1;
    padding: 2px;
    background: var(--bg-white);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0;
}

.logo-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.side-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s ease;
}

.side-logo:hover {
    transform: scale(1.05);
}

.logo-cgaf-sm {
    max-width: 180px;
}

.login-form {
    width: 100%;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    color: var(--text-white);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: var(--bg-input);
    color: var(--text-dark);
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-green);
    background: var(--bg-white);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

.form-group input::placeholder {
    color: var(--text-light-gray);
}

.password-input input {
    padding-right: 48px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-gray);
    opacity: 0.6;
    transition: all 0.2s ease;
    border-radius: 6px;
    z-index: 10;
    pointer-events: auto;
    -webkit-user-select: none;
    user-select: none;
}

.toggle-password:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-white);
}

.toggle-password svg {
    width: 20px;
    height: 20px;
}

.error-message {
    display: block;
    color: var(--error-color);
    font-size: 12px;
    margin-top: 6px;
    min-height: 18px;
    font-weight: 500;
}

/* Button Group */
.button-group {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

.btn-entrar,
.btn-cadastrar {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
}

.btn-entrar {
    background: var(--accent-green);
    color: var(--text-white);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-entrar:hover {
    background: var(--accent-green-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
}

.btn-entrar:active {
    transform: translateY(0);
}

.btn-entrar:disabled {
    background: #9e9e9e;
    cursor: not-allowed;
    transform: none;
    opacity: 0.7;
}

.btn-cadastrar {
    background: var(--bg-light);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.btn-cadastrar:hover {
    background: #e0e0e0;
}

.btn-icon-arrow {
    font-size: 18px;
    font-weight: bold;
}

.btn-loader {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.alert-message {
    margin-top: 20px;
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    display: none;
    font-weight: 500;
}

.alert-message.show {
    display: block;
    animation: slideDown 0.3s ease-out;
}

.alert-message.success {
    background: var(--success-light);
    color: var(--success-color);
    border: 1px solid rgba(46, 125, 50, 0.2);
}

.alert-message.error {
    background: var(--error-light);
    color: var(--error-color);
    border: 1px solid rgba(211, 47, 47, 0.2);
}

/* Mensagem de erro da URL (sessão expirada, usuário bloqueado) */
#urlErrorMessage {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    text-align: left;
}

#urlErrorMessage .alert-icon {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
}

#urlErrorMessage .alert-content {
    flex: 1;
}

#urlErrorMessage .alert-content strong {
    display: block;
    margin-bottom: 4px;
    font-size: 15px;
}

#urlErrorMessage .alert-content p {
    margin: 0;
    font-weight: 400;
    opacity: 0.9;
}

/* Footer */
.login-footer {
    padding: 24px 30px 20px;
    background: var(--bg-white);
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.footer-main {
    color: var(--text-gray);
    font-size: 13px;
    margin-bottom: 4px;
}

.footer-copyright {
    color: var(--text-gray);
    font-size: 12px;
    margin-bottom: 16px;
}

.secure-connection {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--success-light);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--success-color);
}

.secure-icon {
    font-size: 14px;
}

/* Animações */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsividade */
@media (max-width: 768px) {
    .login-content {
        flex-direction: column;
        min-height: auto;
    }
    
    .form-column {
        padding: 40px 30px;
    }
    
    .logos-column {
        padding: 40px 30px;
        gap: 40px;
    }
    
    .side-logo {
        max-width: 200px;
    }
    
    .welcome-title {
        font-size: 28px;
        margin-bottom: 25px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 16px;
    }
    
    .login-container {
        max-width: 100%;
    }
    
    .form-column {
        padding: 30px 20px;
    }
    
    .logos-column {
        padding: 30px 20px;
        gap: 30px;
    }
    
    .side-logo {
        max-width: 150px;
    }
    
    .welcome-title {
        font-size: 24px;
        margin-bottom: 20px;
    }
    
    .form-group input {
        padding: 12px 14px;
        font-size: 16px; /* Evita zoom no iOS */
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .login-footer {
        padding: 20px;
    }
}

/* Acessibilidade */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

*:focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
    border-radius: 4px;
}
