/* ==========================================================================
   COCESNA / ICCAE — Sistema de diseño
   Paleta institucional: navy #20234a · oro #fab900 · gris #6f6f6e
   Sin degradados. Profundidad mediante sombras suaves y superficies sólidas.
   ========================================================================== */

:root {
    /* Marca */
    --navy: #20234a;
    --navy-700: #191b3d;
    --navy-800: #14162f;
    --navy-900: #0f1126;
    --navy-tint: #eef0f7;
    --gold: #fab900;
    --gold-600: #e0a400;
    --gold-050: #fff7e2;

    /* Neutros */
    --ink: #1b2133;
    --muted: #5c6478;
    --muted-2: #8b93a6;
    --line: #e5e8ef;
    --line-strong: #d3d8e3;
    --surface: #f5f7fb;
    --surface-2: #eef1f7;
    --white: #fff;

    /* Estado */
    --success: #157a48;
    --danger: #d23b2f;
    --info: #1f5fbf;

    /* Forma */
    --r-xs: 6px;
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 18px;
    --r-pill: 999px;

    /* Sombras (tinte navy 32,35,74) */
    --shadow-xs: 0 1px 2px rgba(32, 35, 74, .06);
    --shadow-sm: 0 2px 6px rgba(32, 35, 74, .07), 0 1px 2px rgba(32, 35, 74, .05);
    --shadow-md: 0 10px 24px rgba(32, 35, 74, .09), 0 3px 8px rgba(32, 35, 74, .05);
    --shadow-lg: 0 26px 60px rgba(32, 35, 74, .16), 0 10px 24px rgba(32, 35, 74, .08);
    --ring: 0 0 0 4px rgba(32, 35, 74, .14);
    --ring-gold: 0 0 0 4px rgba(250, 185, 0, .28);

    /* Movimiento */
    --ease: cubic-bezier(.22, .61, .36, 1);
    --ease-out: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
    overflow-x: hidden;
    color: var(--ink);
    background: var(--white);
    font-family: "DM Sans", system-ui, -apple-system, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    letter-spacing: 0;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; transition: color .18s var(--ease); }
button, input, select, textarea { letter-spacing: 0; font-family: inherit; }
img { max-width: 100%; }
::selection { background: rgba(250, 185, 0, .3); color: var(--navy); }

.container { max-width: 1200px; }

h1, h2, h3, h4 { letter-spacing: -.02em; }

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-xs); }

/* Utilidades de sección ----------------------------------------------------- */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    color: var(--navy);
    font: 600 .72rem/1.2 "IBM Plex Mono", monospace;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.eyebrow::before {
    content: "";
    width: 22px;
    height: 2px;
    background: var(--gold);
    border-radius: 2px;
}
.text-white .eyebrow, .eyebrow.text-warning { color: var(--gold); }

.section-space { padding: 5.5rem 0; }
.surface-section { background: var(--surface); }

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 2rem;
    margin-bottom: 2.5rem;
}
.section-heading h2, .detail-content h2 {
    margin: .7rem 0 0;
    color: var(--navy);
    font-size: clamp(1.85rem, 3vw, 2.6rem);
    font-weight: 700;
    line-height: 1.1;
}
.text-link {
    display: inline-flex;
    align-items: center;
    color: var(--navy);
    font-weight: 700;
    white-space: nowrap;
}
.text-link::after {
    content: "";
    display: block;
    width: 0;
    height: 2px;
    margin-left: .1rem;
    background: var(--gold);
    transition: width .25s var(--ease);
}
.text-link:hover { color: var(--navy-700); }
.text-link i, .course-action i { margin-left: .4rem; transition: transform .2s var(--ease); }
.text-link:hover i, .course-action:hover i { transform: translateX(4px); }

/* Botones ------------------------------------------------------------------- */
.btn {
    min-height: 46px;
    padding: .68rem 1.25rem;
    border-radius: var(--r-sm);
    font-weight: 700;
    letter-spacing: .01em;
    transition: transform .15s var(--ease), box-shadow .2s var(--ease), background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { box-shadow: var(--ring-gold); }
.btn i { vertical-align: -1px; }

.btn-warning {
    color: var(--navy);
    background: var(--gold);
    border-color: var(--gold);
    box-shadow: 0 6px 16px rgba(250, 185, 0, .25);
}
.btn-warning:hover { color: var(--navy); background: var(--gold-600); border-color: var(--gold-600); box-shadow: 0 10px 22px rgba(250, 185, 0, .32); }

.btn-outline-navy { color: var(--navy); background: transparent; border-color: var(--line-strong); }
.btn-outline-navy:hover { color: var(--white); background: var(--navy); border-color: var(--navy); box-shadow: var(--shadow-md); }

.btn-navy { color: var(--white); background: var(--navy); border-color: var(--navy); }
.btn-navy:hover { color: var(--white); background: var(--navy-700); border-color: var(--navy-700); box-shadow: var(--shadow-md); }

.skip-link {
    position: absolute;
    left: 1rem;
    top: -3rem;
    z-index: 1100;
    padding: .55rem 1rem;
    color: var(--navy);
    background: var(--white);
    border: 1px solid var(--navy);
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
}
.skip-link:focus {
    top: 1rem;
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

/* Encabezado / navegación --------------------------------------------------- */
.site-header {
    z-index: 1030;
    background: rgba(255, 255, 255, .82);
    border-bottom: 1px solid var(--line);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
}
.navbar { min-height: 78px; }
.navbar-brand, .admin-brand { display: inline-flex; align-items: center; color: var(--navy); }
.brand-lockup { display: inline-flex; align-items: center; gap: .8rem; flex: 0 0 auto; }
.brand-logo { display: block; width: auto; max-width: none; object-fit: contain; }
.brand-logo-cocesna { height: 48px; }
.brand-logo-iccae { height: 35px; }
.brand-divider { width: 1px; height: 34px; background: var(--line-strong); }
.brand-lockup-mobile .brand-logo-cocesna { height: 42px; }
.brand-lockup-mobile .brand-logo-iccae { height: 31px; }
.brand-lockup-auth { gap: 1rem; }
.brand-lockup-auth .brand-logo-cocesna { height: 68px; }
.brand-lockup-auth .brand-logo-iccae { height: 48px; }
.brand-lockup-auth .brand-divider { height: 45px; }

.nav-link {
    position: relative;
    color: #4a5163;
    font-weight: 600;
    padding-inline: .3rem;
}
.nav-link::after {
    content: "";
    position: absolute;
    left: .3rem;
    right: .3rem;
    bottom: .1rem;
    height: 2px;
    background: var(--gold);
    border-radius: 2px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .25s var(--ease);
}
.nav-link:hover { color: var(--navy); }
.nav-link:hover::after, .nav-link.active::after { transform: scaleX(1); }
.nav-link.active { color: var(--navy); }
.navbar-toggler { border: 0; color: var(--navy); font-size: 1.6rem; padding: .25rem .5rem; }
.navbar-toggler:focus { box-shadow: none; }
.navbar-toggler:focus-visible { box-shadow: var(--ring); }
.mobile-link {
    padding: 1rem .25rem;
    color: var(--navy);
    border-bottom: 1px solid var(--line);
    font-size: 1.1rem;
    font-weight: 600;
    transition: padding-left .2s var(--ease), color .2s var(--ease);
}
.mobile-link:hover, .mobile-link.active { padding-left: .8rem; color: var(--navy-700); }
.offcanvas { border-left: 0; }

/* Hero (duotono navy, sin degradado) --------------------------------------- */
.hero-section {
    position: relative;
    overflow: hidden;
    background-color: var(--navy);
    background-image: url("https://images.unsplash.com/photo-1540962351504-03099e0a754b?auto=format&fit=crop&w=2000&q=85");
    background-position: center 58%;
    background-size: cover;
    background-blend-mode: multiply;
}
.hero-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(15, 17, 38, .72);
}
.hero-section > * { position: relative; z-index: 1; }
.hero-grid {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: .12;
    background-image:
        linear-gradient(rgba(255, 255, 255, .5) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .5) 1px, transparent 1px);
    background-size: 52px 52px;
    -webkit-mask-image: radial-gradient(circle at 25% 40%, black, transparent 72%);
    mask-image: radial-gradient(circle at 25% 40%, black, transparent 72%);
}
.min-vh-hero { min-height: 600px; }
.display-title {
    max-width: 880px;
    font-size: clamp(2.5rem, 6vw, 4.9rem);
    line-height: 1;
    font-weight: 700;
    letter-spacing: -.03em;
}
.hero-copy { max-width: 640px; color: #d6dbec; font-size: 1.16rem; }
.search-panel {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: .65rem;
    max-width: 820px;
    padding: .55rem .55rem .55rem 1rem;
    background: var(--white);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-lg);
}
.search-panel > i { color: var(--muted); font-size: 1.05rem; }
.search-panel .form-control { min-height: 44px; border: 0; box-shadow: none; background: transparent; }
.search-panel .form-control:focus { box-shadow: none; }
.hero-stat {
    width: 220px;
    padding: 1.6rem;
    border: 1px solid rgba(255, 255, 255, .14);
    border-left: 3px solid var(--gold);
    background: rgba(20, 22, 47, .55);
    border-radius: var(--r-md);
    backdrop-filter: blur(8px);
}
.hero-stat strong { display: block; color: var(--gold); font-size: 3rem; line-height: 1; font-weight: 700; letter-spacing: -.03em; }
.hero-stat span { display: block; margin-top: .7rem; color: #d6dbec; font-size: .95rem; }

/* Áreas --------------------------------------------------------------------- */
.area-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--white);
    box-shadow: var(--shadow-sm);
}
.area-item {
    position: relative;
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    align-items: center;
    gap: 1rem;
    min-height: 122px;
    padding: 1.6rem;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    transition: background .22s var(--ease), color .22s var(--ease);
}
.area-item > i:not(.area-arrow) { font-size: 1.75rem; color: var(--navy); transition: color .22s var(--ease); }
.area-number { align-self: start; color: var(--muted-2); font: 600 .66rem "IBM Plex Mono", monospace; }
.area-item strong { color: var(--navy); font-size: 1.05rem; transition: color .22s var(--ease); }
.area-arrow { color: var(--gold); opacity: 0; transform: translate(-6px, 6px); transition: all .22s var(--ease); }
.area-item:hover { background: var(--navy); color: var(--white); }
.area-item:hover > i, .area-item:hover strong { color: var(--white); }
.area-item:hover > i:not(.area-arrow) { color: var(--gold); }
.area-item:hover .area-number { color: rgba(255, 255, 255, .6); }
.area-item:hover .area-arrow { opacity: 1; transform: none; }

/* Tarjeta de curso ---------------------------------------------------------- */
.course-card {
    position: relative;
    overflow: hidden;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-xs);
    transition: transform .28s var(--ease), box-shadow .28s var(--ease), border-color .28s var(--ease);
}
.course-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .35s var(--ease);
    z-index: 2;
}
.course-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: transparent; }
.course-card:hover::before { transform: scaleX(1); }
.course-image { position: relative; display: block; height: 210px; overflow: hidden; background: var(--navy); }
.course-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .55s var(--ease); }
.course-image img.image-fallback, .detail-image.image-fallback { background: var(--navy); }
.course-card:hover .course-image img { transform: scale(1.05); }
.course-status {
    position: absolute;
    top: 1rem;
    left: 1rem;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .4rem .65rem;
    background: rgba(255, 255, 255, .95);
    border-radius: var(--r-pill);
    color: var(--ink);
    font-size: .72rem;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}
.course-status i { color: var(--success); font-size: .5rem; }
.course-body { display: flex; flex-direction: column; min-height: 306px; padding: 1.6rem; }
.course-code { color: #9a7300; font: 600 .66rem "IBM Plex Mono", monospace; text-transform: uppercase; letter-spacing: .05em; }
.course-body h3 { margin: .8rem 0; color: var(--navy); font-size: 1.3rem; line-height: 1.28; font-weight: 700; }
.course-body h3 a { transition: color .18s var(--ease); }
.course-card:hover .course-body h3 a { color: var(--navy-700); }
.course-body p { color: var(--muted); }
.course-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem 1.1rem;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
    color: #57607a;
    font-size: .8rem;
}
.course-meta span { display: inline-flex; align-items: center; gap: .45rem; }
.course-meta i { color: var(--navy); }
.course-action { margin-top: 1.1rem; color: var(--navy); font-weight: 700; display: inline-flex; align-items: center; }

/* Banner de página ---------------------------------------------------------- */
.page-banner {
    position: relative;
    overflow: hidden;
    padding: 5rem 0;
    color: var(--white);
    background: var(--navy);
}
.page-banner::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .1;
    background-image:
        linear-gradient(rgba(255, 255, 255, .5) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .5) 1px, transparent 1px);
    background-size: 52px 52px;
    -webkit-mask-image: radial-gradient(circle at 80% 10%, black, transparent 70%);
    mask-image: radial-gradient(circle at 80% 10%, black, transparent 70%);
}
.page-banner::after {
    content: "";
    position: absolute;
    right: -6%;
    bottom: -170px;
    width: 470px;
    height: 300px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 50%;
    box-shadow: 0 0 0 45px rgba(255, 255, 255, .03), 0 0 0 90px rgba(255, 255, 255, .02);
}
.page-banner .container { position: relative; z-index: 1; }
.page-banner h1 { margin: .8rem 0; font-size: clamp(2.4rem, 5vw, 4.2rem); font-weight: 700; }
.page-banner p { max-width: 660px; margin: 0; color: #cdd3e6; font-size: 1.1rem; }

/* Catálogo ------------------------------------------------------------------ */
.catalog-toolbar {
    display: grid;
    gap: 1rem;
    margin-bottom: 2.25rem;
    padding: 1.5rem;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-sm);
}
.catalog-filter-main { display: grid; grid-template-columns: minmax(260px, 1fr) auto; gap: .75rem; }
.catalog-filter-main .btn { min-width: 128px; }
.catalog-filter-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
.catalog-filter-footer { display: flex; align-items: center; justify-content: space-between; min-height: 24px; padding-top: .25rem; border-top: 1px dashed var(--line); }
.search-field, .input-icon { position: relative; }
.search-field i, .input-icon > i { position: absolute; top: 50%; left: 1rem; z-index: 2; color: var(--muted); transform: translateY(-50%); }
.search-field input, .input-icon input { padding-left: 2.8rem; }
.form-control, .form-select {
    min-height: 48px;
    border-color: var(--line-strong);
    border-radius: var(--r-sm);
    color: var(--ink);
    transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.form-control::placeholder { color: var(--muted-2); }
.form-control:focus, .form-select:focus { border-color: var(--navy); box-shadow: var(--ring); }
.catalog-count { color: var(--muted); font: 600 .74rem "IBM Plex Mono", monospace; }
.catalog-clear { display: inline-flex; align-items: center; gap: .4rem; color: var(--navy); font-size: .8rem; font-weight: 700; }
.catalog-clear:hover { color: var(--gold-600); }
.catalog-pagination { margin-top: 3rem; }
.catalog-pagination .page-link { display: grid; min-width: 44px; min-height: 44px; place-items: center; margin: 0 .15rem; border-color: var(--line); border-radius: var(--r-sm); color: var(--navy); font-weight: 600; transition: all .18s var(--ease); }
.catalog-pagination .page-link:hover { background: var(--navy-tint); border-color: var(--line-strong); }
.catalog-pagination .page-item.active .page-link { border-color: var(--navy); background: var(--navy); color: var(--white); }
.catalog-pagination .page-item.disabled .page-link { color: var(--muted-2); background: var(--surface); }

/* Estados vacíos ------------------------------------------------------------ */
.empty-state { padding: 5rem 1rem; text-align: center; color: var(--muted); }
.empty-state > i { display: grid; place-items: center; width: 68px; height: 68px; margin: 0 auto 1.25rem; color: var(--navy); background: var(--navy-tint); border-radius: 50%; font-size: 1.8rem; }
.empty-state h2 { color: var(--navy); font-size: 1.4rem; }
.empty-state .btn { margin-top: 1rem; }
.empty-state-compact { padding: 3.5rem 1rem; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.empty-state-compact > i { width: 56px; height: 56px; font-size: 1.5rem; }

/* Páginas de error ---------------------------------------------------------- */
.error-page { display: grid; min-height: 68vh; place-items: center; padding: 5rem 0; background: var(--surface); }
.error-content { max-width: 680px; }
.error-icon { display: grid; width: 68px; height: 68px; margin-bottom: 1.5rem; place-items: center; color: var(--gold); background: var(--navy); border-radius: var(--r-md); font-size: 1.9rem; box-shadow: var(--shadow-md); }
.error-content h1 { margin: .8rem 0 1rem; color: var(--navy); font-size: clamp(2.2rem, 5vw, 4rem); line-height: 1.05; font-weight: 700; }
.error-content p { max-width: 600px; color: var(--muted); font-size: 1.08rem; }
.error-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 2rem 0; }
.error-content small { color: var(--muted-2); font: 600 .72rem "IBM Plex Mono", monospace; }
.error-diagnostics { margin-top: 1.5rem; padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--white); text-align: left; }
.error-diagnostics summary { color: var(--navy); cursor: pointer; font-weight: 700; }
.error-diagnostics dl { display: grid; grid-template-columns: minmax(80px, auto) 1fr; gap: .4rem 1rem; margin: 1rem 0 0; font: 500 .78rem/1.5 "IBM Plex Mono", monospace; }
.error-diagnostics dt { color: var(--muted); }
.error-diagnostics dd { min-width: 0; margin: 0; overflow-wrap: anywhere; color: var(--ink); }

/* Detalle de curso ---------------------------------------------------------- */
.detail-hero { position: relative; overflow: hidden; padding: 3rem 0 4.5rem; color: var(--white); background: var(--navy); }
.detail-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .09;
    background-image:
        linear-gradient(rgba(255, 255, 255, .5) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .5) 1px, transparent 1px);
    background-size: 52px 52px;
    -webkit-mask-image: radial-gradient(circle at 90% 20%, black, transparent 65%);
    mask-image: radial-gradient(circle at 90% 20%, black, transparent 65%);
}
.detail-hero .container { position: relative; z-index: 1; }
.back-link { display: inline-flex; align-items: center; gap: .5rem; color: #cdd3e6; font-size: .88rem; font-weight: 600; }
.back-link:hover { color: var(--white); }
.back-link i { transition: transform .2s var(--ease); }
.back-link:hover i { transform: translateX(-4px); }
.detail-hero h1 { margin: 1rem 0; font-size: clamp(2.3rem, 5vw, 3.8rem); line-height: 1.06; font-weight: 700; }
.detail-hero p { max-width: 700px; color: #cdd3e6; font-size: 1.1rem; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; margin-top: 2rem; }
.detail-meta span { display: inline-flex; gap: .55rem; align-items: center; color: #e6e9f3; font-size: .9rem; }
.detail-meta i { color: var(--gold); }
.detail-image { width: 100%; aspect-ratio: 4/3; object-fit: cover; border: 1px solid rgba(255, 255, 255, .18); border-radius: var(--r-md); box-shadow: var(--shadow-lg); }
.detail-content { font-size: 1.05rem; line-height: 1.78; color: #2c3346; }
.detail-content h3 { margin: 2.3rem 0 1rem; color: var(--navy); font-size: 1.3rem; font-weight: 700; }
.detail-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem 1.25rem; margin: 0 0 1.75rem; padding: 1.15rem 1.2rem; border: 1px solid var(--line); border-radius: var(--r-sm); background: #f7f8fb; }
.detail-facts div { margin: 0; }
.detail-facts dt { margin: 0 0 .2rem; color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.detail-facts dd { margin: 0; color: var(--navy); font-weight: 600; }
@media (max-width: 575.98px) { .detail-facts { grid-template-columns: 1fr; } }
.check-list { padding: 0; list-style: none; }
.check-list li { position: relative; margin: .85rem 0; padding-left: 2rem; }
.check-list li::before { content: "\F26B"; position: absolute; left: 0; top: .1rem; color: var(--gold-600); font-family: bootstrap-icons; }

/* Panel de solicitud -------------------------------------------------------- */
.inquiry-panel { position: sticky; top: 100px; padding: 2rem; background: var(--white); border: 1px solid var(--line); border-top: 4px solid var(--gold); border-radius: var(--r-md); box-shadow: var(--shadow-md); }
.inquiry-panel h2 { margin: .5rem 0; color: var(--navy); font-size: 1.7rem; font-weight: 700; }
.inquiry-panel > p { color: var(--muted); }
.inquiry-group-title { margin: 1.6rem 0 .8rem; color: var(--navy); font-family: "IBM Plex Mono", monospace; font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--line); padding-bottom: .4rem; }
.inquiry-honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-label { margin-bottom: .4rem; color: #39415a; font-size: .82rem; font-weight: 700; }
.form-check-label { color: var(--muted); font-size: .82rem; }
.form-check-input:checked { background-color: var(--navy); border-color: var(--navy); }
.form-check-input:focus { border-color: var(--navy); box-shadow: var(--ring); }
.input-group-text { background: var(--surface); border-color: var(--line-strong); color: var(--navy); font-weight: 600; }
.alert { border: 0; border-radius: var(--r-sm); border-left: 4px solid; }
.alert-success { background: #e8f5ee; border-left-color: var(--success); color: #0f5c35; }
.alert-danger { background: #fbeae8; border-left-color: var(--danger); color: #9a271d; }

/* Pie de página ------------------------------------------------------------- */
.site-footer { color: #c9d0e2; background: var(--navy-900); }
.site-footer .row { margin-right: 0; margin-left: 0; }
.site-footer h2 { margin-bottom: 1.1rem; color: var(--white); font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.site-footer a { display: block; margin: .7rem 0; color: #aab3ce; transition: color .18s var(--ease), transform .18s var(--ease); }
.site-footer a:hover { color: var(--gold); transform: translateX(3px); }
.footer-brand { display: inline-flex; margin-bottom: 1.25rem; padding: .8rem 1.1rem; background: var(--white); border-radius: var(--r-md); box-shadow: var(--shadow-md); }
.brand-lockup-footer .brand-logo-cocesna { height: 58px; }
.brand-lockup-footer .brand-logo-iccae { height: 40px; }
.brand-lockup-footer .brand-divider { height: 40px; }
.site-footer p { max-width: 410px; color: #aab3ce; }
.site-footer .col-lg-3 p, .site-footer .col-lg-3 a { display: flex; align-items: center; gap: .55rem; }
.site-footer .col-lg-3 i { color: var(--gold); }
.footer-bottom { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid rgba(255, 255, 255, .12); font-size: .78rem; color: #8b93ac; }
.footer-legal { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.footer-bottom a { display: inline; margin: 0; color: #8b93ac; }
.footer-bottom a:hover { color: var(--gold); transform: none; }

/* Indicador de carga -------------------------------------------------------- */
.page-loader {
    position: fixed;
    inset: 0;
    z-index: 2400;
    display: flex;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity .22s var(--ease), visibility .22s var(--ease);
}
.page-loader.is-active {
    pointer-events: auto;
    opacity: 1;
    visibility: visible;
}
.page-loader-progress {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    height: 3px;
    width: 0;
    background: var(--gold);
    box-shadow: 0 0 14px rgba(250, 185, 0, .45);
}
.page-loader.is-active .page-loader-progress { animation: page-loader-progress 1.35s var(--ease) infinite; }
@keyframes page-loader-progress {
    0% { width: 8%; }
    45% { width: 72%; }
    100% { width: 92%; }
}
.page-loader-veil {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(15, 17, 38, .28);
}
.page-loader-card {
    display: flex;
    align-items: center;
    gap: .95rem;
    min-width: 220px;
    padding: 1rem 1.2rem;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-lg);
}
.page-loader-spinner {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border: 2px solid var(--navy-tint);
    border-top-color: var(--navy);
    border-right-color: var(--gold);
    border-radius: 50%;
    animation: page-loader-spin .7s linear infinite;
}
.page-loader-copy { display: flex; flex-direction: column; gap: .12rem; }
.page-loader-copy strong {
    color: var(--navy);
    font-size: .92rem;
    font-weight: 700;
    line-height: 1.2;
}
.page-loader-copy small {
    color: var(--muted);
    font-family: "DM Sans", system-ui, sans-serif;
    font-size: .78rem;
    font-weight: 500;
    letter-spacing: -.01em;
    line-height: 1.35;
    text-transform: none;
}
@keyframes page-loader-spin { to { transform: rotate(360deg); } }
body.is-loading { cursor: progress; }
@media (prefers-reduced-motion: reduce) {
    .page-loader-spinner { animation: none; border-color: var(--navy); }
    .page-loader.is-active .page-loader-progress { animation: none; width: 100%; }
}

/* Scroll reveal (activado por JS) ------------------------------------------- */
body.reveal-on [data-reveal] { opacity: 0; transform: translateY(20px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); will-change: opacity, transform; }
body.reveal-on [data-reveal].is-visible { opacity: 1; transform: none; }

/* ==========================================================================
   Autenticación (login)
   ========================================================================== */
.auth-body { min-height: 100vh; overflow-x: hidden; background: var(--surface); }
.auth-shell { display: grid; grid-template-columns: 1.05fr .95fr; min-height: 100vh; }
.auth-visual {
    position: relative;
    min-height: 620px;
    background-color: var(--navy);
    background-image: url("https://images.unsplash.com/photo-1529074963764-98f45c47344b?auto=format&fit=crop&w=1600&q=85");
    background-position: center;
    background-size: cover;
    background-blend-mode: multiply;
}
.auth-overlay { position: absolute; inset: 0; background: rgba(15, 17, 38, .55); }
.auth-caption { position: absolute; right: 3.5rem; bottom: 4rem; left: 3.5rem; max-width: 650px; color: var(--white); z-index: 1; }
.auth-caption h1 { margin: 1rem 0; font-size: clamp(2.4rem, 5vw, 4.2rem); line-height: 1.02; font-weight: 700; }
.auth-caption p { max-width: 520px; color: #d8deed; font-size: 1.05rem; }
.auth-form-wrap { display: grid; place-items: center; padding: 2.5rem; }
.auth-form { width: 100%; max-width: 430px; }
.auth-form h2 { margin: .5rem 0; color: var(--navy); font-size: 2.3rem; font-weight: 700; }
.password-toggle { position: absolute; top: 50%; right: .8rem; border: 0; color: var(--muted); background: transparent; transform: translateY(-50%); }
.password-toggle:hover { color: var(--navy); }

/* ==========================================================================
   Panel administrativo
   ========================================================================== */
.admin-body { min-height: 100vh; background: var(--surface); }
.admin-shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.admin-sidebar { position: sticky; top: 0; z-index: 1050; display: flex; flex-direction: column; height: 100vh; padding: 1.5rem 1rem; background: var(--white); border-right: 1px solid var(--line); }
.admin-brand { margin: 0 .4rem 2.25rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.brand-lockup-admin { gap: .6rem; }
.brand-lockup-admin .brand-logo-cocesna { height: 46px; }
.brand-lockup-admin .brand-logo-iccae { height: 30px; }
.brand-lockup-admin .brand-divider { height: 30px; }
.admin-sidebar nav { display: flex; flex-direction: column; gap: .3rem; }
.admin-sidebar nav a, .admin-logout {
    position: relative;
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .78rem 1rem;
    border-radius: var(--r-sm);
    color: #59617a;
    font-size: .9rem;
    font-weight: 600;
    transition: background .18s var(--ease), color .18s var(--ease);
}
.admin-sidebar nav a i, .admin-logout i { font-size: 1.1rem; }
.admin-sidebar nav a:hover { color: var(--navy); background: var(--navy-tint); }
.admin-sidebar nav a.active { color: var(--white); background: var(--navy); box-shadow: var(--shadow-md); }
.admin-sidebar nav a.active::before { content: ""; position: absolute; left: -1rem; top: 50%; width: 3px; height: 22px; background: var(--gold); border-radius: 0 3px 3px 0; transform: translateY(-50%); }
.admin-sidebar nav a span { margin-left: auto; padding: .12rem .5rem; border-radius: var(--r-pill); color: var(--navy); background: var(--gold); font-size: .65rem; font-weight: 700; }
.admin-logout { margin-top: auto; }
.admin-logout-form { margin-top: auto; }
.admin-logout-form button.admin-logout { width: 100%; margin-top: 0; border: none; background: transparent; cursor: pointer; text-align: left; }
.admin-logout-form button.admin-logout:hover { color: var(--danger); background: #fbeae8; }
.admin-main { min-width: 0; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; min-height: 82px; padding: 1rem 2.2rem; background: rgba(255, 255, 255, .85); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 1040; }
.admin-topbar > div:first-of-type span { color: var(--muted); font: 600 .66rem "IBM Plex Mono", monospace; letter-spacing: .08em; text-transform: uppercase; }
.admin-topbar > div:first-of-type strong { display: block; margin-top: .25rem; color: var(--navy); font-size: 1.05rem; }
.admin-account { position: relative; margin-left: auto; }
.admin-account-trigger {
    display: flex;
    align-items: center;
    gap: .75rem;
    max-width: 280px;
    padding: .35rem .45rem .35rem .85rem;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    background: var(--white);
    box-shadow: var(--shadow-xs);
    color: inherit;
    cursor: pointer;
    transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
.admin-account-trigger:hover,
.admin-account-trigger:focus-visible,
.admin-account-trigger[aria-expanded="true"],
.admin-account-trigger.is-current {
    border-color: #cfd5e4;
    background: var(--navy-tint);
    box-shadow: var(--shadow-sm);
    outline: none;
}
.admin-account-copy { display: flex; flex-direction: column; min-width: 0; text-align: right; line-height: 1.25; }
.admin-account-copy strong { overflow: hidden; color: var(--navy); font-size: .88rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.admin-account-copy small { color: var(--muted); font-size: .72rem; font-weight: 500; }
.admin-account-trigger .bi-chevron-down { color: var(--muted-2); font-size: .75rem; transition: transform .18s var(--ease); }
.admin-account-trigger[aria-expanded="true"] .bi-chevron-down { transform: rotate(180deg); }
.admin-account-menu {
    width: min(300px, calc(100vw - 2rem));
    padding: .55rem;
    margin-top: 0;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    z-index: 1055;
    box-shadow: var(--shadow-lg);
}
.admin-account-meta {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem .7rem .85rem;
    margin-bottom: .35rem;
    border-bottom: 1px solid var(--line);
}
.admin-account-meta strong { display: block; color: var(--navy); font-size: .9rem; }
.admin-account-meta small { display: block; overflow: hidden; color: var(--muted); font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.admin-account-item,
.admin-account-logout button {
    display: flex;
    align-items: center;
    gap: .7rem;
    width: 100%;
    padding: .7rem .75rem;
    border: 0;
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--ink);
    font-size: .9rem;
    font-weight: 600;
    text-align: left;
}
.admin-account-item i,
.admin-account-logout button i { color: var(--muted); font-size: 1.05rem; }
.admin-account-item:hover,
.admin-account-item:focus-visible { color: var(--navy); background: var(--navy-tint); }
.admin-account-item.is-active { color: var(--navy); background: var(--navy-tint); }
.admin-account-logout button { color: var(--danger); cursor: pointer; }
.admin-account-logout button:hover,
.admin-account-logout button:focus-visible { background: #fbeae8; }
.user-avatar { display: grid !important; place-items: center; width: 40px; height: 40px; flex: 0 0 40px; color: var(--gold); background: var(--navy); border-radius: 50%; text-align: center !important; font-weight: 700; box-shadow: var(--shadow-sm); }
.user-avatar-lg { width: 88px; height: 88px; flex-basis: 88px; margin: 0 auto 1rem; font-size: 1.7rem; box-shadow: var(--shadow-md); }
.profile-layout { display: grid; grid-template-columns: minmax(240px, 280px) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.profile-identity { padding: 2rem 1.6rem 1.7rem; text-align: center; }
.profile-identity h2 { margin: 0 0 .45rem; color: var(--navy); font-size: 1.2rem; }
.profile-role {
    display: inline-block;
    padding: .22rem .7rem;
    border-radius: var(--r-pill);
    background: var(--gold-050);
    color: var(--navy);
    font-size: .72rem;
    font-weight: 700;
}
.profile-meta { margin: 1.4rem 0 0; text-align: left; }
.profile-meta div { padding: .7rem 0; border-top: 1px solid var(--line); }
.profile-meta dt { color: var(--muted); font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.profile-meta dd { margin: .2rem 0 0; color: var(--ink); font-size: .88rem; word-break: break-word; }
.profile-form-card h2 { margin: 0; color: var(--navy); font-size: 1.15rem; }
.profile-role-field p { margin: .2rem 0 0; color: var(--navy); font-weight: 700; }
.profile-role-field small { color: var(--muted); }
.profile-password-block { margin: 0; padding: 1.1rem 1.15rem 1.2rem; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.profile-password-block legend { float: none; width: auto; margin-bottom: .25rem; padding: 0; color: var(--navy); font-size: .92rem; font-weight: 700; }
.profile-password-block > p { margin: 0 0 1rem; color: var(--muted); font-size: .85rem; }
.icon-button { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; color: var(--ink); background: transparent; border-radius: var(--r-sm); transition: background .18s var(--ease), color .18s var(--ease); }
.icon-button:hover { background: var(--navy-tint); color: var(--navy); }
.notification-dot { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; background: var(--danger); border: 2px solid var(--white); border-radius: 50%; }
.admin-content { padding: 2.5rem; }
.admin-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 2rem; }
.admin-heading h1 { margin: 0; color: var(--navy); font-size: clamp(1.8rem, 4vw, 2.5rem); font-weight: 700; }
.admin-heading p { margin: .45rem 0 0; color: var(--muted); }

/* Tarjetas de métrica y paneles -------------------------------------------- */
.metric-card, .admin-panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-sm); }
.metric-card { position: relative; min-height: 176px; padding: 1.5rem; overflow: hidden; transition: transform .22s var(--ease), box-shadow .22s var(--ease); }
.metric-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease); }
.metric-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.metric-card:hover::before { transform: scaleX(1); }
.metric-card > i { position: absolute; top: 1.3rem; right: 1.3rem; display: grid; place-items: center; width: 42px; height: 42px; color: var(--navy); background: var(--navy-tint); border-radius: var(--r-sm); font-size: 1.15rem; }
.metric-card > span { display: block; color: var(--muted); font: 600 .67rem "IBM Plex Mono", monospace; letter-spacing: .06em; text-transform: uppercase; }
.metric-card strong { display: block; margin: 1.4rem 0 .5rem; color: var(--navy); font-size: 2.4rem; font-weight: 700; letter-spacing: -.03em; }
.metric-card strong.status-ok { color: var(--success); font-size: 1.4rem; }
.metric-card small { color: var(--muted); }
.admin-panel { overflow: hidden; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.4rem 1.5rem; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 0; color: var(--navy); font-size: 1.2rem; font-weight: 700; }
.panel-heading p { margin: .25rem 0 0; color: var(--muted); font-size: .85rem; }

.docs-page { display: grid; grid-template-columns: minmax(200px, 250px) minmax(0, 1fr); gap: 2rem; align-items: start; }
.docs-toc { position: sticky; top: 6.5rem; padding: 1.15rem 1rem 1.2rem; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-xs); }
.docs-toc-kicker, .docs-kicker { margin: 0 0 .7rem; color: var(--muted); font: 600 .66rem/1.3 "IBM Plex Mono", monospace; letter-spacing: .08em; text-transform: uppercase; }
.docs-toc nav { display: flex; flex-direction: column; gap: .12rem; }
.docs-toc a { display: block; padding: .42rem .55rem; border-radius: var(--r-xs); color: var(--ink); font-size: .84rem; font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.docs-toc a:hover { color: var(--navy); background: var(--navy-tint); }
.docs-toc a.is-active { color: var(--navy); background: var(--gold-050); }
.docs-toc a.docs-toc-cross { margin-top: .55rem; color: var(--navy); }
.docs-toc strong { display: block; margin: .75rem .55rem .2rem; color: var(--muted); font-size: .68rem; letter-spacing: .04em; text-transform: uppercase; }
.docs-toc .docs-method { margin-right: .35rem; }
.docs-hero { margin-bottom: 1.25rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--line); }
.docs-hero h1 { margin: 0 0 .6rem; color: var(--navy); font-size: clamp(1.55rem, 3vw, 2.05rem); }
.docs-hero p, .docs-card p, .docs-endpoint p { color: var(--ink); line-height: 1.65; }
.docs-lead { color: var(--muted) !important; font-size: 1.02rem; }
.docs-card, .docs-endpoint { margin-bottom: 1.4rem; padding: 1.35rem 1.4rem 1.45rem; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-xs); }
.docs-card ul, .docs-responses { padding-left: 1.15rem; }
.docs-card li, .docs-responses li { margin: .3rem 0; color: var(--ink); }
.docs-card h3, .docs-endpoint h3 { margin: 1.1rem 0 .45rem; color: var(--navy); font-size: 1rem; }
.docs-callout { margin: 1rem 0; padding: .95rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); }
.docs-callout strong { display: block; margin-bottom: .35rem; color: var(--navy); }
.docs-callout p { margin: .35rem 0 0; }
.docs-callout .docs-code { margin: .45rem 0 .2rem; }
.docs-links { list-style: none; padding: 0; }
.docs-links li { display: grid; gap: .2rem; margin: 0 0 .85rem; padding: .75rem .85rem; background: var(--surface); border-radius: var(--r-sm); }
.docs-links strong { color: var(--navy); }
.docs-links code { color: var(--navy); font-size: .84rem; }
.docs-links a { color: var(--navy); font-size: .82rem; font-weight: 700; text-decoration: none; }
.docs-links a:hover { color: var(--navy); }
.docs-endpoint-head { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; margin-bottom: .7rem; }
.docs-endpoint-head code { font-size: .95rem; color: var(--navy); overflow-wrap: anywhere; }
.docs-method { display: inline-block; min-width: 3.4rem; padding: .18rem .45rem; border-radius: 4px; font: 700 .65rem/1 "IBM Plex Mono", monospace; letter-spacing: .04em; text-align: center; }
.docs-method-get { color: #0f5c3a; background: #e5f5ec; }
.docs-method-post { color: #6a4a00; background: var(--gold-050); }
.docs-auth { padding: .7rem .85rem; background: var(--surface); border-radius: var(--r-sm); }
.docs-code { margin: 0; padding: 1rem 1.1rem; overflow: auto; background: var(--navy-900); border-radius: var(--r-sm); color: #eef0f7; font-size: .82rem; line-height: 1.55; }
.docs-table { font-size: .88rem; }
.docs-table code { color: var(--navy); }
.docs-pager { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; }
.docs-pager-link { display: flex; flex-direction: column; gap: .2rem; padding: .9rem 1rem; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); color: var(--ink); text-decoration: none; }
.docs-pager-link span { color: var(--muted); font: 600 .66rem/1.3 "IBM Plex Mono", monospace; letter-spacing: .06em; text-transform: uppercase; }
.docs-pager-link strong { color: var(--navy); font-size: .92rem; }
.docs-pager-link:hover { border-color: var(--line-strong); background: var(--navy-tint); }
.docs-pager-link.is-next { text-align: right; }
.docs-pager-link.is-disabled { opacity: .55; cursor: default; }
.docs-pager-link.is-disabled:hover { border-color: var(--line); background: var(--white); }

/* Tablas -------------------------------------------------------------------- */
.table { margin: 0; }
.table th { padding: .95rem 1.5rem; color: var(--muted); background: var(--surface); font: 600 .64rem "IBM Plex Mono", monospace; letter-spacing: .06em; text-transform: uppercase; border-bottom-color: var(--line); }
.table td { padding: 1rem 1.5rem; color: #495064; border-color: var(--line); vertical-align: middle; }
.table tbody tr { transition: background .16s var(--ease); }
.table tbody tr:hover { background: var(--surface); }
.table td strong, .table td small { display: block; }
.table td strong { color: var(--navy); }
.table td small { color: var(--muted); }
.badge-status { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .7rem; border-radius: var(--r-pill); font-size: .7rem; font-weight: 700; }
.badge-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-status.new { color: #9a6b00; background: var(--gold-050); }
.badge-status.progress { color: #1a4fa0; background: #e7eefc; }
.badge-status.done { color: #146a3b; background: #e5f5ec; }
.badge-status.muted { color: #59617a; background: var(--surface-2); }

.admin-filters { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; width: 100%; }
.admin-filters .form-select { max-width: 200px; flex: 1 1 150px; }
.admin-filters .form-control { flex: 1 1 220px; min-width: 0; }
.badge-status.info { color: var(--navy); background: var(--navy-tint); }
.table td .badge-status { margin: .12rem .2rem .12rem 0; }
.admin-pagination { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1rem 1.5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.admin-pagination-controls { display: flex; gap: .5rem; }
.admin-detail { margin-bottom: 1.5rem; }
.admin-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.4rem; margin: 0; padding: 1.5rem; }
.admin-detail-grid > div { min-width: 0; }
.admin-detail-grid .admin-detail-wide { grid-column: 1 / -1; }
.admin-detail-grid dt { color: var(--muted); font: 600 .64rem "IBM Plex Mono", monospace; letter-spacing: .05em; text-transform: uppercase; }
.admin-detail-grid dd { margin: .25rem 0 0; color: var(--ink); word-break: break-word; }
.admin-status-form { padding: 1.5rem; }
.admin-timeline { list-style: none; margin: 0; padding: 1.5rem; display: flex; flex-direction: column; gap: 1.1rem; }
.admin-timeline li { position: relative; padding-left: 1.4rem; border-left: 2px solid var(--line); }
.admin-timeline li::before { content: ""; position: absolute; left: -6px; top: .3rem; width: 10px; height: 10px; background: var(--gold); border: 2px solid var(--white); border-radius: 50%; }
.admin-timeline-head { display: flex; justify-content: space-between; gap: .5rem; }
.admin-timeline-head strong { color: var(--navy); }
.admin-timeline li span { color: var(--muted); font-size: .8rem; }
.admin-timeline li small { color: var(--muted); }
.admin-timeline li p { margin: .35rem 0 0; color: var(--ink); }

/* Formulario admin: interruptores e imagen --------------------------------- */
.form-switch .form-check-input { width: 2.4em; height: 1.25em; }
.form-switch .form-check-input:checked { background-color: var(--navy); border-color: var(--navy); }

/* Formularios en tarjetas: relleno interno consistente --------------------- */
.admin-form-grid { padding: 0; }
.admin-form-grid .admin-panel { padding: 1.5rem; }
.admin-form-grid .admin-panel > h2 {
    margin: 0 0 1.3rem;
    padding-bottom: .85rem;
    border-bottom: 1px solid var(--line);
    color: var(--navy);
    font-size: 1.05rem;
    font-weight: 700;
}
.admin-panel-body { padding: 1.5rem; }
.admin-form-grid .admin-panel > *:last-child,
.admin-panel-body > *:last-child { margin-bottom: 0; }
.admin-form-grid .form-check + .form-check { margin-top: .35rem; }
.admin-actions-bar { display: flex; justify-content: flex-end; gap: .75rem; flex-wrap: wrap; }
.course-image-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 148px;
    margin-bottom: .85rem;
    padding: .75rem;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--navy);
    color: #fff;
    text-align: center;
}
.course-image-preview img {
    display: block;
    width: 100%;
    max-height: 168px;
    object-fit: cover;
    border-radius: 6px;
}
.course-image-preview-empty,
.course-image-preview-error { font-size: .85rem; line-height: 1.4; padding: 0 .5rem; }
.course-image-preview-error { color: var(--gold); }

/* Catálogo ICAO-like -------------------------------------------------------- */
.masthead-search {
    background: var(--navy-800);
    padding: 1.15rem 0;
}
.masthead-search-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .65rem;
    max-width: 920px;
    margin: 0 auto;
}
.masthead-search-form .form-control {
    min-height: 52px;
    border: 0;
    border-radius: var(--r-sm);
}
.masthead-search-btn {
    width: 56px;
    min-height: 52px;
    padding: 0;
    border-radius: var(--r-sm);
    font-size: 1.2rem;
}
.area-heading {
    margin: 0 0 1.75rem;
    color: var(--navy);
    font-size: clamp(1.7rem, 3vw, 2.2rem);
    font-weight: 700;
    text-align: center;
}
.area-tiles {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .7rem;
}
.area-tile {
    display: grid;
    min-height: 72px;
    padding: .85rem 1rem;
    place-items: center;
    border-radius: var(--r-sm);
    color: var(--white);
    font-weight: 700;
    font-size: .95rem;
    text-align: center;
    line-height: 1.25;
    transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.area-tile:hover { color: var(--white); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.area-tile--0 { background: #20234a; }
.area-tile--1 { background: #2c3a6b; }
.area-tile--2 { background: #1b3f4a; }
.area-tile--3 { background: #3a3358; }
.area-tile--4 { background: #4a3d1c; }
.area-tile--5 { background: #14162f; }
.featured-heading {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.featured-heading h2 { margin: 0; color: var(--navy); font-size: clamp(1.6rem, 3vw, 2rem); font-weight: 700; }
.featured-all { color: var(--gold-600); font-weight: 700; }
.featured-all:hover { color: var(--navy); }
.featured-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.15rem;
}
.course-row {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr) auto;
    gap: 1.1rem;
    padding: 1rem;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-xs);
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: box-shadow .2s var(--ease), border-color .2s var(--ease), transform .18s var(--ease);
}
.course-row:hover,
.course-row:focus-visible {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-md);
    color: inherit;
    text-decoration: none;
    transform: translateY(-1px);
}
.course-row-image {
    display: block;
    width: 132px;
    height: 132px;
    overflow: hidden;
    border-radius: var(--r-sm);
    background: var(--navy);
}
.course-row-image img { width: 100%; height: 100%; object-fit: cover; }
.course-row-body h3 { margin: 0 0 .35rem; color: var(--navy); font-size: 1.12rem; line-height: 1.3; font-weight: 700; }
.course-row:hover .course-row-body h3,
.course-row:focus-visible .course-row-body h3 { color: var(--navy-700); }
.course-row-provider { margin: 0 0 .7rem; color: var(--muted); font-size: .88rem; }
.course-row-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem 1rem;
    margin-bottom: .7rem;
    color: #57607a;
    font-size: .8rem;
}
.course-row-meta span { display: inline-flex; align-items: center; gap: .4rem; }
.course-row-meta i { color: var(--navy); }
.course-row-area {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: var(--ink);
    font-size: .78rem;
    font-weight: 600;
}
.course-row-area i { font-size: .55rem; }
.course-row-area--0 i { color: #20234a; }
.course-row-area--1 i { color: #2c3a6b; }
.course-row-area--2 i { color: #1b3f4a; }
.course-row-area--3 i { color: #3a3358; }
.course-row-area--4 i { color: #c49200; }
.course-row-area--5 i { color: #14162f; }
.course-row-aside { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: .6rem; }
.course-row-badge {
    display: inline-flex;
    padding: .28rem .7rem;
    border-radius: var(--r-pill);
    background: var(--navy-tint);
    color: var(--navy);
    font-size: .72rem;
    font-weight: 700;
    white-space: nowrap;
}
.course-row-featured { color: var(--gold-600); font-size: .72rem; font-weight: 700; }
.catalog-banner {
    padding: 2.4rem 0;
    color: var(--white);
    background: var(--navy);
    text-align: center;
}
.catalog-banner h1 { margin: 0; font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; }
.catalog-results { padding: 0 0 4.5rem; background: var(--surface); }
.catalog-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem 1.5rem;
    padding: 1.1rem 0 0;
    border-bottom: 1px solid var(--line);
    background: var(--white);
    margin: 0 -0.15rem 1.1rem;
}
.catalog-tab {
    padding: .85rem 0;
    color: var(--ink);
    font-weight: 600;
    border-bottom: 3px solid transparent;
}
.catalog-tab:hover { color: var(--navy); }
.catalog-tab.is-active { color: var(--navy); border-bottom-color: var(--gold); }
.catalog-refine {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .75rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
}
.catalog-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .85rem 1.5rem;
    margin-bottom: 1.15rem;
}
.catalog-meta-left { display: flex; align-items: center; gap: 1rem; }
.catalog-show-only {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .65rem 1rem;
    color: var(--ink);
    font-size: .88rem;
}
.catalog-show-only label { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; }
.course-list { display: grid; gap: 1rem; }
.catalog-pagination .page-link {
    min-width: auto;
    padding: 0 .85rem;
    gap: .35rem;
    display: inline-flex;
    align-items: center;
}

/* Ficha de curso ------------------------------------------------------------ */
.detail-masthead { padding: 2.25rem 0; background: var(--navy-800); color: var(--white); }
.detail-masthead-inner { display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 1.5rem; align-items: center; }
.detail-masthead-image {
    width: 148px;
    height: 148px;
    object-fit: cover;
    border-radius: var(--r-sm);
    background: var(--navy);
}
.detail-masthead h1 { margin: 0 0 .4rem; font-size: clamp(1.7rem, 3.5vw, 2.5rem); line-height: 1.15; font-weight: 700; }
.detail-masthead-code { margin: 0 0 .75rem; color: #cdd3e6; font: 500 .95rem "IBM Plex Mono", monospace; }
.detail-crumb { padding: .7rem 0; background: var(--white); border-bottom: 1px solid var(--line); }
.detail-crumb a { display: inline-flex; align-items: center; gap: .5rem; color: var(--navy); font-weight: 600; }
.detail-body { background: var(--surface); }
.detail-content h2 { margin: 1.6rem 0 .6rem; color: var(--navy); font-size: 1.2rem; font-weight: 700; }
.detail-content h2:first-child { margin-top: 0; }
.detail-content p { color: var(--ink); }
.detail-side { display: grid; gap: 1rem; }
.detail-side-card {
    padding: 1.35rem;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-xs);
}
.detail-side-card h3 {
    margin: 0 0 1rem;
    padding-bottom: .65rem;
    border-bottom: 1px solid var(--line);
    color: var(--navy);
    font-size: .82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.detail-developer { text-align: center; }
.detail-developer p { margin: .85rem 0 0; color: var(--muted); font-size: .88rem; }
.brand-lockup-detail { justify-content: center; gap: .55rem; }
.brand-lockup-detail .brand-logo-cocesna { height: 42px; }
.brand-lockup-detail .brand-logo-iccae { height: 28px; }
.brand-lockup-detail .brand-divider { height: 28px; }
.detail-info { margin: 0; }
.detail-info > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .7rem 0;
    border-bottom: 1px solid var(--line);
}
.detail-info > div:last-child { border-bottom: 0; }
.detail-info dt { color: var(--muted); font-weight: 600; }
.detail-info dd { margin: 0; color: var(--navy); font-weight: 700; text-align: right; }
.detail-interest-btn { margin-top: 1.1rem; }

/* Formulario de interés ----------------------------------------------------- */
body[data-page="course-inquiry"] {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    background: var(--surface);
}
body[data-page="course-inquiry"] #app-content {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}
.inquiry-page {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 100%;
    background: var(--surface);
}
.inquiry-page-title { padding: 1.1rem 0; background: var(--white); border-bottom: 1px solid var(--line); }
.inquiry-page-title h1 {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin: 0;
    color: var(--navy);
    font-size: 1.15rem;
    font-weight: 700;
}
.inquiry-page-title i { color: var(--gold-600); }
.inquiry-shell {
    display: grid;
    flex: 1 1 auto;
    grid-template-columns: minmax(260px, 28%) minmax(0, 1fr);
    align-items: stretch;
    min-height: calc(100dvh - 8.5rem);
}
.inquiry-sidebar {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 2rem 1.6rem 1.75rem;
    background: var(--navy);
    color: var(--white);
}
.inquiry-sidebar img {
    width: 100%;
    height: 148px;
    object-fit: cover;
    margin-bottom: 1.15rem;
    border-radius: var(--r-sm);
    background: var(--navy-800);
}
.inquiry-sidebar h2 { margin: 0 0 .4rem; font-size: 1.2rem; line-height: 1.3; font-weight: 700; }
.inquiry-sidebar-code { margin: 0 0 1rem; color: #cdd3e6; font: 500 .78rem "IBM Plex Mono", monospace; }
.inquiry-sidebar dl { margin: 0; }
.inquiry-sidebar dt { margin-top: .85rem; color: #9aa3c0; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.inquiry-sidebar dd { margin: .2rem 0 0; }
.inquiry-sidebar-back {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin-top: auto;
    padding-top: 2rem;
    color: var(--gold);
    font-weight: 700;
}
.inquiry-sidebar-back:hover { color: var(--white); }
.inquiry-main {
    display: flex;
    padding: 2.25rem clamp(1.35rem, 4vw, 3.5rem) 3rem;
    background: var(--white);
}
.inquiry-card {
    flex: 1 1 auto;
    width: 100%;
    max-width: 880px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
.inquiry-fieldset {
    margin: 0 0 1.5rem;
    padding: 0 0 1.5rem;
    border: 0;
    border-bottom: 1px solid var(--line);
}
.inquiry-fieldset:last-of-type { margin-bottom: 1rem; }
.inquiry-fieldset legend {
    margin-bottom: 1rem;
    color: var(--navy);
    font-size: 1.05rem;
    font-weight: 700;
}
.inquiry-form .req { color: var(--danger); }
.inquiry-legal { padding-top: .5rem; text-align: center; }
.inquiry-legal .form-check { text-align: left; margin-bottom: .7rem; }
.inquiry-legal .form-text { text-align: left; margin-bottom: 1.25rem; }
.inquiry-legal a { color: var(--navy); text-decoration: underline; text-underline-offset: 2px; }
.inquiry-legal a:hover { color: var(--gold-600); }

.legal-page { padding: 2.75rem 0 4.5rem; background: var(--white); }
.legal-article { max-width: 46rem; }
.legal-kicker { margin: 0 0 .55rem; color: var(--gold-600); font: 500 .78rem/1.3 "IBM Plex Mono", monospace; letter-spacing: .06em; text-transform: uppercase; }
.legal-page h1 { margin: 0 0 .85rem; color: var(--navy); font-size: clamp(1.85rem, 3.4vw, 2.45rem); line-height: 1.15; font-weight: 700; }
.legal-lead { margin: 0 0 1rem; color: var(--ink); font-size: 1.08rem; }
.legal-meta { margin: 0 0 2rem; color: var(--muted); font-size: .92rem; }
.legal-page h2 { margin: 2.1rem 0 .7rem; color: var(--navy); font-size: 1.12rem; font-weight: 700; }
.legal-page p, .legal-page li { color: var(--ink); }
.legal-page ul, .legal-page ol { padding-left: 1.2rem; margin: 0 0 1rem; }
.legal-page li { margin: .35rem 0; }
.legal-page a { color: var(--navy); text-decoration: underline; text-underline-offset: 2px; }
.legal-page a:hover { color: var(--gold-600); }
.legal-close { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--line); font-weight: 600; color: var(--navy); }
.inquiry-submit {
    min-width: 280px;
    min-height: 52px;
    padding: .75rem 2rem;
    border-radius: var(--r-pill);
    font-weight: 700;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 991.98px) {
    .section-space { padding: 4rem 0; }
    .area-grid { grid-template-columns: repeat(2, 1fr); }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-visual { min-height: 380px; }
    .admin-shell { grid-template-columns: 1fr; }
    .admin-sidebar { position: fixed; left: -280px; width: 264px; box-shadow: var(--shadow-lg); transition: left .28s var(--ease); }
    .admin-sidebar.open { left: 0; }
    .admin-content { padding: 2rem 1.25rem; }
    .catalog-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .area-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .featured-grid { grid-template-columns: 1fr; }
    .inquiry-shell {
        grid-template-columns: 1fr;
        min-height: 0;
    }
    .inquiry-sidebar { min-height: 0; }
}

@media (max-width: 767.98px) {
    .section-space { padding: 3.25rem 0; }
    .min-vh-hero { min-height: 560px; }
    .display-title { font-size: clamp(1.8rem, 7.5vw, 2.6rem); line-height: 1.08; }
    .hero-copy { font-size: 1.06rem; }
    .search-panel { grid-template-columns: auto 1fr; padding: .6rem; }
    .search-panel .btn { grid-column: 1 / -1; }
    .section-heading { align-items: start; flex-direction: column; gap: 1rem; margin-bottom: 1.75rem; }
    .area-grid { grid-template-columns: 1fr; }
    .area-item { min-height: 96px; }
    .catalog-toolbar { padding: 1.1rem; }
    .catalog-filter-main, .catalog-filter-grid { grid-template-columns: 1fr; }
    .catalog-filter-main .btn { width: 100%; }
    .catalog-filter-footer { align-items: flex-start; flex-direction: column; gap: .75rem; }
    .area-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .course-row { grid-template-columns: 96px minmax(0, 1fr); }
    .course-row-image { width: 96px; height: 96px; }
    .course-row-aside { grid-column: 2; align-items: flex-start; flex-direction: row; }
    .catalog-refine { grid-template-columns: 1fr; }
    .detail-masthead-inner { grid-template-columns: 1fr; }
    .inquiry-submit { width: 100%; min-width: 0; }
    .course-image { height: 200px; }
    .course-body { min-height: 0; }
    .detail-hero { padding-top: 2rem; }
    .inquiry-panel { position: static; }
    .footer-bottom, .admin-heading { align-items: stretch; flex-direction: column; }
    .auth-visual { display: none; }
    .auth-form-wrap { min-height: 100vh; padding: 1.5rem; }
    .brand-lockup-header { gap: .5rem; }
    .brand-lockup-header .brand-logo-cocesna { height: 39px; }
    .brand-lockup-header .brand-logo-iccae { height: 27px; }
    .brand-lockup-header .brand-divider { height: 28px; }
    .brand-lockup-auth .brand-logo-cocesna { height: 56px; }
    .brand-lockup-auth .brand-logo-iccae { height: 39px; }
    .admin-topbar { padding: .8rem 1rem; }
    .admin-topbar > div:first-of-type { display: none; }
    .admin-account-copy { display: none; }
    .admin-account-trigger { max-width: none; padding: .3rem; }
    .profile-layout { grid-template-columns: 1fr; }
    .docs-page { grid-template-columns: 1fr; }
    .docs-toc { position: static; }
    .docs-pager { grid-template-columns: 1fr; }
    .docs-pager-link.is-next { text-align: left; }
    .admin-detail-grid { grid-template-columns: 1fr; }
    .admin-filters .form-select { max-width: none; }
    .table { min-width: 720px; }
}

@media (max-width: 575.98px) {
    .hero-stat { display: none; }
    .btn { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    body.reveal-on [data-reveal] { opacity: 1 !important; transform: none !important; }
}
