@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800&family=Open+Sans:wght@300;400;500;600;700&display=swap');

:root {
    /* Exact Institutional Colors 2026-2029 (Updated Palette) */
    --color-primary: #235B4E;
    --color-primary-dark: #1a352d;
    --color-secondary: #AD0040;
    --color-secondary-dark: #8a0033;
    --color-white: #FFFFFF;
    --color-gray-inst: #BABAC0;
    --color-bg-cream: #DDC9A3;
    --color-bg-body: #DDC9A3;
    --color-text-main: #1a1a1a;
    --color-text-muted: #4a4a4a;
    --color-alert-red: #BF0811;

    /* Clean Shadows & Elevation */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.12);

    /* Spacing & Borders */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 24px;

    /* Grid & Spacing */
    --container-max: 1400px;
    --section-gap: 12rem;
    --grid-gap: 4rem;

    /* Interactive Variables */
    --mouse-x: 50%;
    --mouse-y: 50%;

    /* Typography */
    --font-header: 'Montserrat', sans-serif;
    --font-body: 'Open Sans', sans-serif;
}

/* --- Institutional Notice (Dev Banner) --- */
.dev-banner {
    background: var(--color-accent-gold);
    color: var(--color-primary);
    padding: 1rem 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 10;
    border-bottom: 2px solid var(--color-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.dev-banner i {
    color: var(--color-secondary);
    font-size: 1rem;
}

/* --- Glassmorphism 2.0 --- */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-dark {
    background: rgba(13, 22, 20, 0.6);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- Interactive Elements --- */
.magnetic-wrap {
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.custom-cursor {
    width: 20px;
    height: 20px;
    background: var(--color-accent-red);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
    transition: width 0.3s, height 0.3s, transform 0.1s;
    transform: translate(-50%, -50%);
    display: none;
}

body:hover .custom-cursor {
    display: block;
}

@media (pointer: coarse) {
    .custom-cursor {
        display: none !important;
    }
}

/* --- Global Reset & Base --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg-body);
    color: var(--color-text-main);
    line-height: 1.7;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
.font-header {
    font-family: var(--font-header);
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* --- Scroll Reveal Classes --- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* --- Layout Architecture --- */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 2rem;
}

.grid-main {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--grid-gap);
}

.section-padding {
    padding: var(--section-gap) 0;
}

/* --- Navigation Excellence --- */
header {
    height: 90px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 2000;
    transition: all 0.4s ease;
}

header.scrolled {
    height: 75px;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.header-inner {
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-left,
.logo-right {
    height: 55px;
    width: auto;
    transition: height 0.3s;
}

header.scrolled .logo-left,
header.scrolled .logo-right {
    height: 45px;
}

nav ul {
    display: flex;
    gap: 3.5rem;
    list-style: none;
    gap: 2.5rem;
    justify-content: center;
    align-items: center;
}

nav a {
    text-decoration: none;
    color: var(--color-text-main);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.5rem 0;
    position: relative;
    font-family: var(--font-header);
    text-transform: uppercase;
    letter-spacing: 1px;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent-red));
    transition: width 0.3s ease;
}

nav a:hover::after,
nav a.active::after {
    width: 100%;
}

nav a:hover,
nav a.active {
    color: var(--color-primary);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--color-primary);
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 3000;
}

@media (max-width: 900px) {
    .menu-toggle {
        display: block;
    }

    nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background: var(--color-bg-body);
        z-index: 2500;
        transition: 0.5s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    }

    nav.active {
        right: 0;
    }

    nav ul {
        flex-direction: column;
        gap: 2rem;
    }

    nav a {
        font-size: 1.5rem;
        color: var(--color-primary) !important;
    }
}



/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: var(--color-primary);
    color: var(--color-white);
    text-align: center;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(35, 91, 78, 0.7), rgba(17, 17, 17, 0.8));
    z-index: 1;
}

.hero-bg-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    filter: brightness(0.6);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 1000px;
    padding: 2rem;
}

.hero h2 {
    font-size: clamp(3rem, 8vw, 5.5rem);
    line-height: 1.1;
    margin-bottom: 2rem;
    color: var(--color-white);
    text-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    font-weight: 800;
}

.hero-search {
    display: flex;
    max-width: 850px;
    margin: 4rem auto 0;
    padding: 0.6rem;
    border-radius: 100px;
    position: relative;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.hero-search::after {
    content: '';
    position: absolute;
    inset: -2px;
    background: radial-gradient(circle at var(--mouse-x) var(--mouse-y), rgba(255, 255, 255, 0.4) 0%, transparent 50%);
    border-radius: 100px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.5s;
}

.hero-search:focus-within::after {
    opacity: 1;
}

.hero-search:focus-within {
    transform: translateY(-5px) scale(1.02);
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.hero-search-icon {
    display: flex;
    align-items: center;
    padding-left: 2.5rem;
    color: var(--color-bg-cream);
    font-size: 1.4rem;
}

.hero-search input {
    flex: 1;
    border: none;
    padding: 1.5rem 2rem;
    font-size: 1.3rem;
    outline: none;
    background: transparent;
    color: white;
    font-family: var(--font-body);
}

.hero-search input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.hero-search button {
    background: var(--color-white);
    color: var(--color-primary);
    border: none;
    padding: 0 4rem;
    border-radius: 100px;
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: var(--shadow-lg);
}

.hero-search button:hover {
    background: var(--color-accent-red);
    color: white;
    transform: translateX(5px);
}

.hero p {
    font-size: 1.5rem;
    margin-bottom: 3.5rem;
    color: var(--color-secondary);
    font-weight: 300;
}

.hero-btn {
    display: inline-block;
    background: var(--color-accent-red);
    color: white;
    padding: 1.2rem 3.5rem;
    border-radius: 100px;
    text-decoration: none;
    font-weight: 700;
    font-family: var(--font-header);
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(191, 8, 17, 0.3);
}

.hero-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(191, 8, 17, 0.5);
    background: var(--color-secondary-dark);
}

/* --- Dual Hero Section --- */
.dual-hero {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12rem 0 10rem !important;
    position: relative;
    overflow: hidden;
    background: var(--color-primary);
}

.dual-hero .hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(35, 91, 78, 0.9) 0%, var(--color-primary) 100%);
    z-index: 1;
}

.dual-hero .container {
    position: relative;
    z-index: 2;
}

.dual-hero h1 {
    color: white;
    margin-top: 1rem;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.dual-hero .grid-main>div {
    grid-column: span 6;
}

.dual-hero .premium-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(221, 201, 163, 0.1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 3.5rem 2.5rem;
    border-radius: var(--radius-lg);
    transition: all 0.4s ease;
}

.dual-hero .premium-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(221, 201, 163, 0.4);
    transform: translateY(-5px);
}

.dual-hero .hero-btn {
    width: 100%;
    margin-bottom: 1rem;
    padding: 1.2rem 2rem;
    font-size: 0.95rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

@media (max-width: 991px) {
    .dual-hero {
        padding: 8rem 0 4rem !important;
    }
}

@media (max-width: 768px) {
    .dual-hero {
        padding: 6rem 0 3rem !important;
    }

    .dual-hero .grid-main {
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }

    .dual-hero .grid-main>div {
        grid-column: span 12;
    }

    .dual-hero h1 {
        font-size: clamp(2rem, 8vw, 2.5rem);
        margin-bottom: 2.5rem;
    }

    .dual-hero .premium-card {
        padding: 2.5rem 1.5rem;
    }
}

/* --- Premium Cards & Elements --- */
.premium-card {
    background: var(--color-white);
    padding: 3.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.premium-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(35, 91, 78, 0.1);
}

.premium-card i {
    font-size: 3rem;
    color: var(--color-primary-light);
    margin-bottom: 2.5rem;
    display: inline-block;
}

/* --- Section Titles --- */
.section-header {
    text-align: center;
    margin-bottom: 8rem;
}

.section-header span {
    color: var(--color-secondary);
    font-weight: 700;
    letter-spacing: 4px;
    text-transform: uppercase;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    display: block;
}

.section-header h2 {
    font-size: 3.5rem;
    color: var(--color-primary);
    line-height: 1.2;
}

/* --- Footer --- */
footer {
    background: #0D1614;
    color: var(--color-white);
    padding: 8rem 0 3rem;
    border-top: 5px solid var(--color-primary);
}

.footer-inner {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 5rem;
}

.logo-footer {
    height: 140px;
    filter: brightness(0) invert(1);
    margin-bottom: 2rem;
}

.footer-bottom {
    margin-top: 6rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(186, 186, 192, 0.1);
    text-align: center;
    color: var(--color-secondary);
    font-size: 0.9rem;
}

/* --- Convocatoria Specific Polish --- */
.section-header-bases {
    margin-bottom: 8rem;
}

.convocatoria-card {
    padding: 6rem;
}

.gender-parity-box {
    padding: 3rem;
    margin: 4rem 0;
}

.convocatoria-title {
    font-size: clamp(1.5rem, 8vw, 4rem);
    letter-spacing: 0.05em;
    font-weight: 800;
    text-transform: uppercase;
    word-break: break-word;
}

.hero-title {
    font-size: clamp(2.2rem, 9vw, 5.5rem);
    font-weight: 800;
    color: var(--color-white);
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* --- Responsive Architecture --- */
@media (max-width: 1200px) {
    :root {
        --section-gap: 8rem;
        --grid-gap: 3rem;
    }

    .hero h2 {
        font-size: 4rem;
    }
}

@media (max-width: 991px) {
    :root {
        --section-gap: 6rem;
        --grid-gap: 2rem;
    }

    .footer-inner {
        grid-template-columns: repeat(2, 1fr);
        gap: 3rem;
    }

    .hero h2 {
        /* Using fluid scaling */
        font-size: clamp(2.5rem, 10vw, 4rem);
    }
}

@media (max-width: 900px) {
    .header-inner {
        padding: 0 1rem;
    }

    .logo-left,
    .logo-right {
        height: 45px;
    }
}

@media (max-width: 768px) {
    :root {
        --section-gap: 5rem;
    }

    .container {
        padding: 0 1.5rem;
    }

    .section-header {
        margin-bottom: 4rem;
    }

    .section-header h2 {
        font-size: 2.5rem;
    }

    .premium-card {
        padding: 2.5rem 1.5rem;
    }

    .hero-actions {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        margin-top: 3rem !important;
    }

    .hero-btn {
        width: 100%;
        margin-left: 0 !important;
        text-align: center;
    }

    .hero h2 {
        font-size: 2.8rem;
    }

    .footer-inner {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-inner div {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .footer-inner ul {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .footer-inner div[style*="text-align: right"] {
        text-align: center !important;
    }

    .footer-inner div div[style*="justify-content: flex-end"] {
        justify-content: center !important;
    }

    /* Mobile Header Cleanup */
    .header-inner {
        display: grid;
        grid-template-columns: auto 1fr auto;
        gap: 1rem;
        padding: 0 1rem;
    }

    .logo-right-container {
        display: none;
        /* Hide one logo on very small screens to save space */
    }

    .logo-left {
        height: 45px;
    }

    .menu-toggle {
        margin-left: auto;
    }

    /* Table Responsiveness */
    table thead {
        display: none;
    }

    table,
    table tbody,
    table tr,
    table td {
        display: block;
        width: 100%;
    }

    table tr {
        margin-bottom: 2rem;
        border: 1px solid #eee;
        border-radius: 12px;
        padding: 1rem;
        background: #fdfdfd;
    }

    table td {
        text-align: right;
        padding: 0.8rem 0.5rem !important;
        position: relative;
        border-bottom: 1px solid #f5f5f5;
    }

    table td::before {
        content: attr(data-label);
        position: absolute;
        left: 0.5rem;
        width: 50%;
        text-align: left;
        font-weight: 700;
        color: var(--color-primary);
    }

    table td:last-child {
        border-bottom: none;
    }
}

@media (max-width: 480px) {
    .hero h2 {
        font-size: 2.2rem;
    }

    .hero-content span {
        font-size: 0.8rem;
        letter-spacing: 3px !important;
    }

    .hero-actions {
        gap: 1rem;
    }

    .premium-card h3 {
        font-size: 1.8rem;
    }

    .dev-banner {
        font-size: 0.75rem;
        padding: 0.8rem 1rem;
    }

    .section-header-bases {
        margin-bottom: 4rem;
    }

    .convocatoria-card {
        padding: 3rem 1.5rem;
    }

    .gender-parity-box {
        padding: 2rem 1.5rem;
        margin: 3rem 0;
    }

    .section-header-bases h2 {
        font-size: 2rem;
    }

    .grid-main {
        grid-template-columns: 1fr !important;
        gap: 2rem;
    }

    .grid-main>div {
        grid-column: span 1 !important;
    }

    .president-bio-grid {
        text-align: center;
    }

    .president-text-container {
        padding-left: 0 !important;
        margin-top: 3rem;
    }
}

/* --- End of Styles --- */