/*
 * Medicuan · Handlebars front
 * Estilos del nuevo front SSR. Se monta encima de:
 *  - /assets/index-BcyMYVZG.css  (Tailwind+custom heredado del antiguo SPA)
 *  - /public/css/style.css        (look-and-feel base de Medicuan)
 * Todos los estilos viven bajo el namespace .hbs- / .auth- / .dpanel- / .dcal-
 * etc. para no chocar con clases legacy de CodeIgniter.
 */

:root {
    --hbs-primary: #105ea6;
    --hbs-primary-dark: #0b457f;
    --hbs-secondary: #2eb8cb;
    --hbs-accent: #42d2e3;
    --hbs-bg: #f1f5f9;
    --hbs-surface: #ffffff;
    --hbs-text: #1e293b;
    --hbs-muted: #64748b;
    --hbs-border: #e2e8f0;
    --hbs-success: #10b981;
    --hbs-warning: #f59e0b;
    --hbs-danger: #ef4444;
    --hbs-shadow-sm: 0 4px 6px -1px rgba(15, 23, 42, .06);
    --hbs-shadow-md: 0 12px 24px -8px rgba(16, 94, 166, .18);
    --hbs-shadow-lg: 0 24px 48px -12px rgba(16, 94, 166, .28);
    --hbs-radius: 16px;
    --hbs-radius-lg: 24px;
}

.medicuan-body {
    background: var(--hbs-bg);
    color: var(--hbs-text);
    font-family: 'Poppins', system-ui, sans-serif;
    min-height: 100vh;
}

.medicuan-main {
    min-height: calc(100vh - 540px);
}

.hbs-container {
    width: min(1200px, 92vw);
    margin: 0 auto;
}

/* ───────────── Botones ───────────── */
.hbs-btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .65rem 1.1rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 600;
    font-size: .95rem;
    cursor: pointer;
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease, border-color .18s ease;
    line-height: 1;
    background: transparent;
    color: var(--hbs-text);
}
.hbs-btn:hover { transform: translateY(-1px); }
.hbs-btn:active { transform: translateY(0); }
.hbs-btn--primary {
    background: linear-gradient(135deg, var(--hbs-primary) 0%, var(--hbs-secondary) 100%);
    color: #fff;
    box-shadow: var(--hbs-shadow-md);
}
.hbs-btn--primary:hover { box-shadow: var(--hbs-shadow-lg); }
.hbs-btn--ghost {
    background: rgba(16, 94, 166, .06);
    color: var(--hbs-primary-dark);
    border-color: rgba(16, 94, 166, .12);
}
.hbs-btn--ghost:hover { background: rgba(16, 94, 166, .12); }
.hbs-btn--lg { padding: .9rem 1.6rem; font-size: 1rem; }
.hbs-btn--sm { padding: .48rem .85rem; font-size: .84rem; }
.hbs-btn--block { width: 100%; justify-content: center; }
.hbs-btn:disabled { opacity: .55; pointer-events: none; }

/* ───────────── Navbar ───────────── */
.hbs-navbar {
    position: sticky;
    top: env(safe-area-inset-top, 0);
    z-index: 50;
    backdrop-filter: blur(14px);
    background: rgba(255, 255, 255, .82);
    border-bottom: 1px solid rgba(15, 23, 42, .06);
}
.hbs-navbar__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .85rem 0;
    gap: 1rem;
}
.hbs-navbar__brand {
    display: flex;
    align-items: center;
    gap: .65rem;
    text-decoration: none;
    color: var(--hbs-primary-dark);
}
.hbs-navbar__logo { width: 38px; height: 38px; object-fit: contain; }
.hbs-navbar__brandText { font-weight: 800; font-size: 1.18rem; letter-spacing: -.01em; }
.hbs-navbar__links { display: flex; gap: 1.4rem; align-items: center; }
.hbs-navbar__link {
    color: var(--hbs-muted);
    text-decoration: none;
    font-weight: 500;
    padding: .35rem .25rem;
    border-bottom: 2px solid transparent;
    transition: color .15s ease, border-color .15s ease;
}
.hbs-navbar__link:hover, .hbs-navbar__link.is-active {
    color: var(--hbs-primary-dark);
    border-bottom-color: var(--hbs-secondary);
}
.hbs-navbar__link--ghost { color: var(--hbs-primary); }
.hbs-navbar__actions { display: flex; gap: .5rem; align-items: center; }
.hbs-navbar__hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    border: none;
    background: transparent;
    cursor: pointer;
}
.hbs-navbar__hamburger span {
    width: 26px; height: 2px; background: var(--hbs-primary-dark); border-radius: 2px;
    transition: transform .2s ease;
}
.hbs-navbar__mobile {
    padding: 1rem 1.5rem 1.5rem;
    background: #fff;
    border-top: 1px solid var(--hbs-border);
    display: flex;
    flex-direction: column;
    gap: .25rem;
    animation: hbs-fade-in .25s ease;
}
.hbs-navbar__mobileLink { padding: .8rem .25rem; text-decoration: none; color: var(--hbs-text); border-bottom: 1px solid var(--hbs-border); }
.hbs-navbar__mobileActions { display: flex; flex-direction: column; gap: .5rem; margin-top: 1rem; }

@media (max-width: 880px) {
    .hbs-navbar__links, .hbs-navbar__actions { display: none; }
    .hbs-navbar__hamburger { display: inline-flex; }
}

/* ───────────── Hero ───────────── */
.hero { padding: 4.5rem 0 3rem; }
.hero__row {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    grid-template-rows: auto auto auto;
    column-gap: 4rem;
    row-gap: 0;
    align-items: start;
}
.hero__eyebrow {
    grid-column: 1;
    grid-row: 1;
    align-self: end;
    margin-bottom: 1rem;
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .4rem .85rem; border-radius: 999px;
    background: rgba(46, 184, 203, .15); color: var(--hbs-primary-dark);
    font-weight: 600; font-size: .85rem;
}
.hero__copyBlock {
    grid-column: 1;
    grid-row: 2;
}
.hero__copyBlock h1 {
    font-size: clamp(2.2rem, 4vw, 3.4rem);
    margin: 0 0 1.2rem;
    letter-spacing: -.02em;
    line-height: 1.05;
}
.hero__copyBlock p { color: var(--hbs-muted); font-size: 1.1rem; max-width: 540px; margin: 0; }
.hero__cta {
    grid-column: 1;
    grid-row: 3;
    display: flex;
    gap: .8rem;
    margin-top: 1.8rem;
    flex-wrap: wrap;
    align-self: start;
}
.hero__stats { display: flex; gap: 2rem; margin-top: 2.5rem; flex-wrap: wrap; }
.hero__stats > div { display: flex; flex-direction: column; }
.hero__stats strong { font-size: 1.6rem; color: var(--hbs-primary-dark); }
.hero__stats span { color: var(--hbs-muted); font-size: .9rem; }

.hero__art {
    grid-column: 2;
    grid-row: 1 / 4;
    align-self: center;
    position: relative;
    justify-self: stretch;
}
.hero__phone {
    border-radius: var(--hbs-radius-lg); overflow: hidden;
    box-shadow: var(--hbs-shadow-lg);
    transform: rotate(-2deg);
    background: #fff;
    animation: hbs-float 6s ease-in-out infinite;
}
.hero__phone img { display: block; width: 100%; }
.hero__floatCard {
    position: absolute;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--hbs-radius);
    padding: .85rem 1.1rem;
    display: flex;
    align-items: center;
    gap: .8rem;
    box-shadow: var(--hbs-shadow-md);
    border: 1px solid rgba(255, 255, 255, .85);
    animation: hbs-float 5s ease-in-out infinite;
}
.hero__floatCard i {
    width: 38px; height: 38px; border-radius: 50%;
    display: grid; place-items: center;
    background: rgba(46, 184, 203, .15); color: var(--hbs-secondary);
}
.hero__floatCard strong { display: block; font-size: .95rem; }
.hero__floatCard small { color: var(--hbs-muted); }
.hero__floatCard--top { top: 8%; left: -6%; animation-delay: -1s; }
.hero__floatCard--bottom { bottom: 6%; right: -4%; animation-delay: -3s; }

@media (max-width: 900px) {
    .hero__row {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        row-gap: 1.25rem;
    }
    .hero__eyebrow {
        grid-column: 1;
        grid-row: 1;
        justify-self: center;
        text-align: center;
        margin-bottom: 0;
        align-self: start;
    }
    .hero__copyBlock { display: none; }
    .hero__art {
        grid-column: 1;
        grid-row: 2;
        grid-row-end: auto;
        max-width: min(340px, 94vw);
        margin: 0 auto;
        width: 100%;
    }
    .hero__cta {
        grid-column: 1;
        grid-row: 3;
        justify-content: center;
        margin-top: 0;
    }
    .hero__floatCard {
        padding: .65rem .85rem;
        gap: .55rem;
        font-size: .88rem;
    }
    .hero__floatCard i {
        width: 32px;
        height: 32px;
        font-size: .95rem;
    }
    .hero__floatCard--top { top: 6%; left: 2%; animation-delay: -1s; }
    .hero__floatCard--bottom { bottom: 5%; right: 2%; animation-delay: -3s; }
    .hero__phone {
        animation: hbs-float 6s ease-in-out infinite;
        transform: rotate(-2deg);
    }
}

@keyframes hbs-float {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-12px) rotate(-2deg); }
}
@keyframes hbs-fade-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes hbs-pop-in {
    0% { opacity: 0; transform: translateY(8px) scale(.98); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ───────────── Sections ───────────── */
.section__header { text-align: center; max-width: 720px; margin: 0 auto 2.5rem; }
.section__header--left { text-align: left; margin-left: 0; max-width: 720px; }
.section__eyebrow {
    display: inline-block; color: var(--hbs-secondary);
    font-weight: 600; text-transform: uppercase; letter-spacing: .12em; font-size: .8rem;
    margin-bottom: .5rem;
}
.section__header h1, .section__header h2 {
    font-size: clamp(1.8rem, 3vw, 2.5rem); letter-spacing: -.01em;
}
.section__header p { color: var(--hbs-muted); margin-top: .6rem; }

.features { padding: 4rem 0; background: #fff; }
.features__grid {
    display: grid; gap: 1.4rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.feature-card {
    padding: 1.75rem 1.35rem 1.6rem;
    border-radius: var(--hbs-radius-lg);
    background: linear-gradient(165deg, #fff 0%, #f8fafc 100%);
    border: 1px solid var(--hbs-border);
    text-align: center;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
    animation: hbs-pop-in .35s ease both;
}
.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--hbs-shadow-md);
    border-color: rgba(46, 184, 203, .35);
}
.feature-card__icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    margin: 0 auto 1.1rem;
    display: grid;
    place-items: center;
    font-size: 1.35rem;
    color: var(--hbs-primary-dark);
    background: rgba(255, 255, 255, .42);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, .75);
    box-shadow:
        0 10px 28px rgba(16, 94, 166, .1),
        inset 0 1px 0 rgba(255, 255, 255, .65);
}
.feature-card h3 { font-size: 1.1rem; margin-bottom: .35rem; }
.feature-card p { color: var(--hbs-muted); font-size: .95rem; }

/* ───────────── Cómo funciona (teléfono animado + pasos interactivos) ───────────── */
.section-spacing { padding: clamp(3rem, 6vw, 5rem) 0; }

.process-layout {
    display: flex;
    align-items: center;
    gap: clamp(2rem, 5vw, 5rem);
}

.phone-wrapper {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    perspective: 1000px;
}

.phone-device {
    width: 300px;
    height: 600px;
    background: #1e293b;
    border-radius: 45px;
    border: 5px solid #334155;
    position: relative;
    box-shadow: 0 40px 80px rgba(0, 0, 0, .2);
    z-index: 2;
    transform: rotateY(-10deg);
    transition: transform .5s ease;
}

.phone-device:hover { transform: rotateY(0deg); }

.phone-notch {
    width: 140px;
    height: 28px;
    background: #1e293b;
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 0 0 16px 16px;
    z-index: 10;
}

.phone-screen-content {
    width: 100%;
    height: 100%;
    border-radius: 38px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(to bottom, #eff6ff, #fff);
}

.app-slide {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1.25rem;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .5s ease, transform .5s ease;
}

.app-slide.active {
    opacity: 1;
    transform: translateY(0);
}

.app-slide h4 {
    margin: 0 0 .35rem;
    font-size: 1rem;
    color: var(--hbs-text);
}

.app-slide p {
    margin: 0;
    font-size: .9rem;
    color: var(--hbs-muted);
}

.app-icon {
    width: 88px;
    height: 88px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.35rem;
    color: var(--hbs-primary);
    box-shadow: 0 10px 20px rgba(16, 94, 166, .12);
    margin-bottom: 18px;
}

.steps-wrapper { flex: 1; }

.title-lg {
    font-size: clamp(1.85rem, 3vw, 2.45rem);
    color: var(--hbs-primary-dark);
    margin: 0 0 .5rem;
    font-weight: 700;
    letter-spacing: -.02em;
}

.subtitle-left {
    font-size: 1.05rem;
    color: var(--hbs-muted);
    margin: 0 0 2rem;
    line-height: 1.55;
}

.steps-list {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.step-card {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    padding: 1.35rem 1.25rem;
    background: var(--hbs-surface);
    border-radius: 20px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: background .3s ease, transform .3s ease, border-color .3s ease, box-shadow .3s ease;
}

.step-card:hover {
    background: rgba(255, 255, 255, .95);
    transform: translateX(8px);
}

.step-card.active {
    border-color: var(--hbs-accent);
    box-shadow: var(--hbs-shadow-md);
}

.step-number {
    font-size: 2.15rem;
    font-weight: 800;
    color: #e2e8f0;
    line-height: 1;
    flex-shrink: 0;
}

.step-card.active .step-number { color: var(--hbs-secondary); }

.step-info h3 {
    font-size: 1.05rem;
    margin: 0 0 .4rem;
    color: var(--hbs-text);
}

.step-info p {
    margin: 0;
    font-size: .92rem;
    color: var(--hbs-muted);
    line-height: 1.55;
}

.how__panel-link { margin: 1.75rem 0 0; }

.mobile-step-nav { display: none; }

@keyframes hbs-fade-step-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ───────────── Inscripción por pestañas (card unificada + tabs) ───────────── */
.cta.signup-tabs {
    background: transparent;
}

.services-unified-card {
    background: #fff;
    border-radius: var(--hbs-radius-lg);
    padding: 0;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, .04);
    box-shadow: var(--hbs-shadow-md);
    max-width: 950px;
    margin: 0 auto;
}

.signup-unified-card .unified-backdrop-icon {
    position: absolute;
    top: -28px;
    right: -36px;
    font-size: 12rem;
    color: var(--hbs-primary);
    opacity: .04;
    transform: rotate(12deg);
    pointer-events: none;
    transition: opacity .4s ease, transform .4s ease;
}

.signup-unified-card:hover .unified-backdrop-icon {
    opacity: .07;
    transform: rotate(0deg) scale(1.04);
}

.services-tabs {
    display: flex;
    position: relative;
    border-bottom: 2px solid #f1f5f9;
}

.service-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    padding: 1.15rem 1rem;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: .98rem;
    font-weight: 600;
    color: var(--hbs-muted);
    transition: color .25s ease, background .25s ease;
    position: relative;
    z-index: 1;
}

.service-tab:hover {
    color: var(--hbs-primary);
    background: rgba(16, 94, 166, .04);
}

.service-tab.active { color: var(--hbs-primary); }

.service-tab i {
    font-size: .95rem;
    transition: transform .3s ease;
}

.service-tab.active i { transform: scale(1.12); }

.tab-indicator {
    position: absolute;
    bottom: -2px;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--hbs-primary), var(--hbs-secondary));
    border-radius: 3px 3px 0 0;
    transition: transform .4s cubic-bezier(.4, 0, .2, 1), width .4s cubic-bezier(.4, 0, .2, 1);
    z-index: 2;
}

.tab-indicator--three {
    width: calc(100% / 3);
}

.tab-indicator--three.pos-0 { transform: translateX(0); }
.tab-indicator--three.pos-1 { transform: translateX(100%); }
.tab-indicator--three.pos-2 { transform: translateX(200%); }

.services-tab-contents {
    position: relative;
    min-height: 320px;
}

.tab-content {
    display: none;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    animation: hbs-fade-tab-in .45s ease forwards;
}

.tab-content.active { display: block; }

@keyframes hbs-fade-tab-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-content-grid {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: clamp(1.25rem, 3vw, 2.5rem);
    align-items: start;
}

.tab-content-info {
    display: flex;
    flex-direction: column;
    gap: .85rem;
}

.tab-badge {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .45rem 1rem;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 700;
    width: fit-content;
}

.premium-badge {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
}

.premium-badge i { color: #f59e0b; }

.free-badge {
    background: linear-gradient(135deg, #ccfbf1, #a7f3d0);
    color: #065f46;
}

.free-badge i { color: #10b981; }

.tab-content-info h3 {
    font-size: 1.45rem;
    color: var(--hbs-text);
    font-weight: 700;
    line-height: 1.25;
    margin: 0;
}

.tab-content-info p {
    color: var(--hbs-muted);
    font-size: .96rem;
    line-height: 1.65;
    margin: 0;
}

.tab-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    background: linear-gradient(135deg, var(--hbs-primary), var(--hbs-primary-dark));
    color: #fff;
    padding: .85rem 1.6rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    font-size: .94rem;
    box-shadow: var(--hbs-shadow-md);
    transition: transform .25s ease, box-shadow .25s ease;
    width: fit-content;
    margin-top: .35rem;
}

.tab-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--hbs-shadow-lg);
}

.tab-cta-free {
    background: linear-gradient(135deg, var(--hbs-secondary), var(--hbs-accent));
}

.tab-content-features {
    display: flex;
    flex-direction: column;
    gap: .85rem;
}

.tab-content .feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .95rem 1.1rem;
    background: #f8fafc;
    border-radius: 16px;
    transition: background .25s ease, border-color .25s ease, box-shadow .25s ease, transform .25s ease;
    border: 1px solid transparent;
}

.tab-content .feature-item:hover {
    background: #fff;
    border-color: rgba(16, 94, 166, .08);
    box-shadow: var(--hbs-shadow-sm);
    transform: translateX(4px);
}

.tab-content .feature-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.tab-content .feature-icon.color-blue {
    background: #e0f2fe;
    color: var(--hbs-primary);
}

.tab-content .feature-icon.color-cyan {
    background: #ccfbf1;
    color: var(--hbs-secondary);
}

.tab-content .feature-text h4 {
    font-size: .92rem;
    color: var(--hbs-text);
    font-weight: 600;
    margin: 0 0 .15rem;
}

.tab-content .feature-text p {
    font-size: .82rem;
    color: var(--hbs-muted);
    margin: 0;
    line-height: 1.4;
}

@media (max-width: 900px) {
    .process-layout {
        flex-direction: column;
        gap: 2rem;
    }

    .phone-wrapper { justify-content: center; }

    .phone-device {
        width: 248px;
        height: 496px;
        transform: rotateY(0deg);
        border-radius: 38px;
    }

    .phone-screen-content { border-radius: 32px; }

    .phone-notch {
        width: 112px;
        height: 22px;
    }

    .steps-wrapper { text-align: center; }

    .subtitle-left { text-align: center; }

    .steps-list {
        position: relative;
        gap: 0;
    }

    .step-card {
        display: none;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: .65rem;
        padding: 1.25rem;
        border: 2px solid var(--hbs-accent);
        box-shadow: var(--hbs-shadow-md);
        animation: hbs-fade-step-in .4s ease forwards;
    }

    .step-card.active { display: flex; }

    .step-card .step-number {
        font-size: 1.85rem;
        color: var(--hbs-secondary);
    }

    .mobile-step-nav {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 1rem;
        margin-top: 1.15rem;
    }

    .mobile-step-arrow {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        border: 2px solid var(--hbs-primary);
        background: #fff;
        color: var(--hbs-primary);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1rem;
        cursor: pointer;
        transition: background .2s ease, color .2s ease;
    }

    .mobile-step-arrow:hover {
        background: var(--hbs-primary);
        color: #fff;
    }

    .mobile-step-dots {
        display: flex;
        gap: 8px;
        align-items: center;
    }

.mobile-step-dot {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: #e2e8f0;
        transition: background .25s ease, width .25s ease;
        cursor: pointer;
        border: none;
        padding: 0;
        display: block;
    }

    .mobile-step-dot.active {
        background: var(--hbs-secondary);
        width: 26px;
        border-radius: 10px;
    }

    .how__panel-link { text-align: center; }

    .tab-content-grid { grid-template-columns: 1fr; }

    .service-tab {
        flex-direction: column;
        gap: .25rem;
        padding: .85rem .5rem;
        font-size: .82rem;
    }

    .service-tab span { line-height: 1.2; }

    .services-tab-contents { min-height: 0; }
}

@media (max-width: 480px) {
    .service-tab i { font-size: .9rem; }
}

/* ───────────── Footer ───────────── */
.hbs-footer { background: #0f172a; color: #cbd5e1; padding: 3.5rem 0 max(1.5rem, env(safe-area-inset-bottom)); margin-top: 4rem; }
.hbs-footer__grid {
    display: grid; gap: 2rem;
    grid-template-columns: 1.4fr repeat(3, 1fr);
}
.hbs-footer__brand img { width: 46px; margin-bottom: 1rem; }
.hbs-footer__brand p { font-size: .95rem; line-height: 1.6; }
.hbs-footer h4 { color: #fff; margin-bottom: .8rem; font-size: 1rem; letter-spacing: .04em; }
.hbs-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .45rem; }
.hbs-footer a { color: #cbd5e1; text-decoration: none; transition: color .15s ease; }
.hbs-footer a:hover { color: var(--hbs-accent); }
.hbs-footer__bottom {
    margin-top: 2.5rem; padding-top: 1.2rem; border-top: 1px solid rgba(255, 255, 255, .1);
    display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    font-size: .85rem; color: #94a3b8;
}
@media (max-width: 880px) {
    .hbs-footer__grid { grid-template-columns: 1fr 1fr; }
}

/* ───────────── Auth (login/registro/doctor login) ───────────── */
.auth-screen { background: #f1f5f9; }
.auth-grid {
    min-height: 100vh; display: grid;
    grid-template-columns: 1.1fr 1fr;
}
.auth-grid--register { grid-template-columns: 1fr 1.15fr; }
.auth-aside {
    position: relative; padding: 2.5rem; color: #fff;
    background-size: cover; background-position: center; background-color: var(--hbs-primary-dark);
    display: flex; flex-direction: column; justify-content: space-between;
    overflow: hidden;
}
.auth-aside::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(11, 69, 127, .85), rgba(46, 184, 203, .55));
}
.auth-aside > * { position: relative; z-index: 1; }
.auth-aside__brand { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.auth-aside__brand img { width: 42px; }
.auth-aside__copy h2 { font-size: clamp(1.6rem, 2.5vw, 2.4rem); letter-spacing: -.01em; }
.auth-aside__copy p { opacity: .92; margin-top: .6rem; }
.auth-aside__bullets { list-style: none; padding: 0; margin-top: 1.5rem; display: flex; flex-direction: column; gap: .7rem; }
.auth-aside__bullets i { color: var(--hbs-accent); margin-right: .4rem; }

.auth-panel {
    padding: 2.5rem clamp(1.5rem, 4vw, 3rem);
    display: flex; flex-direction: column; justify-content: center;
    background: #fff; min-height: 100vh;
}
.auth-panel--wide { padding: 2rem clamp(1.5rem, 4vw, 4rem); }
.auth-panel--doctor { background: #fff; }
.auth-panel__back {
    align-self: flex-start; color: var(--hbs-muted);
    text-decoration: none; margin-bottom: 1.5rem; font-size: .9rem;
}
.auth-panel__back i { margin-right: .3rem; }
.auth-panel__header { margin-bottom: 1.5rem; }
.auth-panel__header h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); letter-spacing: -.01em; }
.auth-panel__header p { color: var(--hbs-muted); margin-top: .3rem; }
.auth-panel__alt { margin-top: 1.2rem; color: var(--hbs-muted); font-size: .9rem; }
.auth-panel__alt a { color: var(--hbs-primary); font-weight: 600; }

.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.auth-form--two { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.2rem; }
.auth-form__field { display: flex; flex-direction: column; gap: .35rem; }
.auth-form__field--full { grid-column: 1 / -1; }
.auth-form__label { font-weight: 600; font-size: .9rem; color: var(--hbs-text); display: flex; align-items: center; gap: .4rem; }
.auth-form__field input,
.auth-form__field select,
.auth-form__field textarea {
    border: 1px solid var(--hbs-border); padding: .85rem 1rem; border-radius: 12px;
    font: inherit; transition: border-color .15s ease, box-shadow .15s ease;
    background: #fff; color: var(--hbs-text);
}
.auth-form__field input:focus,
.auth-form__field select:focus,
.auth-form__field textarea:focus {
    outline: none; border-color: var(--hbs-primary);
    box-shadow: 0 0 0 4px rgba(16, 94, 166, .12);
}
.auth-form__phone { display: flex; align-items: stretch; border: 1px solid var(--hbs-border); border-radius: 12px; overflow: hidden; }
.auth-form__phone input { border: none; flex: 1; }
.auth-form__phonePrefix {
    padding: .85rem 1rem; background: rgba(16, 94, 166, .08);
    color: var(--hbs-primary-dark); font-weight: 600;
}
.auth-form__password { position: relative; }
.auth-form__password input { width: 100%; padding-right: 3rem; }
.auth-form__toggle {
    position: absolute; right: .4rem; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer; color: var(--hbs-muted);
    padding: .4rem .6rem;
}
.auth-form__hint { padding: .8rem 1rem; border-radius: 12px; font-size: .9rem; }
.auth-form__hint.is-error { background: rgba(239, 68, 68, .1); color: var(--hbs-danger); }
.auth-form__hint.is-info { background: rgba(46, 184, 203, .12); color: var(--hbs-primary-dark); }
.auth-form__hint.is-ok { background: rgba(16, 185, 129, .12); color: var(--hbs-success); }
.auth-form__resend { background: none; border: none; color: var(--hbs-primary); cursor: pointer; font-weight: 600; }
.auth-form__step h2 { font-size: 1.2rem; margin-bottom: .25rem; }
.auth-form__step p { color: var(--hbs-muted); font-size: .9rem; }

.auth-otp { display: flex; gap: .55rem; justify-content: space-between; }
.auth-otp__cell {
    width: 48px; height: 56px; text-align: center; font-size: 1.4rem;
    border: 1px solid var(--hbs-border); border-radius: 12px; background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease, transform .1s ease;
}
.auth-otp__cell:focus {
    outline: none; border-color: var(--hbs-primary);
    box-shadow: 0 0 0 4px rgba(16, 94, 166, .15);
    transform: translateY(-1px);
}

@media (max-width: 880px) {
    .auth-grid, .auth-grid--register { grid-template-columns: 1fr; }
    .auth-aside { min-height: 220px; }
    .auth-form--two { grid-template-columns: 1fr; }
}

/* ───────────── Buscar (público) ───────────── */
.search { padding: 3rem 0 5rem; }
.search__filters {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: .8rem; align-items: end; padding: 1.2rem; border-radius: var(--hbs-radius);
    background: #fff; border: 1px solid var(--hbs-border); margin-bottom: 1.5rem;
}
.search__field { display: flex; flex-direction: column; gap: .35rem; }
.search__field label { font-weight: 600; font-size: .85rem; color: var(--hbs-text); }
.search__field input,
.search__field select {
    padding: .65rem .8rem; border-radius: 10px; border: 1px solid var(--hbs-border);
    background: #fff; font: inherit;
}
.search__results {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}
.search__empty {
    padding: 3rem 1.5rem; text-align: center;
    background: #fff; border-radius: var(--hbs-radius); border: 1px dashed var(--hbs-border);
    grid-column: 1 / -1;
    color: var(--hbs-muted);
}
.search__empty i { font-size: 1.8rem; display: block; margin-bottom: .6rem; color: var(--hbs-secondary); }

.doctor-card {
    background: #fff; border: 1px solid var(--hbs-border); border-radius: var(--hbs-radius);
    padding: 1.2rem; display: grid;
    grid-template-columns: 64px 1fr; grid-template-rows: auto auto;
    gap: 1rem; align-items: center;
    transition: transform .18s ease, box-shadow .18s ease;
    animation: hbs-pop-in .25s ease both;
}
.doctor-card:hover { transform: translateY(-3px); box-shadow: var(--hbs-shadow-md); }
.doctor-card__avatar {
    width: 64px; height: 64px; border-radius: 50%;
    background: linear-gradient(135deg, var(--hbs-primary), var(--hbs-secondary)); color: #fff;
    display: grid; place-items: center; font-weight: 700;
}
.doctor-card__name { font-size: 1.05rem; }
.doctor-card__specialty { color: var(--hbs-secondary); font-weight: 600; font-size: .9rem; }
.doctor-card__institution { color: var(--hbs-muted); font-size: .85rem; }
.doctor-card__meta { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .4rem; font-size: .8rem; color: var(--hbs-muted); }
.doctor-card__actions { grid-column: 1 / -1; display: flex; gap: .5rem; justify-content: flex-end; }

/* ───────────── Clinicas ───────────── */
.clinics { padding: 3rem 0 5rem; }
.clinics__grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}
.clinics__loading { color: var(--hbs-muted); }
.clinic-card {
    background: #fff; border: 1px solid var(--hbs-border); border-radius: var(--hbs-radius);
    padding: 1.4rem; display: flex; flex-direction: column; gap: .6rem;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    animation: hbs-pop-in .25s ease both;
}
.clinic-card:hover { transform: translateY(-3px); box-shadow: var(--hbs-shadow-md); border-color: rgba(46, 184, 203, .35); }
.clinic-card__icon {
    width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center;
    background: linear-gradient(135deg, rgba(16, 94, 166, .12), rgba(46, 184, 203, .14));
    color: var(--hbs-primary-dark);
}
.clinic-card__cta { align-self: flex-start; margin-top: .4rem; }

/* ───────────── Especialista ───────────── */
.doctor-profile { padding: 3rem 0 5rem; }
.doctor-profile__row { display: grid; grid-template-columns: 320px 1fr; gap: 2rem; }
.doctor-profile__card {
    background: #fff; border-radius: var(--hbs-radius); padding: 1.6rem;
    border: 1px solid var(--hbs-border); text-align: center;
    box-shadow: var(--hbs-shadow-sm);
}
.doctor-profile__avatar {
    width: 110px; height: 110px; border-radius: 50%;
    background: linear-gradient(135deg, var(--hbs-primary), var(--hbs-secondary)); color: #fff;
    display: grid; place-items: center; font-size: 2.2rem; margin: 0 auto 1rem;
}
.doctor-profile__info { list-style: none; padding: 0; margin-top: 1rem; display: flex; flex-direction: column; gap: .4rem; color: var(--hbs-muted); font-size: .9rem; }
.doctor-profile__main { background: #fff; border-radius: var(--hbs-radius); padding: 1.6rem; border: 1px solid var(--hbs-border); }
.doctor-profile__days { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.doctor-profile__day {
    padding: .55rem .9rem; border-radius: 999px; border: 1px solid var(--hbs-border);
    background: #fff; cursor: pointer; font-size: .9rem;
    transition: background .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
}
.doctor-profile__day:hover { transform: translateY(-1px); }
.doctor-profile__day.is-active {
    background: var(--hbs-primary); color: #fff; border-color: var(--hbs-primary);
}
.doctor-profile__slots {
    display: grid; gap: .5rem;
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
    margin-bottom: 1.2rem;
}
.doctor-profile__slot {
    padding: .65rem; border-radius: 10px; border: 1px solid var(--hbs-border);
    background: #fff; cursor: pointer; text-align: center;
    transition: border-color .15s ease, background .15s ease, transform .1s ease;
}
.doctor-profile__slot:hover { transform: translateY(-1px); border-color: var(--hbs-secondary); }
.doctor-profile__slot.is-active { background: var(--hbs-primary); color: #fff; border-color: var(--hbs-primary); }
.doctor-profile__slot:disabled { opacity: .4; cursor: not-allowed; }
.doctor-profile__empty { color: var(--hbs-muted); padding: 2rem 1rem; text-align: center; }

@media (max-width: 880px) {
    .doctor-profile__row { grid-template-columns: 1fr; }
}

/* ───────────── 404 ───────────── */
.not-found { padding: 5rem 0; }
.not-found__inner { text-align: center; max-width: 560px; margin: 0 auto; }
.not-found__code {
    display: inline-block; font-size: 6rem; font-weight: 800; line-height: 1;
    background: linear-gradient(135deg, var(--hbs-primary), var(--hbs-secondary));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.not-found__actions { display: flex; gap: .8rem; justify-content: center; margin-top: 1.5rem; flex-wrap: wrap; }

/* ═══════════════════════════════════════════════════════════════════════════
   Responsive global — mobile-first polish (safe areas, overflow, touch targets)
   ═══════════════════════════════════════════════════════════════════════════ */

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

.medicuan-body {
    overflow-x: hidden;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.hbs-navbar.is-scrolled {
    box-shadow: 0 8px 24px -12px rgba(15, 23, 42, .12);
}

.hbs-navbar__hamburger {
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    padding: .6rem;
}

.hbs-navbar__mobile {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

html.hbs-nav-open,
html.hbs-nav-open body {
    overflow: hidden;
}

.hbs-container {
    width: min(1200px, calc(100vw - max(1rem, env(safe-area-inset-left)) - max(1rem, env(safe-area-inset-right))));
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
}

.medicuan-main {
    min-height: calc(100vh - min(520px, 70vh));
}

/* Hero / secciones — menos padding en pantallas chicas */
@media (max-width: 640px) {
    .hero { padding: 2.25rem 0 2rem; }
    .hero__row { gap: 2rem; }
    .hero__copyBlock p { font-size: 1rem; }
    .features { padding: 2.5rem 0; }
    .cta.signup-tabs { padding: 0; }
    .section__header h1, .section__header h2 {
        font-size: clamp(1.45rem, 6vw, 2rem);
    }
    .search { padding: 2rem 0 3rem; }
    .clinics { padding: 2rem 0 3rem; }
    .doctor-profile { padding: 2rem 0 3rem; }
    .not-found { padding: 3rem 0; }
    .not-found__code { font-size: clamp(3rem, 18vw, 6rem); }
}

@media (max-width: 480px) {
    .hbs-navbar__row { padding: .65rem 0; gap: .6rem; }
    .hbs-navbar__brandText { font-size: 1.05rem; }
}

@media (max-width: 380px) {
    .features__grid {
        grid-template-columns: 1fr;
    }
}

/* Footer — una columna en móvil estrecho */
@media (max-width: 600px) {
    .hbs-footer__grid {
        grid-template-columns: 1fr;
    }
    .hbs-footer__bottom {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
}

/* Auth — panel usable en teclado virtual / pantallas cortas */
@media (max-width: 880px) {
    .auth-panel {
        min-height: auto;
        padding-top: max(1.25rem, env(safe-area-inset-top));
        padding-bottom: max(2rem, env(safe-area-inset-bottom));
    }
    .auth-aside {
        min-height: min(40vh, 280px);
        padding: 1.25rem max(1rem, env(safe-area-inset-left)) 1.25rem max(1rem, env(safe-area-inset-right));
    }
}

@media (max-width: 480px) {
    .auth-otp {
        flex-wrap: wrap;
        justify-content: center;
        gap: .4rem;
    }
    .auth-otp__cell {
        width: 42px;
        height: 50px;
        font-size: 1.15rem;
        flex: 0 0 calc((100% - 5 * 0.4rem) / 6);
        max-width: 52px;
    }
}

/* Buscar — filtros en columna y botón ancho completo */
@media (max-width: 520px) {
    .search__filters {
        grid-template-columns: 1fr;
    }
    .search__filters .hbs-btn {
        width: 100%;
        justify-content: center;
    }
}

.search__results {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

/* Tarjetas doctor — acciones apiladas en XS */
@media (max-width: 400px) {
    .doctor-card {
        grid-template-columns: 56px 1fr;
    }
    .doctor-card__avatar {
        width: 56px;
        height: 56px;
        font-size: .95rem;
    }
    .doctor-card__actions {
        flex-direction: column;
        align-items: stretch;
    }
    .doctor-card__actions .hbs-btn {
        width: 100%;
        justify-content: center;
    }
}

.doctor-profile__slots {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 76px), 1fr));
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
    .hero__phone { animation: none; transform: none; }
}
