/* ============================================
   MODALES - Sistema base de modales
   Modal base + Login Required Modal compartido
   ============================================ */

/* Base modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 1rem;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
}

.modal-header h2 {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.modal-close:hover {
    opacity: 1;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

/* ============================================
   LOGIN REQUIRED MODAL
   Modal para usuarios no logueados
   ============================================ */

.login-required-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 1rem;
    animation: lr-fadeIn 0.2s ease-out;
}

.login-required-modal-overlay.closing {
    animation: lr-fadeOut 0.2s ease-in forwards;
}

@keyframes lr-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes lr-fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.login-required-modal-content {
    position: relative;
    background: white;
    border-radius: 20px;
    max-width: 420px;
    width: 100%;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.35);
    animation: lr-modalSlideIn 0.3s ease-out;
}

.login-required-modal-overlay.closing .login-required-modal-content {
    animation: lr-modalSlideOut 0.2s ease-in forwards;
}

@keyframes lr-modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes lr-modalSlideOut {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
}

.login-required-modal-header {
    position: relative;
    text-align: center;
    padding: 2rem 1.5rem 1.5rem;
    background: linear-gradient(135deg, #0077B5 0%, #00A0DC 100%);
    color: white;
}

.login-required-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
}

.login-required-modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.login-required-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 1.3rem;
    color: white;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 10;
}

.login-required-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.login-required-modal-body {
    padding: 1.5rem 2rem;
    text-align: center;
}

.login-required-modal-body p {
    margin: 0.75rem 0;
    color: #555;
    font-size: 0.95rem;
    line-height: 1.5;
}

.login-required-modal-body .job-info {
    background: #f0f7ff;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    color: #0077B5;
    margin-bottom: 1rem;
}

.login-required-modal-body .benefit-text {
    color: #28a745;
    font-size: 0.9rem;
}

.login-required-modal-footer {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 2rem 1.75rem;
}

.login-modal-btn-secondary {
    padding: 0.75rem 1.5rem;
    border: 2px solid #ddd;
    background: white;
    color: #666;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
}

.login-modal-btn-secondary:hover {
    border-color: #bbb;
    background: #f8f8f8;
}

.login-modal-btn-primary {
    padding: 0.75rem 1.5rem;
    border: none;
    background: linear-gradient(135deg, #0077B5 0%, #005885 100%);
    color: white;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: all 0.2s;
}

.login-modal-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 119, 181, 0.4);
}

/* ============================================
   KILLER QUESTIONS - Apply modal
   Formulario de preguntas al candidato
   ============================================ */
.kq-apply-section {
    margin-bottom: 16px;
}

.kq-apply-section h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.kq-apply-section h4 i {
    color: #0077B5;
}

.kq-apply-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
}

.kq-apply-question {
    font-weight: 600;
    font-size: 0.92rem;
    color: #333;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.kq-apply-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #0077B5;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.kq-apply-required {
    color: #dc3545;
    font-size: 1.1em;
}

.kq-apply-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.kq-apply-radio {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.88rem;
    transition: all 0.2s;
}

.kq-apply-radio:hover {
    background: #f0f7ff;
    border-color: #0077B5;
}

.kq-apply-radio input[type="radio"] {
    accent-color: #0077B5;
}

.kq-apply-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.kq-apply-input:focus {
    outline: none;
    border-color: #0077B5;
    box-shadow: 0 0 0 2px rgba(0, 119, 181, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
    .modal-content {
        max-height: 95vh;
        margin: 0.5rem;
    }

    .modal-header h2 {
        font-size: 1rem;
    }

    .login-required-modal-content {
        max-width: 95%;
        margin: 0 10px;
    }

    .login-required-modal-footer {
        flex-direction: column;
    }

    .login-modal-btn-secondary,
    .login-modal-btn-primary {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .modal-content {
        max-width: calc(100% - 20px);
        margin: 10px;
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .login-required-modal-content {
        max-width: 95%;
        margin: 0 10px;
    }

    .login-required-modal-footer {
        flex-direction: column;
    }

    .login-modal-btn-secondary,
    .login-modal-btn-primary {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   APPLY MODAL - Modal de aplicación a ofertas
   ============================================ */
.apply-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 1rem;
}

.apply-modal-content {
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.apply-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #eee;
    background: linear-gradient(135deg, #0077B5 0%, #005885 100%);
    color: white;
}

.apply-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.apply-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.apply-modal-close:hover {
    opacity: 1;
}

.apply-modal-body {
    padding: 1.5rem;
}

.apply-modal-body p {
    margin: 0.5rem 0;
    color: #555;
}

.apply-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #eee;
    background: #f8f9fa;
}

.apply-btn-cancel {
    padding: 0.6rem 1.25rem;
    border: 1px solid #ddd;
    background: white;
    color: #666;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.apply-btn-cancel:hover {
    background: #f0f0f0;
}

.apply-btn-submit {
    padding: 0.6rem 1.25rem;
    border: none;
    background: linear-gradient(135deg, #0077B5 0%, #005885 100%);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.apply-btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 119, 181, 0.3);
}

@media (max-width: 600px) {
    .apply-modal-content {
        margin: 0 10px;
        max-width: calc(100% - 20px);
    }

    .apply-modal-header {
        padding: 1rem;
    }

    .apply-modal-body {
        padding: 1rem;
    }

    .apply-modal-footer {
        padding: 0.75rem 1rem 1rem;
        flex-direction: column;
    }

    .apply-btn-cancel,
    .apply-btn-submit {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   FYLJ MODAL SYSTEM
   Sistema unificado de modales (alert / confirm)
   Reutiliza la misma estructura visual del
   Login Required Modal, parametrizado por tipo.
   ============================================ */

.fylj-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    padding: 1rem;
    animation: lr-fadeIn 0.2s ease-out;
}

.fylj-modal-overlay.closing {
    animation: lr-fadeOut 0.2s ease-in forwards;
}

.fylj-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    max-width: 370px;
    width: 100%;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.35);
    animation: lr-modalSlideIn 0.3s ease-out;
}

.fylj-modal-overlay.closing .fylj-modal-content {
    animation: lr-modalSlideOut 0.2s ease-in forwards;
}

/* ---- Header (coloreado según tipo) ---- */

.fylj-modal-header {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2.75rem 1rem 1.25rem;
    color: white;
}

/* Variantes de color */
.fylj-modal-header.fylj-modal--info {
    background: linear-gradient(135deg, #0077B5 0%, #00A0DC 100%);
}

.fylj-modal-header.fylj-modal--success {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
}

.fylj-modal-header.fylj-modal--error {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.fylj-modal-header.fylj-modal--warning {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
}

.fylj-modal-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.15rem;
}

.fylj-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: left;
}

.fylj-modal-close {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 1.2rem;
    color: white;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 10;
}

.fylj-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ---- Body ---- */

.fylj-modal-body {
    padding: 1rem 1.5rem;
    text-align: center;
}

.fylj-modal-body p {
    margin: 0.4rem 0;
    color: #555;
    font-size: 0.92rem;
    line-height: 1.45;
}

/* ---- Footer ---- */

.fylj-modal-footer {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem 1.25rem;
}

.fylj-modal-btn-secondary {
    padding: 0.6rem 1.25rem;
    border: 2px solid #ddd;
    background: white;
    color: #666;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.fylj-modal-btn-secondary:hover {
    border-color: #bbb;
    background: #f8f8f8;
}

/* Botón primario — color según tipo */
.fylj-modal-btn-primary {
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: all 0.2s;
    flex: 1;
    text-align: center;
}

.fylj-modal-btn-primary:hover {
    transform: translateY(-2px);
}

.fylj-modal-btn-primary.fylj-btn--info {
    background: linear-gradient(135deg, #0077B5 0%, #005885 100%);
}
.fylj-modal-btn-primary.fylj-btn--info:hover {
    box-shadow: 0 6px 20px rgba(0, 119, 181, 0.4);
}

.fylj-modal-btn-primary.fylj-btn--success {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
}
.fylj-modal-btn-primary.fylj-btn--success:hover {
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.fylj-modal-btn-primary.fylj-btn--error {
    background: linear-gradient(135deg, #dc3545 0%, #bd2130 100%);
}
.fylj-modal-btn-primary.fylj-btn--error:hover {
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

.fylj-modal-btn-primary.fylj-btn--warning {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
}
.fylj-modal-btn-primary.fylj-btn--warning:hover {
    box-shadow: 0 6px 20px rgba(230, 126, 34, 0.4);
}

/* ---- Responsive ---- */

@media (max-width: 768px) {
    .fylj-modal-content {
        max-width: 95%;
        margin: 0 10px;
    }

    .fylj-modal-footer {
        flex-direction: column;
    }

    .fylj-modal-btn-secondary,
    .fylj-modal-btn-primary {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .fylj-modal-content {
        max-width: 95%;
        margin: 0 10px;
    }

    .fylj-modal-footer {
        flex-direction: column;
    }

    .fylj-modal-btn-secondary,
    .fylj-modal-btn-primary {
        width: 100%;
        justify-content: center;
    }
}