/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a0a;
    color: #ffffff;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Contenedor principal de autenticación */
.auth-container {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Fondo animado */
.auth-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.3;
    animation: float 6s ease-in-out infinite;
}

.orb-1 {
    width: 300px;
    height: 300px;
    background: linear-gradient(45deg, #ff0000, #ff6b6b);
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.orb-2 {
    width: 200px;
    height: 200px;
    background: linear-gradient(45deg, #4ecdc4, #44a08d);
    top: 60%;
    right: 15%;
    animation-delay: 2s;
}

.orb-3 {
    width: 250px;
    height: 250px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    bottom: 20%;
    left: 50%;
    animation-delay: 4s;
}

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

/* Tarjeta de autenticación */
.auth-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

/* Header de autenticación */
.auth-header {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}

.logo i {
    font-size: 2.5rem;
    color: #ff0000;
    text-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(45deg, #ffffff, #e0e0e0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: #b0b0b0;
    font-size: 0.95rem;
    font-weight: 400;
}

/* Pestañas */
.auth-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 30px;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: #b0b0b0;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.tab-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.tab-btn:hover:not(.active) {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

/* Formularios */
.auth-form {
    display: none;
    animation: fadeIn 0.3s ease;
}

.auth-form.active {
    display: block;
}

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

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

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

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

.input-wrapper i {
    position: absolute;
    left: 16px;
    color: #666;
    z-index: 2;
    transition: color 0.3s ease;
}

.input-wrapper input {
    width: 100%;
    padding: 16px 48px 16px 48px;
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #333333;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.input-wrapper input:focus {
    outline: none;
    border-color: #ff0000;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.1);
    font-size: 0.95rem; /* Mantener tamaño consistente */
}

.input-wrapper input:focus + i,
.input-wrapper input:focus ~ i {
    color: #ff0000;
}

.input-wrapper input::placeholder {
    color: #999;
}

.toggle-password {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px;
    transition: color 0.3s ease;
    z-index: 10;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-password:hover {
    color: #ffffff;
}

/* Opciones del formulario */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #b0b0b0;
}

.checkbox-wrapper input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkmark {
    background: #ff0000;
    border-color: #ff0000;
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.forgot-password {
    color: #4a9eff;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: #66b3ff;
}

.terms-link {
    color: #4a9eff;
    text-decoration: none;
}

.terms-link:hover {
    color: #66b3ff;
    text-decoration: underline;
}

/* Botones */
.auth-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.auth-btn.primary {
    background: linear-gradient(45deg, #ff0000, #ff6b6b);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.3);
}

.auth-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.4);
}

.auth-btn.google-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-btn.google-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.auth-btn i {
    font-size: 1.1rem;
}

/* Divisor */
.divider {
    text-align: center;
    margin: 24px 0;
    position: relative;
    color: #b0b0b0;
    font-size: 0.9rem;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.divider span {
    background: rgba(255, 255, 255, 0.05);
    padding: 0 16px;
    position: relative;
    z-index: 1;
}

/* Footer de autenticación */
.auth-footer {
    text-align: center;
    margin-top: 24px;
}

.auth-footer p {
    color: #666;
    font-size: 0.8rem;
    line-height: 1.5;
}

.auth-footer a {
    color: #4a9eff;
    text-decoration: none;
}

.auth-footer a:hover {
    color: #66b3ff;
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 480px) {
    .auth-container {
        padding: 16px;
    }
    
    .auth-card {
        padding: 24px;
    }
    
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Animaciones adicionales */
.auth-card {
    animation: slideUp 0.6s ease;
}

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

/* Estados de carga */
.auth-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.auth-btn.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

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

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 0;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

.modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    color: #ffffff;
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: #666;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.modal-body {
    padding: 24px;
}

.modal-body p {
    color: #b0b0b0;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Indicadores de fortaleza de contraseña */
.password-strength {
    margin-top: 8px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.password-strength.weak .password-strength-bar {
    background: #ef4444;
    width: 25%;
}

.password-strength.fair .password-strength-bar {
    background: #f59e0b;
    width: 50%;
}

.password-strength.good .password-strength-bar {
    background: #3b82f6;
    width: 75%;
}

.password-strength.strong .password-strength-bar {
    background: #10b981;
    width: 100%;
}

.password-requirements {
    margin-top: 8px;
    font-size: 0.8rem;
    color: #666;
}

.password-requirements ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.password-requirements li {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.password-requirements li.valid {
    color: #10b981;
}

.password-requirements li.invalid {
    color: #ef4444;
}

/* Mejoras visuales para Google OAuth */
.google-btn {
    position: relative;
    overflow: hidden;
}

.google-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.google-btn:hover::before {
    left: 100%;
}

/* Validaciones en tiempo real */
.input-wrapper.error input {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
    font-size: 0.95rem; /* Mantener tamaño consistente */
}

.input-wrapper.error i {
    color: #ef4444;
}

.input-wrapper.success input {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
    font-size: 0.95rem; /* Mantener tamaño consistente */
}

.input-wrapper.success i {
    color: #10b981;
}

.error-message {
    color: #ef4444;
    font-size: 0.8rem;
    margin-top: 4px;
    display: none;
}

.input-wrapper.error .error-message {
    display: block;
}

.success-message {
    color: #10b981;
    font-size: 0.8rem;
    margin-top: 4px;
    display: none;
}

.input-wrapper.success .success-message {
    display: block;
}
