/* ==========================================================================
   LAYOUT GENERAL Y SECCIONES
   ========================================================================== */

/* ----------------------------------------
   ESTRUCTURA PRINCIPAL
   ---------------------------------------- */
.main {
    min-height: calc(100vh - 200px);
}

/* ----------------------------------------
   SECCIONES
   ---------------------------------------- */
.section {
    padding: var(--fe-spacing-section) 0;
    position: relative;
}

.section-header {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--fe-secondary-light);
    margin-bottom: 0.75rem;
}

.section-heading {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--fe-secondary-light);
    margin-bottom: 0.75rem;
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--fe-text-muted);
    font-weight: 500;
    max-width: 600px;
    margin: 0;
}

.section-header.text-center .section-subtitle {
    margin-left: auto;
    margin-right: auto;
}

/* ----------------------------------------
   MODAL GENERICO
   ---------------------------------------- */
.fe-modal {
    border: 1px solid rgba(44, 61, 133, 0.08);
    border-radius: 20px;
    box-shadow: 0 8px 40px rgba(44, 61, 133, 0.13);
    overflow: hidden;
    position: relative;
    padding: 2.5rem 2rem 2.25rem;
    background: #ffffff;
}

/* Franja de color superior por tipo — invisible por defecto */
.fe-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: transparent;
    border-radius: 20px 20px 0 0;
}


.fe-modal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(148, 163, 184, 0.18);
    border: none;
    color: #94a3b8;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--fe-transition-fast);
    z-index: 1;
}

.fe-modal__close:hover {
    background: rgba(44, 61, 133, 0.12);
    color: #2C3D85;
}

.fe-modal__body {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.85rem;
    padding-top: 0.5rem;
}

/* Contenedor de icono: cuadro redondeado con gradiente (estilo 404) */
.fe-modal__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 18px;
    background: linear-gradient(135deg, #2C3D85 0%, #3d52a8 100%);
    box-shadow: 0 8px 24px rgba(44, 61, 133, 0.28);
    color: #ffffff;
    font-size: 1.9rem;
    margin-bottom: 0.15rem;
    flex-shrink: 0;
}

.fe-modal--success .fe-modal__icon {
    background: linear-gradient(135deg, #9BB643 0%, #b0cc55 100%);
    box-shadow: 0 8px 24px rgba(155, 182, 67, 0.35);
}

.fe-modal--error .fe-modal__icon {
    background: linear-gradient(135deg, #e53e3e 0%, #fc6b6b 100%);
    box-shadow: 0 8px 24px rgba(229, 62, 62, 0.30);
}

.fe-modal--warning .fe-modal__icon {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.30);
}


.fe-modal__title {
    font-family: var(--fe-font-primary);
    font-size: 1.75rem;
    font-weight: 800;
    color: #2C3D85;
    line-height: 1.2;
    margin: 0;
}

/* Línea divisora de acento (estilo 404) */
.fe-modal__divider {
    width: 40px;
    height: 3px;
    background: #9BB643;
    border-radius: 2px;
    margin: 0 auto;
}

.fe-modal--error .fe-modal__divider   { background: #e53e3e; }
.fe-modal--warning .fe-modal__divider { background: #f59e0b; }

.fe-modal__message {
    font-family: var(--fe-font-primary);
    font-size: 1rem;
    font-weight: 400;
    text-align: center;
    color: #64748b;
    line-height: 1.65;
    max-width: 28rem;
    margin: 0;
}

.fe-modal__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    background: #2C3D85;
    color: white;
    font-family: 'Poppins', sans-serif;
    font-size: 0.84rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.85rem 2rem;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 16px rgba(44, 61, 133, 0.28);
    margin-top: 0.25rem;
}

.fe-modal__btn:hover {
    background: #9BB643;
    box-shadow: 0 6px 20px rgba(155, 182, 67, 0.38);
    transform: translateY(-2px);
}

.fe-modal__btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    font-size: 0.72rem;
    color: white;
    flex-shrink: 0;
}

/* ----------------------------------------
   ALERTAS
   ---------------------------------------- */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--fe-border-radius);
    border: none;
    font-weight: 500;
}

.alert-success {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--fe-success);
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--fe-danger);
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    color: #856404;
}

.alert-info {
    background-color: rgba(23, 162, 184, 0.1);
    color: var(--fe-info);
}

/* ----------------------------------------
   HTMX - Estados de carga
   ---------------------------------------- */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: flex;
}

/* ----------------------------------------
   PAGINAS DE ERROR
   ---------------------------------------- */
.error-page,
.notfound-page {
    min-height: 60vh;
    display: flex;
    align-items: center;
}

.error-content,
.notfound-content {
    text-align: center;
}

.error-icon,
.code-icon {
    color: var(--fe-primary);
    margin-bottom: 1rem;
}

.error-title,
.notfound-title {
    color: var(--fe-secondary);
    margin-bottom: 1rem;
}

.error-message,
.notfound-message {
    font-size: 1.1rem;
    color: var(--fe-text-muted);
    max-width: 400px;
    margin: 0 auto 2rem;
}

.error-actions,
.notfound-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* 404 especifico */
.notfound-code {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.code-number {
    font-size: 5rem;
    font-weight: 800;
    color: var(--fe-secondary);
    line-height: 1;
}

.code-icon {
    font-size: 3.5rem;
    animation: pulse 2s infinite;
}

.notfound-suggestions {
    margin-top: 2rem;
}

.suggestions-title {
    font-weight: 600;
    color: var(--fe-text-dark);
    margin-bottom: 0.5rem;
}

.suggestions-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.suggestions-list li {
    margin-bottom: 0.25rem;
}

.suggestions-list a {
    color: var(--fe-primary);
}

.suggestions-list a:hover {
    text-decoration: underline;
}

/* ----------------------------------------
   RESPONSIVE
   ---------------------------------------- */
@media (max-width: 991.98px) {
    .section {
        padding: var(--fe-spacing-xl) 0;
    }

    .section-title,
    .section-heading {
        font-size: 1.75rem;
    }
}

@media (max-width: 767.98px) {
    .section-title,
    .section-heading {
        font-size: 1.5rem;
    }

    .section-subtitle {
        font-size: 1rem;
    }

    .code-number {
        font-size: 4rem;
    }

    .code-icon {
        font-size: 2.5rem;
    }
}

@media (max-width: 576px) {
    .fe-modal {
        padding: 2rem 1.35rem 1.75rem;
    }

    .fe-modal__icon {
        width: 60px;
        height: 60px;
        font-size: 1.6rem;
        border-radius: 14px;
    }

    .fe-modal__title {
        font-size: 1.5rem;
    }

    .fe-modal__message {
        font-size: 0.95rem;
    }
}
