/**
 * Archivo: /assets/css/auth.css
 * Estilos para páginas de autenticación (login, registro, recuperar)
 */

/* Background Pattern */
.bg-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.6;
}

.bg-pattern::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(233, 78, 27, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(255, 122, 69, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 60% 20%, rgba(255, 154, 108, 0.08) 0%, transparent 30%);
    animation: bgFloat 25s ease-in-out infinite;
}

@keyframes bgFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(3%, 3%) scale(1.02); }
    66% { transform: translate(-2%, 1%) scale(0.98); }
}

/* Particles */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--gradient-brand);
    border-radius: 50%;
    opacity: 0.3;
    animation: particleFloat 15s infinite ease-in-out;
}

.particle:nth-child(1) { left: 10%; top: 20%; animation-delay: 0s; }
.particle:nth-child(2) { left: 25%; top: 60%; animation-delay: 2s; }
.particle:nth-child(3) { left: 45%; top: 35%; animation-delay: 4s; }
.particle:nth-child(4) { left: 70%; top: 80%; animation-delay: 1s; }
.particle:nth-child(5) { left: 85%; top: 25%; animation-delay: 3s; }

@keyframes particleFloat {
    0%, 100% { transform: translateY(0) translateX(0); opacity: 0.3; }
    50% { transform: translateY(-30px) translateX(10px); opacity: 0.5; }
}

/* Auth Container */
.auth-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* Auth Info Panel (Left) */
.auth-info {
    position: relative;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.auth-info-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.auth-info-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.15;
}

.auth-info-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, 
        rgba(15, 20, 32, 0.95) 0%,
        rgba(15, 20, 32, 0.85) 50%,
        rgba(15, 20, 32, 0.9) 100%);
}

.auth-info-content {
    position: relative;
    z-index: 2;
    max-width: 500px;
}

.auth-info .logo {
    margin-bottom: 3rem;
}

.auth-info-main h1 {
    font-size: clamp(2rem, 3vw, 2.5rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.auth-info-main > p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    line-height: 1.7;
}

/* Auth Features */
.auth-features {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.auth-feature {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    transition: all 0.3s ease;
}

.auth-feature:hover {
    background: rgba(233, 78, 27, 0.05);
    border-color: rgba(233, 78, 27, 0.2);
    transform: translateX(5px);
}

.auth-feature-icon {
    width: 44px;
    height: 44px;
    background: var(--gradient-brand);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.auth-feature-icon svg {
    width: 22px;
    height: 22px;
    color: white;
}

.auth-feature-text h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.auth-feature-text p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Platforms section */
.auth-platforms {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-subtle);
}

.auth-platforms > span {
    font-size: 0.9rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 1rem;
}

.platform-icons {
    display: flex;
    gap: 0.75rem;
}

.platform-icon {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    transition: all 0.3s ease;
    cursor: default;
}

.platform-icon:hover {
    background: rgba(233, 78, 27, 0.1);
    border-color: rgba(233, 78, 27, 0.3);
    transform: translateY(-3px);
}

/* Auth Form Panel (Right) */
.auth-form-container {
    background: var(--dark-surface);
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: 1px solid var(--border-subtle);
    position: relative;
    overflow-y: auto;
}

.auth-form-wrapper {
    width: 100%;
    max-width: 440px;
    padding: 1rem 0;
}

.mobile-logo {
    display: none;
    margin-bottom: 2rem;
}

.auth-form-header {
    margin-bottom: 2rem;
}

.auth-form-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.auth-form-header p {
    color: var(--text-muted);
}

/* Form Styles */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

.form-group label .required {
    color: var(--primary);
}

/* Input Wrapper */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 1;
}

.input-icon svg {
    width: 20px;
    height: 20px;
}

.form-input {
    width: 100%;
    padding: 0.9rem 1rem;
    background: var(--dark-input);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    outline: none;
}

.input-wrapper .form-input {
    padding-left: 3rem;
}

.form-input::placeholder {
    color: var(--text-subtle);
}

.form-input:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(233, 78, 27, 0.15), 0 0 20px rgba(233, 78, 27, 0.1);
    background: var(--dark-elevated);
}

.form-input:focus + .input-icon,
.form-input:focus ~ .input-icon {
    color: var(--primary);
}

.input-wrapper:has(.form-input:focus) .input-icon {
    color: var(--primary);
}

.form-input.error {
    border-color: var(--error);
    background: rgba(239, 68, 68, 0.05);
}

.form-input.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* Input hints and errors */
.input-hint {
    font-size: 0.8rem;
    color: var(--text-subtle);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.input-error {
    font-size: 0.8rem;
    color: var(--error);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* Phone input */
.phone-wrapper {
    display: flex;
    gap: 0;
}

.phone-prefix {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1rem;
    background: var(--dark-elevated);
    border: 1px solid var(--border-subtle);
    border-right: none;
    border-radius: 12px 0 0 12px;
    color: var(--text-muted);
    font-size: 0.9rem;
    white-space: nowrap;
}

.phone-prefix img {
    border-radius: 2px;
}

.phone-input {
    border-radius: 0 12px 12px 0 !important;
    padding-left: 1rem !important;
}

/* Toggle password */
.toggle-password {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-subtle);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: var(--text);
}

.toggle-password svg {
    width: 20px;
    height: 20px;
}

/* Password Strength */
.password-strength {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

.strength-bars {
    display: flex;
    gap: 4px;
    flex: 1;
}

.strength-bar {
    height: 4px;
    flex: 1;
    background: var(--border-subtle);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.strength-bar.active {
    background: var(--error);
}

.strength-bar.active.weak { background: var(--error); }
.strength-bar.active.medium { background: var(--warning); }
.strength-bar.active.strong { background: var(--success); }

.strength-text {
    font-size: 0.75rem;
    color: var(--text-subtle);
    min-width: 100px;
    text-align: right;
}

.strength-text.weak { color: var(--error); }
.strength-text.medium { color: var(--warning); }
.strength-text.strong { color: var(--success); }

/* Password Requirements */
.password-requirements {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-top: 0.5rem;
}

.requirement {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--text-subtle);
    transition: color 0.3s ease;
}

.requirement svg {
    width: 16px;
    height: 16px;
    opacity: 0.4;
    transition: all 0.3s ease;
}

.requirement.valid {
    color: var(--success);
}

.requirement.valid svg {
    opacity: 1;
    color: var(--success);
}

/* Password match */
.password-match {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--success);
    margin-top: 0.25rem;
}

.password-match svg {
    width: 16px;
    height: 16px;
}

/* Checkbox */
.checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.checkbox-wrapper input {
    display: none;
}

.checkbox-custom {
    width: 22px;
    height: 22px;
    min-width: 22px;
    background: var(--dark-input);
    border: 2px solid var(--border-subtle);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin-top: 1px;
}

.checkbox-custom::after {
    content: '';
    width: 10px;
    height: 6px;
    border: 2px solid white;
    border-top: none;
    border-right: none;
    transform: rotate(-45deg) scale(0);
    transition: transform 0.2s ease;
    margin-top: -2px;
}

.checkbox-wrapper input:checked + .checkbox-custom {
    background: var(--gradient-brand);
    border-color: var(--primary);
}

.checkbox-wrapper input:checked + .checkbox-custom::after {
    transform: rotate(-45deg) scale(1);
}

.checkbox-label a {
    color: var(--primary-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

.checkbox-label a:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* Buttons */
.btn-block {
    width: 100%;
}

.btn-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.spinner {
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Auth Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}

.auth-divider span {
    font-size: 0.85rem;
    color: var(--text-subtle);
    white-space: nowrap;
}

/* Auth Footer */
.auth-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-subtle);
    text-align: center;
}

.auth-footer p {
    font-size: 0.8rem;
    color: var(--text-subtle);
    margin-bottom: 0.5rem;
}

.auth-footer .footer-mexico {
    justify-content: center;
    font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .auth-container {
        grid-template-columns: 1fr;
    }
    
    .auth-info {
        display: none;
    }
    
    .auth-form-container {
        border-left: none;
        padding: 1.5rem;
    }
    
    .mobile-logo {
        display: flex;
        justify-content: center;
    }
    
    .auth-form-header {
        text-align: center;
    }
}

@media (max-width: 768px) {
    .auth-form-wrapper {
        max-width: 100%;
    }
    
    .form-row-2 {
        grid-template-columns: 1fr;
    }
}

/* Form Options (remember me, forgot) */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.forgot-link {
    font-size: 0.9rem;
    color: var(--primary-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

.forgot-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* Social Login */
.social-login {
    margin-top: 1rem;
}

.social-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
    background: var(--dark-input);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-social:hover:not(:disabled) {
    background: var(--dark-elevated);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.btn-social:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-social.btn-whatsapp:hover:not(:disabled) {
    border-color: rgba(37, 211, 102, 0.3);
    background: rgba(37, 211, 102, 0.05);
}

/* Login specific - compact form */
.auth-form-container .auth-form-wrapper.login-form {
    max-width: 400px;
}

/* Animation for alerts */
.alert {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Input focus animation */
.input-wrapper.focused .input-icon {
    color: var(--primary);
    transform: scale(1.1);
    transition: all 0.3s ease;
}

/* Success state for inputs */
.form-input.success {
    border-color: var(--success);
}

.form-input.success:focus {
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

@media (max-width: 480px) {
    .auth-form-container {
        padding: 1rem;
    }
    
    .phone-prefix {
        padding: 0 0.75rem;
        font-size: 0.85rem;
    }
    
    .password-requirements {
        flex-direction: column;
        gap: 0.35rem;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .social-buttons {
        grid-template-columns: 1fr;
    }
}