﻿/* ============================================================
   PORTAL . Paleta institucional:
     --portal1  Azul UNAJMA (institucional)
     --portal2  Naranja (acento / acción)
   ============================================================ */

:root {
    --portal1: #0b5380;
    --portal2: #ff8926;
    --portal1-dark: #083b5c;
    --portal1-soft: #e8f0f6;
    --ink: #1f2937;
    --ink-soft: #6b7280;
    --line: #e5e9f0;
    --bg: #f4f6f9;
    --surface: #ffffff;
    --ok: #16a34a;
    --ok-soft: #dcfce7;
    --upcoming: #d97706;
    --upcoming-soft: #fef3c7;
    --muted: #9aa4b2;
    --radius: 14px;
    --shadow-sm: 0 1px 3px rgba(16, 33, 54, .08);
    --shadow-md: 0 8px 24px rgba(16, 33, 54, .10);
    --shadow-lg: 0 18px 48px rgba(16, 33, 54, .16);
}

/* ---------- Base ---------- */
body {
    background-color: var(--bg);
    color: var(--ink);
    font-family: 'Roboto', 'Inter', -apple-system, sans-serif;
}

.portal-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.portal-main {
    flex: 1 0 auto;
}

.portal-container {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 24px;
}

h1, h2, h3, .portal-display {
    font-family: 'Poppins', 'Roboto', sans-serif;
}

a {
    text-decoration: none;
}

/* ============================================================
   HEADER — barra de navegación sobre vidrio
   ============================================================ */
.portal-nav {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
}

    .portal-nav .portal-nav-inner {
        max-width: 1160px;
        margin: 24px auto 0;
        padding: 14px 24px;
        display: flex;
        align-items: center;
        gap: 28px;
        background: rgba(11, 83, 128, .82);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, .14);
        border-radius: 16px;
        box-shadow: var(--shadow-md);
    }

    .portal-nav .portal-brand {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-right: auto;
    }

        .portal-nav .portal-brand img {
            height: 40px;
        }

        .portal-nav .portal-brand .portal-brand-text {
            color: #fff;
            line-height: 1.15;
        }

            .portal-nav .portal-brand .portal-brand-text .t1 {
                font-size: 11px;
                letter-spacing: .5px;
                opacity: .8;
                text-transform: uppercase;
            }

            .portal-nav .portal-brand .portal-brand-text .t2 {
                font-family: 'Poppins', sans-serif;
                font-weight: 600;
                font-size: 15px;
            }

    .portal-nav a.portal-link {
        color: rgba(255, 255, 255, .85);
        font-weight: 500;
        font-size: 15px;
        padding: 6px 4px;
        position: relative;
        transition: color .15s ease;
    }

        .portal-nav a.portal-link:hover,
        .portal-nav a.portal-link.active {
            color: #fff;
        }

            .portal-nav a.portal-link.active::after {
                content: "";
                position: absolute;
                left: 4px;
                right: 4px;
                bottom: -6px;
                height: 3px;
                border-radius: 3px;
                background: var(--portal2);
            }

    /* acceso al sistema (login) */
    .portal-nav a.portal-login {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        color: #fff;
        font-weight: 500;
        font-size: 14px;
        padding: 7px 16px;
        border: 1px solid rgba(255, 255, 255, .6);
        border-radius: 999px;
        transition: background-color .15s ease, color .15s ease;
    }

        .portal-nav a.portal-login:hover {
            background: #fff;
            color: #0b5380;
            text-decoration: none;
        }

/* ============================================================
   HERO — imagen a sangre con velo oscuro
   ============================================================ */
.portal-hero {
    position: relative;
    min-height: 74vh;
    display: flex;
    align-items: center;
    padding-top: 88px;
    background-size: cover;
    background-position: center;
    color: #fff;
}

    .portal-hero::before {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(180deg, rgba(8, 30, 48, .55) 0%, rgba(8, 30, 48, .78) 100%);
    }

    .portal-hero .portal-hero-content {
        position: relative;
        z-index: 2;
        max-width: 1160px;
        margin: 0 auto;
        padding: 0 24px;
        width: 100%;
    }

    .portal-hero .portal-eyebrow {
        display: inline-block;
        font-size: 13px;
        font-weight: 600;
        letter-spacing: 1.5px;
        text-transform: uppercase;
        color: var(--portal2);
        margin-bottom: 14px;
    }

    .portal-hero h1 {
        font-size: 52px;
        font-weight: 700;
        line-height: 1.05;
        margin: 0 0 16px;
        max-width: 16ch;
        text-shadow: 0 2px 20px rgba(0, 0, 0, .35);
    }

    .portal-hero p {
        font-size: 18px;
        max-width: 52ch;
        color: rgba(255, 255, 255, .9);
        margin: 0 0 28px;
    }

    .portal-hero .portal-hero-cta {
        display: inline-flex;
        align-items: center;
        gap: 10px;
        background: var(--portal2);
        color: #fff;
        font-weight: 600;
        padding: 13px 26px;
        border-radius: 10px;
        transition: transform .15s ease, box-shadow .15s ease;
    }

        .portal-hero .portal-hero-cta:hover {
            color: #fff;
            transform: translateY(-2px);
            box-shadow: 0 10px 24px rgba(255, 137, 38, .4);
        }

    /* Hero compacto (listado y detalle) */
    .portal-hero.is-compact {
        min-height: 44vh;
    }

        .portal-hero.is-compact h1 {
            font-size: 40px;
        }

/* ============================================================
   SECCIONES
   ============================================================ */
.portal-section {
    padding: 64px 0;
}

.portal-section-head {
    margin-bottom: 36px;
}

    .portal-section-head .portal-eyebrow {
        display: block;
        font-size: 13px;
        font-weight: 600;
        letter-spacing: 1.5px;
        text-transform: uppercase;
        color: var(--portal2);
        margin-bottom: 8px;
    }

    .portal-section-head h2 {
        font-size: 30px;
        font-weight: 700;
        color: var(--portal1);
        margin: 0;
    }

    .portal-section-head p {
        color: var(--ink-soft);
        margin: 8px 0 0;
        font-size: 16px;
    }

/* ============================================================
   TARJETAS DE CONVOCATORIA
   ============================================================ */
.portal-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 26px;
}

.call-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: transform .18s ease, box-shadow .18s ease;
}

    .call-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-lg);
    }

    .call-card .call-cover {
        position: relative;
        height: 168px;
        background-size: cover;
        background-position: center;
        background-color: var(--portal1);
    }

    .call-card .call-state {
        position: absolute;
        top: 12px;
        left: 12px;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        font-size: 12px;
        font-weight: 600;
        padding: 5px 12px;
        border-radius: 999px;
        background: rgba(255, 255, 255, .92);
        box-shadow: var(--shadow-sm);
    }

        .call-card .call-state .dot {
            width: 7px;
            height: 7px;
            border-radius: 50%;
        }

        .call-card .call-state.is-open {
            color: var(--ok);
        }

            .call-card .call-state.is-open .dot {
                background: var(--ok);
            }

        .call-card .call-state.is-closed {
            color: var(--ink-soft);
        }

            .call-card .call-state.is-closed .dot {
                background: var(--muted);
            }

        .call-card .call-state.is-upcoming {
            color: var(--upcoming);
        }

            .call-card .call-state.is-upcoming .dot {
                background: var(--upcoming);
            }

    .call-card .call-type {
        position: absolute;
        bottom: 12px;
        left: 12px;
        font-size: 11px;
        font-weight: 600;
        letter-spacing: .5px;
        text-transform: uppercase;
        color: #fff;
        background: var(--portal2);
        padding: 4px 12px;
        border-radius: 6px;
    }

    .call-card .call-body {
        padding: 20px;
        display: flex;
        flex-direction: column;
        flex: 1;
    }

    .call-card .call-title {
        font-family: 'Poppins', sans-serif;
        font-weight: 600;
        font-size: 17px;
        color: var(--ink);
        margin: 0 0 12px;
        line-height: 1.3;
    }

    .call-card .call-dates {
        display: flex;
        align-items: center;
        gap: 8px;
        color: var(--ink-soft);
        font-size: 13px;
        margin-bottom: 20px;
    }

        .call-card .call-dates i {
            color: var(--portal1);
        }

    .call-card .call-action {
        margin-top: auto;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        padding: 11px;
        border-radius: 9px;
        font-weight: 600;
        font-size: 14px;
        color: var(--portal1);
        background: var(--portal1-soft);
        transition: background .15s ease, color .15s ease;
    }

        .call-card .call-action:hover {
            background: var(--portal1);
            color: #fff;
        }

/* ============================================================
   ESTADO VACÍO
   ============================================================ */
.portal-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 64px 24px;
    color: var(--ink-soft);
}

    .portal-empty i {
        font-size: 44px;
        color: var(--line);
        display: block;
        margin-bottom: 16px;
    }

    .portal-empty h4 {
        color: var(--portal1);
        font-family: 'Poppins', sans-serif;
        margin: 0 0 6px;
    }

/* ============================================================
   BUSCADOR / FILTROS
   ============================================================ */
.portal-filters {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 22px;
    margin-top: -44px;
    position: relative;
    z-index: 5;
}

    .portal-filters .filters-row {
        display: grid;
        grid-template-columns: 1fr 1fr 2fr auto;
        gap: 14px;
        align-items: end;
    }

    .portal-filters .field label {
        display: block;
        font-size: 12px;
        font-weight: 600;
        color: var(--ink-soft);
        text-transform: uppercase;
        letter-spacing: .4px;
        margin-bottom: 6px;
    }

    .portal-filters .field select,
    .portal-filters .field input {
        width: 100%;
        height: 44px;
        border: 1px solid var(--line);
        border-radius: 10px;
        padding: 0 14px;
        font-size: 14px;
        color: var(--ink);
        background: #fff;
        transition: border-color .15s ease, box-shadow .15s ease;
    }

        .portal-filters .field select:focus,
        .portal-filters .field input:focus {
            outline: none;
            border-color: var(--portal1);
            box-shadow: 0 0 0 3px rgba(11, 83, 128, .12);
        }

    .portal-filters .field.search-field {
        position: relative;
    }

        .portal-filters .field.search-field i {
            position: absolute;
            left: 14px;
            top: 38px;
            color: var(--muted);
            pointer-events: none;
        }

        .portal-filters .field.search-field input {
            padding-left: 40px;
        }

    .portal-filters .filters-actions {
        display: flex;
        gap: 8px;
    }

.portal-btn {
    height: 44px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    padding: 0 22px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background .15s ease, transform .1s ease, box-shadow .15s ease;
}

    .portal-btn:active {
        transform: translateY(1px);
    }

    .portal-btn.primary {
        background: var(--portal2);
        color: #fff;
    }

        .portal-btn.primary:hover {
            box-shadow: 0 8px 20px rgba(255, 137, 38, .35);
        }

    .portal-btn.ghost {
        background: #fff;
        border: 1px solid var(--line);
        color: var(--ink-soft);
        padding: 0 16px;
    }

        .portal-btn.ghost:hover {
            border-color: var(--muted);
            color: var(--ink);
        }

/* ============================================================
   PAGINACIÓN
   ============================================================ */
.portal-pagination {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}

    .portal-pagination .page {
        min-width: 40px;
        height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 9px;
        border: 1px solid var(--line);
        background: #fff;
        color: var(--ink-soft);
        font-weight: 600;
        font-size: 14px;
        cursor: pointer;
        transition: all .15s ease;
        user-select: none;
    }

        .portal-pagination .page:hover {
            border-color: var(--portal1);
            color: var(--portal1);
        }

        .portal-pagination .page.active {
            background: var(--portal1);
            border-color: var(--portal1);
            color: #fff;
            pointer-events: none;
        }

/* ============================================================
   VER MÁS (index)
   ============================================================ */
.portal-more {
    text-align: center;
    margin-top: 44px;
}

    .portal-more a {
        display: inline-flex;
        align-items: center;
        gap: 10px;
        color: var(--portal1);
        font-weight: 600;
        border: 1.5px solid var(--portal1);
        padding: 12px 30px;
        border-radius: 10px;
        transition: all .15s ease;
    }

        .portal-more a:hover {
            background: var(--portal1);
            color: #fff;
        }

/* ============================================================
   DETALLE DE CONVOCATORIA
   ============================================================ */
.detail-hero .portal-hero-content {
    padding-top: 40px;
    padding-bottom: 40px;
}

.detail-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, .85);
    font-weight: 500;
    margin-bottom: 20px;
    transition: color .15s ease;
}

    .detail-back:hover {
        color: #fff;
    }

.detail-type-tag {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: #fff;
    background: var(--portal2);
    padding: 6px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.detail-hero h1 {
    max-width: 22ch;
    margin-bottom: 24px;
}

.detail-meta {
    display: inline-flex;
    flex-wrap: wrap;
    background: rgba(8, 30, 48, .55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 12px;
    overflow: hidden;
}

    .detail-meta .meta-item {
        padding: 14px 24px;
        border-right: 1px solid rgba(255, 255, 255, .12);
    }

        .detail-meta .meta-item:last-child {
            border-right: none;
        }

        .detail-meta .meta-item .meta-label {
            display: flex;
            align-items: center;
            gap: 7px;
            font-size: 12px;
            text-transform: uppercase;
            letter-spacing: .5px;
            color: rgba(255, 255, 255, .7);
            margin-bottom: 6px;
        }

        .detail-meta .meta-item .meta-value {
            font-size: 16px;
            font-weight: 600;
            color: #fff;
        }

    .detail-meta .status-pill {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        font-size: 14px;
        font-weight: 600;
        padding: 4px 12px;
        border-radius: 999px;
    }

        .detail-meta .status-pill.is-open {
            background: var(--ok-soft);
            color: var(--ok);
        }

        .detail-meta .status-pill.is-closed {
            background: rgba(255, 255, 255, .18);
            color: #fff;
        }

        .detail-meta .status-pill.is-upcoming {
            background: var(--upcoming-soft);
            color: var(--upcoming);
        }

.detail-body {
    padding: 56px 0;
}

.detail-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 40px;
    align-items: start;
}

.detail-block {
    margin-bottom: 40px;
}

    .detail-block:last-child {
        margin-bottom: 0;
    }

    .detail-block > h3 {
        font-size: 20px;
        font-weight: 600;
        color: var(--portal1);
        margin: 0 0 16px;
        padding-bottom: 12px;
        border-bottom: 2px solid var(--portal1-soft);
    }

    .detail-block p.detail-text {
        color: var(--ink);
        line-height: 1.7;
        margin: 0;
    }

    .detail-block .detail-empty {
        color: var(--muted);
        font-style: italic;
    }

.detail-download {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 11px 20px;
    border: 1.5px solid var(--portal1);
    border-radius: 10px;
    color: var(--portal1);
    font-weight: 600;
    font-size: 14px;
    transition: all .15s ease;
}

    .detail-download:hover {
        background: var(--portal1);
        color: #fff;
    }

.detail-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    font-size: 14px;
}

    .detail-table thead th {
        background: var(--portal1-soft);
        color: var(--portal1);
        font-weight: 600;
        text-align: left;
        padding: 12px 16px;
        font-size: 13px;
        text-transform: uppercase;
        letter-spacing: .3px;
    }

    .detail-table tbody td {
        padding: 13px 16px;
        border-top: 1px solid var(--line);
        color: var(--ink);
    }

    .detail-table tbody tr:hover td {
        background: #fafbfc;
    }

.detail-format-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--portal1);
    font-weight: 500;
}

    .detail-format-link:hover {
        text-decoration: underline;
    }

.detail-format-none {
    color: var(--muted);
    font-size: 13px;
}

.rubric-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.rubric-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 18px;
    background: #fff;
}

    .rubric-card .rubric-head {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 12px;
    }

        .rubric-card .rubric-head .rubric-name {
            font-weight: 600;
            color: var(--ink);
        }

        .rubric-card .rubric-head .rubric-score {
            font-size: 12px;
            font-weight: 700;
            color: var(--portal1);
            background: var(--portal1-soft);
            padding: 4px 10px;
            border-radius: 8px;
        }

    .rubric-card ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .rubric-card li {
        display: flex;
        justify-content: space-between;
        padding: 7px 0;
        border-top: 1px dashed var(--line);
        font-size: 14px;
        color: var(--ink-soft);
    }

        .rubric-card li strong {
            color: var(--portal1);
        }

.detail-aside {
    position: sticky;
    top: 24px;
}

.aside-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 24px;
    margin-bottom: 20px;
}

    .aside-card h4 {
        font-size: 13px;
        text-transform: uppercase;
        letter-spacing: .5px;
        color: var(--ink-soft);
        margin: 0 0 10px;
    }

    .aside-card .aside-type {
        font-family: 'Poppins', sans-serif;
        font-size: 18px;
        font-weight: 600;
        color: var(--portal1);
    }

    .aside-card ul.sector-list {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .aside-card .sector-list li {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 0;
        border-top: 1px solid var(--line);
    }

        .aside-card .sector-list li:first-child {
            border-top: none;
        }

        .aside-card .sector-list li .sector-name {
            color: var(--ink);
            font-size: 14px;
        }

        .aside-card .sector-list li .sector-vac {
            font-weight: 600;
            color: var(--portal1);
            font-size: 14px;
        }

.inscribe-box .inscribe-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
    background: var(--portal2);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 14px;
    font-weight: 600;
    font-size: 16px;
    font-family: inherit;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: box-shadow .15s ease, transform .1s ease;
}

    .inscribe-box .inscribe-btn:hover {
        box-shadow: 0 10px 24px rgba(255, 137, 38, .4);
        color: #fff;
        text-decoration: none;
    }

    .inscribe-box a.inscribe-btn:visited {
        color: #fff;
    }

    .inscribe-box .inscribe-btn:disabled {
        background: var(--line);
        color: var(--muted);
        cursor: not-allowed;
        box-shadow: none;
    }

.inscribe-box .inscribe-note {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 14px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.portal-footer {
    background: var(--portal1-dark);
    color: rgba(255, 255, 255, .8);
    padding: 48px 0 28px;
    flex-shrink: 0;
}

    .portal-footer .footer-grid {
        display: grid;
        grid-template-columns: 2fr 1fr 1fr;
        gap: 32px;
    }

    .portal-footer img {
        height: 46px;
        margin-bottom: 14px;
    }

    .portal-footer .footer-rights {
        font-size: 13px;
        line-height: 1.6;
        margin: 0;
    }

    .portal-footer .footer-title {
        color: #fff;
        font-family: 'Poppins', sans-serif;
        font-weight: 600;
        font-size: 14px;
        margin-bottom: 10px;
    }

    .portal-footer .footer-col div {
        font-size: 14px;
        line-height: 1.7;
    }

    .portal-footer .footer-bottom {
        border-top: 1px solid rgba(255, 255, 255, .12);
        margin-top: 32px;
        padding-top: 18px;
        font-size: 12px;
        color: rgba(255, 255, 255, .55);
        text-align: center;
    }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 992px) {
    .portal-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .detail-layout {
        grid-template-columns: 1fr;
    }

    .detail-aside {
        position: static;
    }

    .portal-filters .filters-row {
        grid-template-columns: 1fr 1fr;
    }

    .portal-filters .field.search-field {
        grid-column: 1 / -1;
    }

    .portal-filters .filters-actions {
        grid-column: 1 / -1;
    }

    .portal-filters .portal-btn {
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .portal-hero h1 {
        font-size: 36px;
    }

    .portal-hero.is-compact h1 {
        font-size: 30px;
    }

    .portal-grid {
        grid-template-columns: 1fr;
    }

    .rubric-grid {
        grid-template-columns: 1fr;
    }

    .detail-meta {
        flex-direction: column;
        width: 100%;
    }

        .detail-meta .meta-item {
            border-right: none;
            border-bottom: 1px solid rgba(255,255,255,.12);
        }

            .detail-meta .meta-item:last-child {
                border-bottom: none;
            }

    .portal-nav .portal-nav-inner {
        margin-top: 12px;
        gap: 16px;
        flex-wrap: wrap;
    }

    .portal-nav .portal-brand .portal-brand-text .t1 {
        display: none;
    }

    .portal-footer .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .portal-section {
        padding: 44px 0;
    }
}
