/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f2f5;
    color: #212529;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Forzar herencia de fuente en botones e inputs */
button, input, select, textarea {
    font-family: inherit;
}

/* ===== Top bar ===== */
.topbar {
    background: #fff;
    border-bottom: 1px solid #e0e4ea;
    color: #0b2646;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    position: relative;
    z-index: 100;
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 0.6rem 2rem;
}

.topbar-title {
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #0b2646;
}

.topbar-title::before {
    content: '';
    display: inline-block;
    width: 32px;
    height: 32px;
    background: url('../../img/logo-web.png') center/contain no-repeat;
    flex-shrink: 0;
}

/* Botón Volver escritorio */
.topbar-back {
    background: #0b2646;
    color: #fff;
    text-decoration: none;
    padding: 0.35rem 1rem;
    border-radius: 0.4rem;
    font-size: 0.82rem;
    font-weight: 600;
    transition: background 0.2s;
    white-space: nowrap;
}

.topbar-back:hover {
    background: #1a3d6e;
}

/* Hamburguesa — oculto en escritorio */
.topbar-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.3rem;
}

.topbar-hamburger span {
    display: block;
    width: 24px;
    height: 3px;
    background: #0b2646;
    border-radius: 2px;
}

/* Dropdown acordeón */
.topbar-dropdown {
    display: none;
    background: #fff;
    border-top: 1px solid #e0e4ea;
    padding: 0.8rem 1rem;
    box-shadow: 0 4px 12px rgba(11,38,70,0.1);
}

.topbar-dropdown.open {
    display: block;
}

.topbar-back-mobile {
    display: inline-block;
    background: #0b2646;
    color: #fff;
    text-decoration: none;
    padding: 0.65rem 1.4rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.2s;
}

.topbar-back-mobile:hover {
    background: #1a3d6e;
}

/* ===== Hero ===== */
.hero {
    background: #0b2646;
    color: #fff;
    text-align: center;
    padding: 2.8rem 1.5rem 2.5rem;
}

.hero-logo {
    width: 120px;
    height: auto;
    margin-bottom: 1.2rem;
    filter: brightness(0) invert(1);
}

.hero-title {
    font-size: 1.9rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: 0.01em;
}

.hero-subtitle {
    font-size: 1rem;
    opacity: 0.85;
    font-weight: 400;
}

/* ===== Main content ===== */
.main-content {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2.5rem 1rem;
}

.tramites-card {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 4px 24px rgba(11, 38, 70, 0.09);
    padding: 2.2rem 2rem;
    max-width: 760px;
    width: 100%;
    text-align: center;
}

.tramites-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0b2646;
    margin-bottom: 0.35rem;
}

.tramites-subtitle {
    font-size: 0.95rem;
    color: #6c757d;
    margin-bottom: 2rem;
}

/* ===== Tramites grid ===== */
.tramites-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
}

.tramite-item {
    border: 1px solid #e0e4ea;
    border-radius: 0.75rem;
    padding: 1.8rem 1.2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    transition: box-shadow 0.2s;
}

.tramite-item:hover {
    box-shadow: 0 4px 18px rgba(11, 38, 70, 0.1);
}

.tramite-icon {
    background: #0b2646;
    color: #fff;
    border-radius: 50%;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.4rem;
}

.tramite-name {
    font-size: 1rem;
    font-weight: 700;
    color: #0b2646;
    text-align: center;
}

.tramite-desc {
    font-size: 0.88rem;
    color: #6c757d;
    text-align: center;
    line-height: 1.5;
    flex: 1;
}

.tramite-link {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    background: none;
    cursor: pointer;
    padding: 0;
}

.tramite-link--active {
    color: #0b2646;
    cursor: pointer;
    transition: opacity 0.2s;
}

.tramite-link--active:hover {
    opacity: 0.7;
    text-decoration: underline;
}

.tramite-link--disabled {
    color: #adb5bd;
    cursor: default;
    font-style: italic;
}

/* ===== Footer ===== */
.footer {
    background: #0b2646;
    color: #c8d0e7;
    padding: 2rem 2rem 1rem;
    font-size: 0.85rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 960px;
    margin: 0 auto 1.2rem;
}

.footer-col strong {
    display: block;
    color: #fff;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.footer-col p {
    margin-bottom: 0.25rem;
    line-height: 1.6;
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.12);
    padding-top: 0.8rem;
    font-size: 0.78rem;
    color: #8fa0c8;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
    .hero-title { font-size: 1.3rem; }
    .tramites-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .tramites-card { padding: 1.5rem 1rem; }

    /* Topbar móvil */
    .topbar-inner { padding: 0.7rem 1rem; }
    .topbar-back { display: none; }
    .topbar-hamburger { display: flex; }
    .topbar-title { font-size: 0.88rem; line-height: 1.3; }

    /* Quitar indicador ▾ anterior si quedara */
    .topbar-title::after { display: none; }
}

/* ===== Modal ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(11, 38, 70, 0.55);
    backdrop-filter: blur(3px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 8px 40px rgba(11, 38, 70, 0.22);
    max-width: 520px;
    width: 100%;
    overflow: hidden;
    animation: modalIn 0.22s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(-18px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    background: #0b2646;
    padding: 1.2rem 1.6rem;
}

.modal-title {
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
}

.modal-body {
    padding: 1.6rem 1.6rem 1.2rem;
}

.modal-intro {
    font-size: 0.93rem;
    color: #495057;
    margin-bottom: 1rem;
}

.modal-list {
    padding-left: 1.3rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.modal-list li {
    font-size: 0.93rem;
    color: #333;
    line-height: 1.55;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.6rem 1.4rem;
    border-top: 1px solid #e9ecef;
}

.modal-btn {
    border: none;
    border-radius: 0.5rem;
    padding: 0.6rem 1.3rem;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
}

.modal-btn--secondary {
    background: #e9ecef;
    color: #495057;
}

.modal-btn--secondary:hover {
    background: #dee2e6;
}

.modal-btn--primary {
    background: #0b2646;
    color: #fff;
}

.modal-btn--primary:hover {
    background: #1a3d6e;
}

@media (max-width: 480px) {
    .modal-footer { flex-direction: column-reverse; }
    .modal-btn { width: 100%; text-align: center; }
}

/* Footer icons */
.footer-col p .fas {
    width: 16px;
    text-align: center;
    margin-right: 0.4rem;
    opacity: 0.85;
}
