/* ===== VARIÁVEIS ===== */
:root {
    --primary: #4361ee;
    --primary-dark: #3a56d4;
    --primary-light: #eef2ff;
    --secondary: #7209b7;
    --accent: #f72585;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1f2937;
    --light: #f8fafc;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== BASE ===== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.auth-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.auth-shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 6s ease-in-out infinite;
}

.auth-shape-1 {
    width: 200px;
    height: 200px;
    top: 10%;
    left: 5%;
    animation-delay: 0s;
}

.auth-shape-2 {
    width: 150px;
    height: 150px;
    top: 60%;
    left: 80%;
    animation-delay: 2s;
}

.auth-shape-3 {
    width: 100px;
    height: 100px;
    top: 80%;
    left: 10%;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

/* ===== LAYOUT ===== */
.auth-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.auth-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: white;
}

.auth-hero-content {
    max-width: 480px;
    width: 100%;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.auth-form-section {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    margin: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
}

.auth-form-container {
    max-width: 400px;
    width: 100%;
}

/* ===== LOGO ===== */
.auth-logo {
    text-decoration: none;
    margin-bottom: 3rem;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    height: 2.5rem;
    width: auto;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

/* ===== HERO ===== */
.hero-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.gradient-text {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.125rem;
    line-height: 1.6;
    opacity: 0.9;
    margin-bottom: 2.5rem;
}

.hero-features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 3rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1rem;
}

.feature-icon {
    width: 24px;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
}

.hero-footer {
    margin-top: auto;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-footer p {
    margin-bottom: 1rem;
    opacity: 0.8;
}

.btn-login-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    text-decoration: none;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius);
    transition: var(--transition);
}

.btn-login-link:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    color: white;
    text-decoration: none;
}

/* ===== FORMULÁRIO ===== */
.auth-form-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.form-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.form-subtitle {
    color: var(--gray-600);
    font-size: 1rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-grid {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.875rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    color: var(--gray-400);
    transition: var(--transition);
    z-index: 1;
}

.form-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
    background: white;
    position: relative;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.form-input:focus + .input-icon {
    color: var(--primary);
}

.form-input.input-filled {
    border-color: var(--success);
}

.form-input.input-error {
    border-color: var(--danger);
}

.form-input.input-error:focus {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.password-toggle {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    transition: var(--transition);
    padding: 0.25rem;
}

.password-toggle:hover {
    color: var(--gray-600);
}

.error-message {
    color: var(--danger);
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-help {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

/* ===== FORÇA DA SENHA ===== */
.password-strength {
    margin-top: 0.5rem;
}

.strength-bar {
    width: 100%;
    height: 4px;
    background: var(--gray-200);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.strength-fill {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    transition: var(--transition);
}

.strength-text {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-weight: 500;
}

/* ===== CHECKBOX ===== */
.terms-group {
    margin: 1rem 0;
}

.checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--gray-700);
    line-height: 1.4;
}

.checkbox-input {
    display: none;
}

.checkbox-checkmark {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
    margin-top: 0.125rem;
}

.checkbox-checkmark::after {
    content: '✓';
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    opacity: 0;
    transition: var(--transition);
}

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

.checkbox-input:checked + .checkbox-checkmark::after {
    opacity: 1;
}

.checkbox-label a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

/* ===== BOTÕES ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
    text-decoration: none;
}

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

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 2px solid var(--gray-200);
}

.btn-secondary:hover {
    background: var(--gray-200);
    color: var(--gray-800);
    text-decoration: none;
}

.auth-submit-btn {
    width: 100%;
    padding: 1.25rem;
    font-size: 1.125rem;
}

.btn-loading {
    display: none;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== ALERTAS ===== */
.alert {
    padding: 1rem;
    border-radius: var(--radius);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--danger);
}

.alert-content p {
    margin: 0;
    font-weight: 500;
}

/* ===== DIVISOR ===== */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: var(--gray-400);
    font-size: 0.875rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--gray-200);
}

.auth-divider span {
    padding: 0 1rem;
}

/* ===== LOGIN RÁPIDO ===== */
.quick-login {
    text-align: center;
}

.quick-login-text {
    color: var(--gray-600);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 1024px) {
    .auth-layout {
        grid-template-columns: 1fr;
    }
    
    .auth-hero {
        display: none;
    }
    
    .auth-form-section {
        margin: 1rem;
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .auth-container {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }
    
    .auth-form-section {
        margin: 0.5rem;
        padding: 1.5rem;
        background: rgba(255, 255, 255, 0.98);
    }
    
    .form-title {
        font-size: 1.75rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .auth-form-section {
        padding: 1.25rem;
        margin: 0.5rem;
    }
    
    .auth-form-container {
        max-width: none;
    }
    
    .form-title {
        font-size: 1.5rem;
    }
    
    .form-input {
        padding: 0.875rem 0.875rem 0.875rem 2.75rem;
    }
    
    .input-icon {
        left: 0.875rem;
    }
    
    .auth-shape {
        display: none;
    }
}

/* ===== ELEMENTOS ESPECÍFICOS DO LOGIN ===== */

/* Wrapper do label com link de senha */
.form-label-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.forgot-password {
    font-size: 0.875rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.forgot-password:hover {
    text-decoration: underline;
    color: var(--primary-dark);
}

/* Grupo Lembrar de Mim */
.remember-group {
    margin: 0.5rem 0 1rem 0;
}

/* Links Adicionais */
.auth-links {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
    text-align: center;
}

.auth-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-600);
    text-decoration: none;
    font-size: 0.875rem;
    transition: var(--transition);
}

.auth-link:hover {
    color: var(--primary);
    text-decoration: none;
}

/* Quick Signup */
.quick-signup {
    text-align: center;
}

.quick-signup-text {
    color: var(--gray-600);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

/* Estados de foco melhorados */
.form-input:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.15);
}

/* Animações de entrada */
.auth-form-container {
    animation: formSlideIn 0.6s ease-out;
}

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

/* Responsividade específica para login */
@media (max-width: 768px) {
    .form-label-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .forgot-password {
        align-self: flex-end;
    }
    
    .auth-links {
        margin-top: 1.5rem;
        padding-top: 1rem;
    }
}

/* Melhorias de acessibilidade */
.form-input:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Estados de loading melhorados */
.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

/* Animações de erro */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.input-error {
    animation: shake 0.5s ease-in-out;
    border-color: var(--danger) !important;
}