/* Login Page Specific Styles */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background-color: var(--bg-color);
}

/* Animated Background setup */
.animated-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(37, 99, 235, 0.1) 0%, transparent 70%);
    animation: pulseBg 10s infinite alternate;
    z-index: -2;
}

@keyframes pulseBg {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }

    100% {
        transform: scale(1.5);
        opacity: 0.8;
    }
}

.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.particle {
    position: absolute;
    background-color: var(--accent-light);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-color);
    opacity: 0.5;
    animation: float 15s infinite linear;
}

@keyframes float {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }

    10% {
        opacity: 0.8;
    }

    90% {
        opacity: 0.8;
    }

    100% {
        transform: translateY(-100px) scale(1);
        opacity: 0;
    }
}

.back-link {
    position: absolute;
    top: 2rem;
    left: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    z-index: 10;
}

.back-link svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.back-link:hover {
    color: var(--accent-light);
}

.back-link:hover svg {
    transform: translateX(-5px);
}

.login-container {
    width: 100%;
    max-width: 450px;
    padding: 2rem;
    z-index: 1;
    perspective: 1000px;
}

.login-card {
    padding: 2.5rem;
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    transform: translateY(20px);
    opacity: 0;
    animation: cardAppear 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cardAppear {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header .nav-logo {
    display: inline-block;
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

.login-header h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group {
    position: relative;
    width: 100%;
}

.input-group input {
    width: 100%;
    padding: 1rem 0.5rem 0.5rem;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    background: rgba(37, 99, 235, 0.05);
}

.input-group label {
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-group input:focus~label,
.input-group input:valid~label {
    top: 0;
    font-size: 0.75rem;
    color: var(--accent-light);
}

.input-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--gradient-1);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-group input:focus~.input-line {
    width: 100%;
}

.toggle-password {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: var(--accent-light);
}

.toggle-password svg {
    width: 20px;
    height: 20px;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    margin-top: -0.5rem;
    margin-bottom: 0.5rem;
}

.custom-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.custom-checkbox:hover {
    color: var(--text-color);
}

.custom-checkbox input {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
}

.custom-checkbox input:checked~.checkmark {
    background: var(--gradient-1);
    border-color: transparent;
}

.checkmark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.custom-checkbox input:checked~.checkmark::after {
    opacity: 1;
}

.forgot-password {
    color: var(--accent-light);
    text-decoration: none;
    position: relative;
}

.forgot-password::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0%;
    height: 1px;
    background-color: var(--accent-light);
    transition: width 0.3s ease;
}

.forgot-password:hover::after {
    width: 100%;
}

.btn-block {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    position: relative;
    overflow: hidden;
    margin-top: 1rem;
}

.magnetic-btn {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Button Ripple Effect */
.btn-ripple {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.login-footer {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.login-footer a {
    font-weight: 600;
    text-decoration: none;
    position: relative;
}

.login-footer a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--gradient-1);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.login-footer a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Social Auth Styles */
.social-divider {
    margin: 1.5rem 0;
    text-align: center;
    color: rgba(255,255,255,0.4);
    font-size: 0.9rem;
}

.social-auth {
    display: flex;
    gap: 10px;
}

.social-btn {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    padding: 0.8rem;
    margin-top: 0; /* Overrides btn-block top margin */
}

.social-btn:hover {
    background: rgba(255,255,255,0.1);
}

.social-btn-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.social-btn-content svg {
    width: 20px;
}

/* Responsive */
@media (max-width: 480px) {
    .login-card {
        padding: 2rem 1.5rem;
    }

    .back-link {
        top: 1rem;
        left: 1rem;
    }

    .login-header h2 {
        font-size: 1.5rem;
    }
}

/* ====== RESPONSIVE OPTIMIZATIONS ====== */

@media (max-width: 768px) {
    .login-container {
        max-width: 400px;
        padding: 1.5rem;
    }

    .login-card {
        padding: 2rem;
    }
}

@media (max-width: 480px) {
    .login-body {
        align-items: flex-start;
        padding-top: 4rem;
        overflow-y: auto;
    }

    .login-container {
        padding: 0.75rem;
    }

    .login-card {
        padding: 1.5rem 1.25rem;
        border-radius: 16px;
    }

    .login-header h2 {
        font-size: 1.4rem;
    }

    .form-options {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .social-auth {
        flex-direction: column;
        gap: 0.75rem;
    }
}

@media (max-width: 340px) {
    .login-container {
        padding: 0.5rem;
    }

    .login-card {
        padding: 1.25rem 1rem;
    }

    .login-header .nav-logo {
        font-size: 1.5rem;
    }

    .login-header h2 {
        font-size: 1.2rem;
    }

    .input-group label {
        font-size: 0.9rem;
    }

    .btn-block {
        font-size: 0.95rem;
        padding: 0.75rem;
    }
}

/* Ajuste para pantallas muy cortas (Landscape en móviles) */
@media (max-height: 600px) {
    .login-body {
        align-items: flex-start;
        padding: 2rem 0;
    }

    .login-card {
        transform: none;
        animation: fadeIn 0.5s ease forwards;
    }
}