* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
    color: #333;
}

/* Header */
header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 18px 36px;
    background: #ffffff;
    width: 100%;
    box-sizing: border-box;
    border-bottom: 1px solid rgba(31, 45, 92, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    display: flex;
    align-items: center;
    margin-right: auto;
}

.logo img {
    width: 200px;
    max-width: 100%;
    height: auto;
}

nav {
    margin-right: 20px;
    display: flex;
    align-items: center;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 30px;
}

nav ul li {
    margin-left: 0;
}

nav ul li a {
    text-decoration: none;
    color: #2f3f8f;
    font-weight: 600;
    font-size: 0.95em;
    position: relative;
    transition: color 0.3s ease-in-out;
    white-space: nowrap;
}

nav ul li a:hover {
    color: #7985bb;
}

nav ul li a::after {
    content: "";
    display: block;
    width: 0;
    height: 2px;
    background: #7985bb;
    transition: width 0.3s ease-in-out;
}

nav ul li a:hover::after {
    width: 100%;
}

.btn-contact {
    background: #2f3f8f;
    color: white;
    padding: 11px 18px;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.92em;
    transition: all 0.3s ease;
    margin-left: 20px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 8px 20px rgba(47, 63, 143, 0.18);
}

.btn-contact:hover {
    background: #1f2d5c;
    color: white;
    transform: translateY(-1px);
}

/* Hero */
.hero-section {
    min-height: 32vh;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 52px 20px 36px;
    border-bottom: 1px solid rgba(31, 45, 92, 0.08);
}

.hero-content {
    text-align: center;
    max-width: 900px;
    padding: 0 20px;
}

.hero-title {
    font-size: 3.2rem;
    font-weight: 700;
    color: #1f2d5c;
    margin-bottom: 14px;
    letter-spacing: 0;
    animation: fadeInUp 0.9s ease;
}
.hero-title::after {
    content: "";
    display: block;
    width: 64px;
    height: 3px;
    background: #2f3f8f;
    margin: 14px auto 0;
    border-radius: 999px;
}

.hero-subtitle {
    font-size: 1.05rem;
    color: #5f6780;
    max-width: 660px;
    margin: 0 auto;
    line-height: 1.55;
    animation: fadeInUp 1.1s ease;
}

/* Main */
.convenios-main {
    background: #ffffff;
    padding: 80px 0 100px;
}

.convenios-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.convenios-intro {
    margin-bottom: 40px;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
    position: relative;
}

.section-header::after {
    content: '';
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: #2f3f8f;
    border-radius: 999px;
}

.section-title {
    font-size: 2.4rem;
    font-weight: 700;
    color: #1f2d5c;
    margin-bottom: 16px;
    letter-spacing: 0;
}

.section-description {
    font-size: 1.05rem;
    color: #5f6780;
    max-width: 760px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Convenios Grid */
.convenios-list-section {
    margin-top: 30px;
}

.convenios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 28px;
    margin-bottom: 3rem;
}

.convenio-card {
    background: #ffffff;
    border: 1.5px solid #2f3f8f;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.source-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.30);
    border-color: #2f3f8f;
}

.convenio-logo-wrap {
    width: 100%;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}

.convenio-logo-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.convenio-info {
    padding: 0.5rem 0 0;
    text-align: center;
}

.convenio-name {
    font-weight: 700;
    color: #1f2d5c;
    font-size: 1.05rem;
    line-height: 1.35;
    margin-bottom: 0.4rem;
}

/* States */
.no-convenios {
    text-align: center;
    padding: 3rem;
    background: #ffffff;
    border: 1px solid rgba(31, 45, 92, 0.08);
    border-radius: 16px;
    color: #666;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.no-convenios i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #cbd5e1;
}

.loading {
    text-align: center;
    padding: 40px;
    font-size: 1rem;
    color: #5f6780;
    background: #ffffff;
    border: 1px solid rgba(31, 45, 92, 0.08);
    border-radius: 16px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.loading::before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #e5e7eb;
    border-top: 3px solid #2f3f8f;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

/* Dropdown */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 280px;
    box-shadow: 0px 8px 16px rgba(0,0,0,0.12);
    border-radius: 8px;
    z-index: 1000;
    top: 100%;
    left: 0;
    border: 1px solid #e0e0e0;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: background-color 0.3s ease;
    border-bottom: 1px solid #f0f0f0;
}

.dropdown-content a:last-child {
    border-bottom: none;
    border-radius: 0 0 8px 8px;
}

.dropdown-content a:first-child {
    border-radius: 8px 8px 0 0;
}

.dropdown-content a:hover {
    background-color: #f8f9fa;
    color: #5469b0;
}

.dropdown-content .latest-news {
    font-weight: 600;
    color: #5469b0;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 4px;
}

.dropdown-content .external-link {
    font-size: 0.9em;
    color: #666;
}

.dropdown-content .external-link:hover {
    color: #5469b0;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Tablet */
@media (max-width: 1024px) {
    header {
        padding: 15px 20px;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .logo img {
        width: 180px;
    }

    nav {
        margin-right: 0;
    }

    nav ul {
        gap: 18px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero-section {
    min-height: 28vh;
    padding: 44px 20px 30px;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

    .hero-title {
        font-size: 3.2rem;
    }

    .hero-subtitle {
        font-size: 1.08rem;
        max-width: 640px;
    }

    .convenios-main {
        padding: 60px 0 80px;
    }

    .section-title {
        font-size: 2.1rem;
    }

    .convenios-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 22px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    .logo {
        margin: 0;
    }

    .logo img {
        width: 170px;
        max-width: 100%;
        height: auto;
    }

    nav {
        margin-right: 0;
        width: 100%;
    }

    nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        width: 100%;
    }

    nav ul li {
        margin-left: 0;
    }

    nav ul li a {
        display: inline-block;
        width: auto;
        font-size: 0.82em;
    }

    .btn-contact {
        width: auto;
        margin-left: 0;
        padding: 10px 18px;
        font-size: 0.82em;
    }

    .dropdown-content {
        min-width: 220px;
        left: 50%;
        transform: translateX(-50%);
    }

    .hero-section {
    min-height: 28vh;
    padding: 42px 18px 28px;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

    .hero-title {
        font-size: 2.5rem;
        margin-bottom: 12px;
    }

    .hero-subtitle {
        font-size: 1rem;
        line-height: 1.45;
        max-width: 100%;
    }

    .convenios-main {
        padding: 45px 0 65px;
    }

    .convenios-container {
        padding: 0 16px;
    }

    .section-header {
        margin-bottom: 42px;
    }

    .section-title {
        font-size: 1.95rem;
        line-height: 1.2;
    }

    .section-description {
        font-size: 0.98rem;
    }

    .convenios-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .convenio-card {
        padding: 22px 18px;
    }
}

@media (max-width: 480px) {
    header {
        padding: 12px;
        gap: 12px;
    }

    .logo img {
        width: 150px;
    }

    nav ul {
        gap: 8px;
    }

    nav ul li a {
        font-size: 0.78em;
    }

    .btn-contact {
        padding: 8px 14px;
        font-size: 0.78em;
        border-radius: 8px;
    }

    .hero-section {
    min-height: 24vh;
    padding: 34px 14px 24px;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

    .hero-title {
        font-size: 2.1rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .section-title {
        font-size: 1.7rem;
    }

    .section-description {
        font-size: 0.94rem;
    }

    .convenio-card {
        padding: 20px 16px;
    }

    .convenio-logo-wrap {
        height: 110px;
    }

    .convenio-name {
        font-size: 1rem;
    }

    .dropdown-content {
        min-width: 200px;
    }
}
