@import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap");

* {
    font-family: "Inter", sans-serif;
    text-decoration: none;
    color: inherit;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    height: 100vh;
    overflow: hidden;
}

/* ===== CONTAINER PRINCIPAL ===== */
.login-container {
    display: flex;
    width: 100%;
    height: 100vh;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
}

/* ===== LADO ESQUERDO - FORMULÁRIO ===== */
.login-form-section {
    flex: 1;
    min-width: 400px;
    max-width: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.form-container {
    width: 100%;
    max-width: 400px;
    padding: 40px 0;
    animation: fadeIn 0.8s ease-out;
}

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

/* ===== CABEÇALHO DO FORMULÁRIO ===== */
.form-header {
    text-align: center;
    margin-bottom: 40px;
}

.form-header h1 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 10px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.form-header p {
    color: #666;
    font-size: 1.1rem;
    line-height: 1.5;
}

/* ===== GRUPOS DE FORMULÁRIO ===== */
.form-group {
    margin-bottom: 25px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #444;
    font-size: 0.95rem;
}

.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #165b9c;
    font-size: 1.1rem;
    z-index: 2;
}

.form-control {
    width: 100%;
    padding: 15px 15px 15px 45px;
    border: 1px solid #000000;
    border-radius: 25px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #ffffff;
    color: #000000;
}

.form-control::placeholder {
    color: #999;
    font-size: 0.95rem;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-control.error {
    border-color: #dc3545;
    background: #fff5f5;
}

/* ===== BOTÃO DE VISUALIZAR SENHA ===== */
.password-toggle {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 5px;
    transition: color 0.3s ease;
    z-index: 2;
}

.password-toggle:hover {
    color: #667eea;
}

/* ===== CHECKBOX PERSONALIZADO (igual ao criar conta) ===== */
.terms-group {
    margin-top: 10px;
    margin-bottom: 20px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    position: relative;
    padding-left: 35px;
    color: #555;
    font-size: 0.95rem;
    line-height: 1.5;
    min-height: 24px;
}

.checkbox-label input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 22px;
    width: 22px;
    background-color: #fff;
    border: 2px solid #165b9c;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.checkbox-label:hover .checkmark {
    background-color: #f0f8ff;
}

.checkbox-label input:checked ~ .checkmark {
    background-color: #165b9c;
    border-color: #165b9c;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-label input:checked ~ .checkmark:after {
    display: block;
}

/* Estilos de foco para acessibilidade */
.checkbox-label input:focus-visible ~ .checkmark {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* ===== BOTÃO DE LOGIN ===== */
.login-btn {
    width: 16.8rem;
    padding: 16px;
    background: #007952;
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(102, 126, 234, 0.4);
}

.login-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

.login-btn.loading {
    opacity: 0.8;
    cursor: not-allowed;
}

.login-btn .btn-text {
    display: inline-block;
    transition: opacity 0.3s ease;
}

.login-btn .btn-spinner {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: none;
    font-size: 1.2rem;
}

.login-btn.loading .btn-text {
    opacity: 0;
}

.login-btn.loading .btn-spinner {
    display: block;
}

/* ===== RODAPÉ DO FORMULÁRIO ===== */
.form-footer {
    margin-top: 30px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.form-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-block;
    margin: 0 5px;
}

.form-footer a:hover {
    color: #764ba2;
    text-decoration: underline;
    transform: translateY(-1px);
}

.form-footer .forgot-password {
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.form-footer .signup-link {
    font-weight: 600;
    font-size: 1rem;
}

.form-footer span {
    color: #666;
    font-size: 0.95rem;
}

/* ===== LADO DIREITO - IMAGEM DE FUNDO ===== */
.login-image-section {
    flex: 1;
    position: relative;
    background:
        linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)),
        url("../images/login-bg.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 80px;
    min-height: 100vh;
    transition: all 0.5s ease;
    border-bottom-left-radius: 30px;
    border-top-left-radius: 30px;
}

/* ===== LOGO NO TOPO (LADO DIREITO) ===== */
.top-logo {
    text-align: center;
    max-width: 90%;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.top-logo img {
    width: 100%;
    max-width: 800px;
    height: auto;
    margin-bottom: 15px;
    transition: transform 0.3s ease;
}

.top-logo h2 {
    color: #333;
    margin-top: 10px;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* ===== MENSAGENS DE ALERTA ===== */
.alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    font-size: 0.95rem;
    line-height: 1.5;
    animation: slideIn 0.5s ease-out;
    display: flex;
    align-items: center;
    gap: 10px;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.alert i {
    font-size: 1.2rem;
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 1px solid #b1dfbb;
}

.alert-success i {
    color: #28a745;
}

.alert-error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 1px solid #f1b0b7;
}

.alert-error i {
    color: #dc3545;
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 1100px) {
    .form-header h1 {
        font-size: 2.2rem;
    }

    .top-logo {
        padding: 25px 40px;
    }

    .top-logo img {
        max-width: 250px;
    }
}

@media (max-width: 992px) {
    .login-container {
        flex-direction: column;
    }

    .login-form-section {
        max-width: 100%;
        min-width: 100%;
        padding: 30px;
        order: 2;
        min-height: 60vh;
    }

    .login-image-section {
        display: none;
    }

    .form-container {
        padding: 20px 0;
    }

    .form-header h1 {
        font-size: 2rem;
    }

    .top-logo {
        padding: 20px 30px;
        max-width: 80%;
    }

    .top-logo img {
        max-width: 200px;
    }

    .top-logo h2 {
        font-size: 1.3rem;
    }
}

@media (max-width: 576px) {
    .login-form-section {
        padding: 20px;
    }

    .form-header h1 {
        font-size: 1.8rem;
    }

    .form-header p {
        font-size: 1rem;
    }

    .form-control {
        padding: 12px 12px 12px 40px;
        font-size: 0.95rem;
    }

    .login-btn {
        padding: 14px;
        font-size: 1rem;
    }

    .top-logo {
        padding: 15px 25px;
        max-width: 90%;
    }

    .top-logo img {
        max-width: 180px;
    }

    .top-logo h2 {
        font-size: 1.2rem;
    }

    .alert {
        padding: 12px 15px;
        font-size: 0.9rem;
    }

    .checkbox-label {
        font-size: 0.9rem;
        padding-left: 30px;
    }

    .checkmark {
        height: 20px;
        width: 20px;
    }
}

@media (max-height: 700px) {
    .form-container {
        padding: 20px 0;
    }

    .form-header {
        margin-bottom: 25px;
    }

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

    .form-footer {
        margin-top: 20px;
        padding-top: 15px;
    }
}

/* ===== ANIMAÇÕES ADICIONAIS ===== */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(102, 126, 234, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* ===== ESTILOS PARA FOCO ACESSÍVEL ===== */
.form-control:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.login-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.password-toggle:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
    border-radius: 3px;
}

/* ===== LOADER PERSONALIZADO ===== */
.loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* ===== ESTADO DESABILITADO ===== */
.form-control:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f0f0f0;
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}
