/* ==========================================================================
   Portal de Servicios en Línea — GAD Municipal de Guaranda
   Landing de serviciosenlinea.guaranda.gob.ec (TIPO_SISTEMA 3)
   Diseño: docs/Portal Guaranda landing page/Portal Guaranda.dc.html
   ========================================================================== */

:root {
    --pg-navy: #2e375d;
    --pg-navy-2: #3d4a72;
    --pg-navy-3: #1f2640;
    --pg-red: #e20e18;
    --pg-red-dark: #bc192d;
    --pg-red-soft: #fce7e8;
    --pg-bg: #f5f6fa;
    --pg-bg-2: #eef0f6;
    --pg-line: #dde1ea;
    --pg-text: #1b2230;
    --pg-muted: #59637a;
    --pg-muted-2: #8a93a6;
    --pg-display: 'Archivo', system-ui, sans-serif;
    --pg-body: 'Public Sans', system-ui, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body.pg-body {
    margin: 0;
    background: var(--pg-bg);
    color: var(--pg-text);
    font-family: var(--pg-body);
    -webkit-font-smoothing: antialiased;
}

.pg-body *,
.pg-body *::before,
.pg-body *::after {
    box-sizing: border-box;
}

.pg-body a {
    color: var(--pg-navy);
    text-decoration: none;
}

.pg-body a:hover {
    color: var(--pg-red);
}

.pg-body h1, .pg-body h2, .pg-body h3, .pg-body h4 {
    margin: 0;
}

.pg-body ul {
    margin: 0;
}

.pg-body input, .pg-body button {
    font-family: var(--pg-body);
}

.pg-body :focus-visible {
    outline: 3px solid var(--pg-navy-2);
    outline-offset: 2px;
}

.pg-body [id] {
    scroll-margin-top: 140px;
}

.pg-container {
    max-width: 1220px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== Botones ===== */
.pg-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 14.5px;
    padding: 13px 22px;
    border-radius: 6px;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: background 0.15s ease;
}

.pg-body a.pg-btn-red, .pg-btn-red {
    background: var(--pg-red);
    border-color: var(--pg-red);
    color: #fff;
}

.pg-body a.pg-btn-red:hover, .pg-btn-red:hover {
    background: var(--pg-red-dark);
    border-color: var(--pg-red-dark);
    color: #fff;
}

.pg-body a.pg-btn-light, .pg-btn-light {
    background: #fff;
    color: var(--pg-navy);
    border-color: var(--pg-navy);
}

.pg-body a.pg-btn-light:hover, .pg-btn-light:hover {
    background: var(--pg-bg-2);
    color: var(--pg-navy);
}

.pg-btn-sm {
    font-size: 13px;
    padding: 9px 14px;
}

/* ===== Header ===== */
.pg-header {
    position: sticky;
    top: 0;
    z-index: 80;
    background: #fff;
    box-shadow: 0 1px 0 var(--pg-line);
}

.pg-header-strip {
    height: 5px;
    background: var(--pg-red);
}

.pg-header-top {
    padding-top: 14px;
    padding-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.pg-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.pg-brand img {
    height: 52px;
    width: auto;
    display: block;
}

.pg-brand-tag {
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--pg-red);
    font-weight: 700;
    border-left: 1px solid var(--pg-line);
    padding-left: 16px;
    max-width: 130px;
    line-height: 1.5;
}

.pg-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pg-user {
    position: relative;
}

.pg-user summary {
    list-style: none;
    cursor: pointer;
}

.pg-user summary::-webkit-details-marker {
    display: none;
}

.pg-user-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 200px;
    background: #fff;
    border: 1px solid var(--pg-line);
    border-radius: 6px;
    box-shadow: 0 12px 30px rgba(46, 55, 93, 0.15);
    padding: 6px;
    display: flex;
    flex-direction: column;
    z-index: 90;
}

.pg-user-menu a {
    padding: 9px 12px;
    border-radius: 4px;
    font-size: 13.5px;
    font-weight: 600;
}

.pg-user-menu a:hover {
    background: var(--pg-bg-2);
}

.pg-nav {
    background: var(--pg-navy);
}

.pg-nav .pg-container {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
}

.pg-nav .pg-container::-webkit-scrollbar {
    display: none;
}

.pg-body .pg-nav a {
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 15px 22px;
    white-space: nowrap;
}

.pg-body .pg-nav a:hover {
    background: var(--pg-navy-2);
    color: #fff;
}

.pg-body .pg-nav a.is-active {
    background: var(--pg-red);
}

/* ===== Hero ===== */
.pg-hero {
    background: linear-gradient(180deg, var(--pg-bg-2) 0%, var(--pg-bg) 100%);
    border-bottom: 1px solid var(--pg-line);
    padding: 52px 0 44px;
}

.pg-hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 44px;
    align-items: center;
}

.pg-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid var(--pg-line);
    color: var(--pg-navy);
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 999px;
    margin-bottom: 16px;
}

.pg-pill-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--pg-red);
}

.pg-hero h1 {
    font-family: var(--pg-display);
    font-size: clamp(30px, 3.6vw, 42px);
    line-height: 1.08;
    color: var(--pg-navy);
    letter-spacing: -0.015em;
}

.pg-hero h1 span {
    display: block;
    color: var(--pg-red);
    font-weight: 600;
    font-size: 0.62em;
    margin-top: 6px;
}

.pg-hero-lead {
    color: var(--pg-muted);
    font-size: 16px;
    line-height: 1.65;
    max-width: 480px;
    margin: 16px 0 0;
}

.pg-checks {
    list-style: none;
    padding: 0;
    margin: 22px 0 0 !important;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pg-checks li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14.5px;
    color: var(--pg-text);
    font-weight: 500;
}

.pg-check {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    background: var(--pg-navy);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

.pg-hero-actions {
    display: flex;
    gap: 12px;
    margin-top: 26px;
    flex-wrap: wrap;
}

.pg-hero-art {
    background: #fff;
    border: 1px solid var(--pg-line);
    border-radius: 14px;
    padding: 28px;
    box-shadow: 0 18px 44px rgba(46, 55, 93, 0.14);
}

.pg-hero-art svg {
    width: 100%;
    height: auto;
    display: block;
}

.pg-hero-img {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 460 / 380;
    object-fit: cover;
    border-radius: 10px;
    display: block;
}

/* ===== Secciones ===== */
.pg-section {
    padding: 56px 0;
}

.pg-section-white {
    background: #fff;
    border-top: 1px solid var(--pg-line);
}

.pg-section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.pg-section-head-center {
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.pg-eyebrow {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--pg-red);
    margin-bottom: 8px;
}

.pg-section h2 {
    font-family: var(--pg-display);
    font-size: clamp(24px, 2.6vw, 30px);
    color: var(--pg-navy);
    max-width: 600px;
}

.pg-section-head p {
    color: var(--pg-muted);
    max-width: 380px;
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

/* ===== Servicios ===== */
.pg-services {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.pg-service {
    background: #fff;
    border: 1px solid var(--pg-line);
    border-top: 4px solid var(--pg-navy);
    border-radius: 8px;
    padding: 26px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.pg-service.is-red { border-top-color: var(--pg-red); }
.pg-service.is-navy2 { border-top-color: var(--pg-navy-2); }
.pg-service.is-navy3 { border-top-color: var(--pg-navy-3); }

.pg-service-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: var(--pg-bg-2);
    color: var(--pg-navy);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pg-service.is-red .pg-service-icon { background: var(--pg-red-soft); color: var(--pg-red-dark); }
.pg-service.is-navy2 .pg-service-icon { color: var(--pg-navy-2); }
.pg-service.is-navy3 .pg-service-icon { color: var(--pg-navy-3); }

.pg-service h3 {
    font-family: var(--pg-display);
    font-size: 20px;
    color: var(--pg-navy);
}

.pg-service p {
    font-size: 14px;
    color: var(--pg-muted);
    line-height: 1.6;
    margin: 8px 0 0;
}

.pg-service-link {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 700;
    transition: gap 0.15s ease;
}

.pg-body a.pg-service-link:hover {
    gap: 12px;
    color: var(--pg-red);
}

.pg-lookup {
    margin-top: auto;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pg-lookup input {
    flex: 1 1 120px;
    min-width: 0;
    border: 1.5px solid var(--pg-line);
    border-radius: 6px;
    padding: 11px 12px;
    font-size: 14px;
    color: var(--pg-text);
    background: #fff;
}

.pg-lookup input:focus {
    border-color: var(--pg-navy);
    outline: none;
}

.pg-lookup button {
    background: var(--pg-red);
    color: #fff;
    border: none;
    font-weight: 700;
    font-size: 13.5px;
    padding: 11px 18px;
    border-radius: 6px;
    cursor: pointer;
}

.pg-lookup button:hover {
    background: var(--pg-red-dark);
}

/* ===== Video tutoriales ===== */
.pg-videos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.pg-video {
    display: flex;
    flex-direction: column;
    padding: 0;
    text-align: left;
    background: var(--pg-bg);
    border: 1px solid var(--pg-line);
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pg-video:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(46, 55, 93, 0.12);
}

.pg-video-cover {
    width: 100%;
    aspect-ratio: 16 / 10;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
}

.pg-video-play {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.pg-video-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 14px 15px;
}

.pg-video-title {
    font-size: 13.5px;
    color: var(--pg-text);
    font-weight: 700;
    line-height: 1.4;
}

.pg-video-meta {
    font-size: 11.5px;
    color: var(--pg-muted-2);
}

.pg-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(15, 20, 35, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.pg-modal[hidden] {
    display: none;
}

.pg-modal-dialog {
    width: 100%;
    max-width: 960px;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.pg-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--pg-navy);
    color: #fff;
}

.pg-modal-head h3 {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

.pg-modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.pg-modal-frame {
    aspect-ratio: 16 / 9;
}

.pg-modal-frame iframe,
.pg-modal-frame video {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* ===== Preguntas frecuentes ===== */
.pg-faqs {
    max-width: 820px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pg-faq {
    background: #fff;
    border: 1px solid var(--pg-line);
    border-radius: 6px;
    overflow: hidden;
}

.pg-faq summary {
    list-style: none;
    cursor: pointer;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    font-weight: 700;
    font-size: 14.5px;
    color: var(--pg-navy);
}

.pg-faq summary::-webkit-details-marker {
    display: none;
}

.pg-faq-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--pg-bg-2);
    color: var(--pg-navy);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
    line-height: 1;
}

.pg-faq-icon::before {
    content: "+";
}

.pg-faq[open] .pg-faq-icon {
    background: var(--pg-navy);
    color: #fff;
}

.pg-faq[open] .pg-faq-icon::before {
    content: "\2212";
}

.pg-faq-answer {
    padding: 0 20px 20px;
    font-size: 14px;
    color: var(--pg-muted);
    line-height: 1.65;
}

/* ===== CTA ===== */
.pg-cta {
    background: #fff;
    border: 1px solid var(--pg-line);
    border-left: 5px solid var(--pg-red);
    border-radius: 6px;
    padding: 38px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
    box-shadow: 0 6px 20px rgba(46, 55, 93, 0.07);
}

.pg-cta h2 {
    font-family: var(--pg-display);
    font-size: 23px;
    color: var(--pg-navy);
    max-width: 420px;
}

.pg-cta p {
    color: var(--pg-muted);
    font-size: 14px;
    margin: 8px 0 0;
    max-width: 440px;
    line-height: 1.6;
}

.pg-cta-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ===== Footer ===== */
.pg-footer {
    background: var(--pg-navy);
    color: rgba(255, 255, 255, 0.78);
    padding: 50px 0 24px;
}

.pg-footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.pg-footer h4 {
    color: #fff;
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 14px;
}

.pg-footer p {
    font-size: 13.5px;
    line-height: 1.65;
    max-width: 280px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

.pg-footer ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 9px;
    font-size: 13.5px;
}

.pg-body .pg-footer a {
    color: rgba(255, 255, 255, 0.78);
}

.pg-body .pg-footer a:hover {
    color: #fff;
}

.pg-footer-bottom {
    display: flex;
    justify-content: space-between;
    padding-top: 18px;
    font-size: 12px;
    flex-wrap: wrap;
    gap: 10px;
    color: rgba(255, 255, 255, 0.6);
}

/* ==========================================================================
   Responsive — escalera de breakpoints
   1200+ desktop | <=1199 desktop chico | <=991 tablet | <=767 phone grande
   <=575 phone | <=400 phone chico
   ========================================================================== */

/* ===== Desktop chico ===== */
@media (max-width: 1199px) {
    .pg-container {
        padding: 0 20px;
    }

    .pg-hero-grid {
        gap: 32px;
    }
}

/* ===== Tablet ===== */
@media (max-width: 991px) {
    .pg-body [id] {
        scroll-margin-top: 120px;
    }

    .pg-hero {
        padding: 42px 0 36px;
    }

    .pg-hero-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .pg-hero-lead {
        max-width: none;
    }

    .pg-hero-art {
        max-width: 560px;
        margin: 0 auto;
        padding: 22px;
    }

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

    .pg-section-head {
        margin-bottom: 24px;
    }

    .pg-section-head p {
        max-width: none;
    }

    .pg-services {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }

    .pg-service {
        padding: 22px;
    }

    .pg-videos {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .pg-cta {
        padding: 30px;
    }

    .pg-cta h2,
    .pg-cta p {
        max-width: none;
    }

    .pg-footer {
        padding: 42px 0 22px;
    }

    .pg-footer p {
        max-width: none;
    }
}

/* ===== Phone grande / landscape ===== */
@media (max-width: 767px) {
    .pg-body [id] {
        scroll-margin-top: 110px;
    }

    .pg-container {
        padding: 0 18px;
    }

    .pg-header-top {
        padding-top: 12px;
        padding-bottom: 12px;
        gap: 12px;
    }

    .pg-body .pg-nav a {
        padding: 13px 16px;
        font-size: 12.5px;
    }

    .pg-hero {
        padding: 34px 0 30px;
    }

    .pg-section {
        padding: 36px 0;
    }

    .pg-section-head {
        align-items: flex-start;
        gap: 14px;
    }

    .pg-services {
        grid-template-columns: 1fr;
    }

    .pg-cta {
        padding: 26px;
        align-items: flex-start;
        gap: 20px;
    }

    .pg-faq summary {
        padding: 16px;
        font-size: 14px;
    }

    .pg-faq-answer {
        padding: 0 16px 16px;
    }

    .pg-footer-grid {
        gap: 26px;
        padding-bottom: 24px;
    }
}

/* ===== Phone ===== */
@media (max-width: 575px) {
    .pg-body [id] {
        scroll-margin-top: 100px;
    }

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

    .pg-brand img {
        height: 42px;
    }

    .pg-brand-tag {
        display: none;
    }

    .pg-header-actions {
        gap: 8px;
    }

    .pg-hero-grid {
        grid-template-columns: 1fr;
    }

    .pg-hero-art {
        padding: 16px;
        border-radius: 10px;
    }

    .pg-hero-lead {
        font-size: 15px;
    }

    .pg-hero-actions {
        margin-top: 22px;
    }

    .pg-hero-actions .pg-btn {
        flex: 1 1 100%;
        justify-content: center;
    }

    .pg-section {
        padding: 30px 0;
    }

    .pg-videos {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }

    .pg-video-body {
        padding: 12px;
    }

    .pg-lookup input,
    .pg-lookup button {
        flex: 1 1 100%;
    }

    .pg-cta {
        padding: 22px;
    }

    .pg-cta h2 {
        font-size: 20px;
    }

    .pg-cta-actions {
        width: 100%;
    }

    .pg-cta-actions .pg-btn {
        flex: 1 1 100%;
        justify-content: center;
    }

    .pg-modal {
        padding: 10px;
    }

    .pg-modal-head {
        padding: 9px 12px;
    }

    .pg-modal-head h3 {
        font-size: 13.5px;
    }

    .pg-footer {
        padding: 34px 0 20px;
    }

    .pg-footer-bottom {
        flex-direction: column;
        gap: 6px;
    }
}

/* ===== Phone chico ===== */
@media (max-width: 400px) {
    .pg-container {
        padding: 0 14px;
    }

    .pg-header-actions {
        width: 100%;
    }

    .pg-header-actions > .pg-btn,
    .pg-header-actions > .pg-user,
    .pg-header-actions > .pg-user > summary {
        width: 100%;
        justify-content: center;
    }

    .pg-body .pg-nav a {
        padding: 12px 13px;
    }

    .pg-videos {
        grid-template-columns: 1fr;
    }

    .pg-service {
        padding: 18px;
    }

    .pg-service h3 {
        font-size: 18px;
    }
}
