/* Sistema de Autenticación MDS 2025 */

/* Overlay que cubre toda la pantalla */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

/* Ocultar overlay cuando está autenticado */
.auth-overlay.hidden {
    display: none;
}

/* Contenedor del formulario de autenticación */
.auth-container {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 400px;
    width: 90%;
    transform: scale(0.9);
    animation: authSlideIn 0.3s ease-out forwards;
}

@keyframes authSlideIn {
    to {
        transform: scale(1);
    }
}

/* Títulos del formulario */
.auth-title {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 300;
}

.auth-subtitle {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
}

.course-info-auth {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    border-left: 4px solid #3498db;
}

.course-info-auth h3 {
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 18px;
}

.course-info-auth p {
    color: #666;
    margin: 0;
    font-size: 14px;
}

/* Campo de contraseña */
.password-input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.password-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Botón de acceso */
.auth-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.auth-btn:hover {
    background: linear-gradient(135deg, #2980b9, #1f4e79);
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

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

/* Mensaje de error */
.error-message {
    background: #fee;
    color: #c33;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
    border: 1px solid #fcc;
    font-size: 14px;
    display: none;
}

.error-message.show {
    display: block;
    animation: errorShake 0.5s ease-in-out;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Mensaje de éxito */
.success-message {
    background: #efe;
    color: #363;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
    border: 1px solid #cfc;
    font-size: 14px;
    display: none;
}

.success-message.show {
    display: block;
    animation: successFadeIn 0.5s ease-in-out;
}

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

/* Información adicional */
.auth-info {
    font-size: 12px;
    color: #999;
    margin-top: 20px;
    line-height: 1.4;
}

.auth-info a {
    color: #3498db;
    text-decoration: none;
}

.auth-info a:hover {
    text-decoration: underline;
}

/* Estado de contenido bloqueado */
.content-blocked {
    filter: blur(2px);
    pointer-events: none;
    user-select: none;
}

/* Efectos cuando se autentica */
.auth-success .auth-overlay {
    animation: authFadeOut 0.5s ease-out forwards;
}

@keyframes authFadeOut {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

/* Estilo para links bloqueados */
.topic-title a.blocked {
    color: #999 !important;
    cursor: not-allowed !important;
    pointer-events: none;
}

.topic-title a.blocked:hover {
    color: #999 !important;
}

/* Indicador de contenido bloqueado */
.locked-indicator {
    display: inline-block;
    margin-left: 8px;
    color: #999;
    font-size: 14px;
}

.topic-card.locked {
    opacity: 0.6;
    position: relative;
}

.topic-card.locked::before {
    content: "🔒";
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 18px;
    opacity: 0.5;
}

/* Loading state */
.auth-btn.loading {
    background: #bdc3c7;
    cursor: not-allowed;
    position: relative;
}

.auth-btn.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Responsive para autenticación */
@media (max-width: 480px) {
    .auth-container {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .auth-title {
        font-size: 20px;
    }
    
    .course-info-auth {
        padding: 15px;
    }
}

/* Contenedor del campo de contraseña con ojito */
.password-container {
    position: relative;
    width: 100%;
    margin-bottom: 15px;
}

/* Ajustar el input de contraseña */
.password-input {
    width: 100%;
    padding: 15px 50px 15px 15px; /* Más padding a la derecha para el ojito */
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 0; /* Quitamos el margin porque ya está en el contenedor */
    transition: all 0.3s ease;
    font-family: inherit;
}

/* Botón del ojito */
.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #666;
    font-size: 18px;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.password-toggle:hover {
    color: #3498db;
    background: rgba(52, 152, 219, 0.1);
}

.password-toggle:focus {
    outline: none;
    color: #3498db;
}

/* Estados del ojito */
.password-toggle .eye-open {
    display: inline-block;
}

.password-toggle .eye-closed {
    display: none;
}

.password-toggle.show-password .eye-open {
    display: none;
}

.password-toggle.show-password .eye-closed {
    display: inline-block;
}