/**
 * Estilos del sitio público / demo.
 * Autor: Juan Morel (jcmorelm@mvisual.cl)
 */

:root {
    --font-sans: 'Roboto', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
    --primary: #0b6bcb;
    --primary-dark: #084a8c;
    --primary-deep: #062e58;
    --accent: #00a3c4;
    --surface: #ffffff;
    --surface-muted: #f3f7fb;
    --text: #122033;
    --text-muted: #5a6b7d;
    --border-soft: rgba(8, 74, 140, .1);
    --radius: .75rem;
    --radius-sm: .5rem;
    --shadow-sm: 0 2px 8px rgba(6, 46, 88, .06), 0 1px 2px rgba(6, 46, 88, .04);
    --shadow-md: 0 12px 32px rgba(6, 46, 88, .1), 0 2px 8px rgba(6, 46, 88, .05);
    --ease: cubic-bezier(.22, 1, .36, 1);
}

body.public-body {
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--surface-muted);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

.public-main {
    flex: 1;
}

/* ——— Banner demo ——— */
.demo-banner {
    background: linear-gradient(90deg, #062e58 0%, #0b6bcb 55%, #0089a8 100%);
    color: #fff;
    font-size: .8125rem;
    line-height: 1.45;
}

.demo-banner-inner {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .65rem 0;
}

.demo-banner-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    padding: .15rem .55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .18);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.demo-banner-text {
    color: rgba(255, 255, 255, .95);
}

.demo-banner-text a {
    color: #fff;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.demo-banner-text a:hover {
    color: #e8f7fc;
}

/* ——— Header ——— */
.public-header {
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-soft);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .8);
    z-index: 1020;
}

.public-brand {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    text-decoration: none;
    color: var(--text);
}

.public-brand:hover {
    color: var(--primary);
}

.public-brand-mark {
    width: 2.15rem;
    height: 2.15rem;
    border-radius: .55rem;
    background:
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .35), transparent 50%),
        linear-gradient(145deg, var(--primary) 0%, var(--primary-deep) 100%);
    box-shadow: 0 4px 12px rgba(11, 107, 203, .35);
    position: relative;
}

.public-brand-mark::after {
    content: '';
    position: absolute;
    inset: 28%;
    border: 2px solid rgba(255, 255, 255, .85);
    border-radius: 50%;
}

.public-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.public-brand-name {
    font-weight: 700;
    font-size: 1rem;
}

.public-brand-sub {
    font-size: .68rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: .02em;
    text-transform: uppercase;
}

.public-header .nav-link {
    font-size: .875rem;
    font-weight: 500;
    color: var(--text-muted);
    padding: .4rem .7rem;
    border-radius: var(--radius-sm);
    transition: color .2s var(--ease), background .2s var(--ease);
}

.public-header .nav-link:hover,
.public-header .nav-link:focus {
    color: var(--primary-dark);
    background: rgba(11, 107, 203, .06);
}

.public-nav-cta {
    border-radius: 999px !important;
    box-shadow: 0 4px 14px rgba(11, 107, 203, .28);
}

.public-nav-admin {
    color: var(--primary-dark) !important;
    font-weight: 600 !important;
    border: 1px solid rgba(11, 107, 203, .25);
    border-radius: 999px !important;
    padding: .35rem .85rem !important;
    background: rgba(11, 107, 203, .04);
}

.public-nav-admin:hover {
    background: rgba(11, 107, 203, .1) !important;
    border-color: var(--primary);
}

/* ——— Hero ——— */
.public-hero {
    position: relative;
    overflow: hidden;
    padding: 2.75rem 0 3rem;
    color: #fff;
}

.public-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 80% at 85% 20%, rgba(0, 163, 196, .35), transparent 55%),
        radial-gradient(ellipse 50% 60% at 10% 90%, rgba(11, 107, 203, .4), transparent 50%),
        linear-gradient(145deg, #041e3a 0%, #0b4f96 48%, #067a96 100%);
}

.public-hero-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .03) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, .55), transparent 90%);
    pointer-events: none;
}

.public-hero-bg::after {
    content: '';
    position: absolute;
    width: 28rem;
    height: 28rem;
    right: -8rem;
    top: -6rem;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .08);
    box-shadow: inset 0 0 0 40px rgba(255, 255, 255, .02);
    pointer-events: none;
}

.public-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .78);
    margin: 0;
}

.public-section .public-eyebrow {
    color: var(--primary);
}

.public-eyebrow-dot {
    width: .45rem;
    height: .45rem;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(0, 163, 196, .25);
    animation: public-pulse 2.2s var(--ease) infinite;
}

.public-hero-title {
    font-size: clamp(1.75rem, 4vw, 2.65rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -.02em;
}

.public-hero-accent {
    background: linear-gradient(90deg, #7ee0f5, #fff 55%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.public-hero-lead {
    font-size: 1.05rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, .88);
    max-width: 36rem;
}

.public-hero-lead strong {
    color: #fff;
}

.public-hero-note {
    font-size: .8rem;
    color: rgba(255, 255, 255, .65);
}

.public-hero-note a {
    color: #fff;
    font-weight: 600;
}

.public-btn-glow {
    border: 0;
    background: #fff;
    color: var(--primary-deep);
    font-weight: 600;
    border-radius: 999px;
    padding-inline: 1.35rem;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .22);
    transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}

.public-btn-glow:hover {
    background: #f0f9ff;
    color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .28);
}

.public-btn-ghost {
    border-radius: 999px;
    border-color: rgba(255, 255, 255, .45);
    color: #fff;
    font-weight: 500;
    padding-inline: 1.25rem;
}

.public-btn-ghost:hover {
    background: rgba(255, 255, 255, .12);
    border-color: #fff;
    color: #fff;
}

.public-hero-panel {
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .18);
    backdrop-filter: blur(12px);
    border-radius: 1rem;
    padding: 1.35rem 1.4rem;
    box-shadow: var(--shadow-md);
    animation: public-rise .7s var(--ease) both;
}

.public-hero-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .85rem;
}

.public-pill {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: .25rem .6rem;
    border-radius: 999px;
    background: rgba(0, 200, 150, .2);
    color: #9ff0d0;
    border: 1px solid rgba(159, 240, 208, .35);
}

.public-pill::before {
    content: '';
    width: .4rem;
    height: .4rem;
    border-radius: 50%;
    background: #5dffb8;
    box-shadow: 0 0 8px #5dffb8;
}

.public-hero-panel-brand {
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .7);
}

.public-hero-panel h2 {
    color: #fff;
}

.public-checklist {
    list-style: none;
    padding: 0;
    margin: 0;
}

.public-checklist li {
    position: relative;
    padding: .4rem 0 .4rem 1.5rem;
    font-size: .875rem;
    color: rgba(255, 255, 255, .88);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.public-checklist li:last-child {
    border-bottom: 0;
}

.public-checklist li::before {
    content: '';
    position: absolute;
    left: 0;
    top: .7rem;
    width: .7rem;
    height: .7rem;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 163, 196, .25);
}

/* ——— Secciones ——— */
.public-section {
    padding: 2.5rem 0;
}

.public-section-muted {
    background: #fff;
    border-block: 1px solid var(--border-soft);
}

.public-section-demo {
    padding-top: 0;
    margin-top: -1.25rem;
    position: relative;
    z-index: 2;
}

.public-section-head {
    max-width: 36rem;
}

.public-section-title {
    font-size: clamp(1.25rem, 2.5vw, 1.65rem);
    font-weight: 700;
    letter-spacing: -.015em;
    color: var(--text);
    margin-bottom: .35rem;
}

.public-section-lead {
    color: var(--text-muted);
    font-size: .95rem;
}

.public-demo-callout {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    background: #fff;
    border: 1px solid rgba(11, 107, 203, .15);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    box-shadow: var(--shadow-sm);
}

.public-demo-callout-icon {
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: .85rem;
    font-weight: 700;
    font-style: italic;
    display: grid;
    place-items: center;
}

.public-demo-callout a {
    color: var(--primary-dark);
    font-weight: 600;
}

.public-feature {
    height: 100%;
    background: #fff;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 1.1rem 1rem;
    box-shadow: var(--shadow-sm);
    transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
}

.public-feature:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: rgba(11, 107, 203, .22);
}

.public-feature-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: .55rem;
    display: grid;
    place-items: center;
    margin-bottom: .65rem;
    font-size: .8rem;
    font-weight: 700;
    color: var(--primary-dark);
    background: linear-gradient(145deg, rgba(11, 107, 203, .12), rgba(0, 163, 196, .1));
}

.public-card,
.public-card-branch {
    background: #fff;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: box-shadow .2s var(--ease), transform .2s var(--ease);
}

.public-card-branch {
    padding: 1.15rem 1.2rem;
}

.public-card-branch:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.public-page-head {
    margin-bottom: 1.25rem;
}

.public-page-head .public-eyebrow {
    color: var(--primary);
}

/* ——— CTA band ——— */
.public-cta-band {
    padding: 0 0 2.75rem;
}

.public-cta-inner {
    background:
        radial-gradient(ellipse 60% 80% at 100% 0%, rgba(0, 163, 196, .35), transparent 50%),
        linear-gradient(135deg, var(--primary-deep) 0%, var(--primary) 55%, #067a96 100%);
    color: #fff;
    border-radius: 1.15rem;
    padding: 2.25rem 1.5rem;
    box-shadow: var(--shadow-md);
}

.public-cta-inner .public-eyebrow {
    color: rgba(255, 255, 255, .8);
}

.public-cta-lead {
    color: rgba(255, 255, 255, .85);
    max-width: 28rem;
    margin-inline: auto;
}

.public-cta-note {
    color: rgba(255, 255, 255, .7);
}

.public-cta-note a {
    color: #fff;
    font-weight: 600;
}

.public-cta-inner .btn-light {
    border-radius: 999px;
    font-weight: 600;
    padding-inline: 1.5rem;
    color: var(--primary-deep);
}

/* ——— Botones Bootstrap override ——— */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-outline-primary {
    color: var(--primary-dark);
    border-color: rgba(11, 107, 203, .45);
}

.btn-outline-primary:hover {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* ——— Formularios / páginas internas ——— */
.public-form-card {
    background: #fff;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.35rem;
}

.public-table-wrap {
    background: #fff;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.public-table-wrap .table {
    margin-bottom: 0;
}

.public-table-wrap thead th {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--text-muted);
    background: var(--surface-muted);
    border-bottom-color: var(--border-soft);
}

/* ——— Footer ——— */
.public-footer {
    background: var(--primary-deep);
    color: rgba(255, 255, 255, .78);
    padding: 2rem 0 1.25rem;
    margin-top: 0;
}

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

@media (min-width: 768px) {
    .public-footer-grid {
        grid-template-columns: 1.4fr 1fr 1fr;
        align-items: start;
    }
}

.public-footer-brand {
    font-weight: 700;
    color: #fff;
    font-size: 1.05rem;
    margin-bottom: .25rem;
}

.public-footer-muted {
    color: rgba(255, 255, 255, .6);
    font-size: .85rem;
}

.public-footer-links {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.public-footer-links a {
    color: rgba(255, 255, 255, .8);
    text-decoration: none;
    font-size: .875rem;
    font-weight: 500;
    width: fit-content;
}

.public-footer-links a:hover {
    color: #fff;
    text-decoration: underline;
}

.public-footer-label {
    display: block;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: rgba(255, 255, 255, .5);
    margin-bottom: .4rem;
}

.public-mvisual-badge {
    display: inline-flex;
    align-items: center;
    padding: .4rem .9rem;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .06));
    border: 1px solid rgba(255, 255, 255, .22);
    color: #fff !important;
    font-weight: 700;
    font-size: .95rem;
    letter-spacing: .04em;
    text-decoration: none !important;
    transition: background .2s var(--ease), transform .2s var(--ease);
}

.public-mvisual-badge:hover {
    background: rgba(255, 255, 255, .2);
    transform: translateY(-1px);
    color: #fff !important;
}

.public-footer-bottom {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, .1);
    font-size: .75rem;
    color: rgba(255, 255, 255, .45);
    text-align: center;
}

/* ——— Animaciones ——— */
@keyframes public-pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(0, 163, 196, .2); }
    50% { box-shadow: 0 0 0 6px rgba(0, 163, 196, .08); }
}

@keyframes public-rise {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.public-hero .col-lg-7 {
    animation: public-rise .6s var(--ease) both;
}

@media (prefers-reduced-motion: reduce) {
    .public-eyebrow-dot,
    .public-hero .col-lg-7,
    .public-hero-panel,
    .public-feature,
    .public-card-branch,
    .public-btn-glow,
    .public-mvisual-badge {
        animation: none !important;
        transition: none !important;
    }
}

/* ——— Móvil ——— */
@media (max-width: 575.98px) {
    .demo-banner-inner {
        flex-direction: column;
        gap: .4rem;
        padding: .55rem 0;
    }

    .public-hero {
        padding: 2rem 0 2.25rem;
    }

    .public-hero-actions .btn {
        width: 100%;
    }

    .public-nav-admin {
        margin-top: .35rem;
        text-align: center;
    }
}
