/* =========================================================
   Lev Sistemas — Sistema de diseño v3
   Estética: oscura, tech, profesional. Mobile-first.
   ========================================================= */

:root {
    /* Paleta */
    --bg: #0b0f14;
    --bg-elev: #121821;
    --bg-elev-2: #18212d;
    --border: #223042;
    --text: #e6edf3;
    --text-muted: #aab8c9;
    --accent: #38dcf2;
    --accent-strong: #0ea5b7;
    --whatsapp: #25d366;
    --whatsapp-strong: #1ebe5a;
    --ok: #34d399;
    --header-bg: rgba(11, 15, 20, .6);

    /* Tipografía */
    --font: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;

    /* Espaciado y formas */
    --radius: 14px;
    --radius-sm: 10px;
    --gap: 1.25rem;
    --maxw: 1100px;
    --shadow: 0 10px 30px rgba(0, 0, 0, .45);
    --ring: 0 0 0 3px rgba(34, 211, 238, .35);
}

/* Tema claro */
:root[data-theme="light"] {
    --bg: #f4f7fb;
    --bg-elev: #ffffff;
    --bg-elev-2: #eef2f7;
    --border: #d6dee8;
    --text: #101720;
    --text-muted: #51617a;
    --accent: #0891b2;
    --accent-strong: #0e7490;
    --header-bg: rgba(255, 255, 255, .72);
    --shadow: 0 10px 30px rgba(15, 23, 42, .12);
    --ring: 0 0 0 3px rgba(8, 145, 178, .3);
}

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(1200px 600px at 50% -10%, rgba(34, 211, 238, .12), transparent 60%),
        var(--bg);
    color: var(--text);
    font-family: var(--font);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--accent);
    text-decoration: none;
}

:focus-visible {
    outline: none;
    box-shadow: var(--ring);
    border-radius: 8px;
}

/* ---------- Header / marca ---------- */
.site-header {
    width: 100%;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--header-bg);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-elev);
    color: var(--text);
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease, transform .15s ease;
}

.theme-toggle:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: .7rem;
}

.brand__logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
}

.brand__name {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: .02em;
    color: var(--text);
}

.brand__accent {
    color: var(--accent);
}

/* ---------- Navegación ---------- */
.site-nav {
    display: flex;
    gap: 1.4rem;
    align-items: center;
}

.site-nav a {
    color: var(--text);
    font-weight: 600;
    font-size: 1rem;
    padding: .3rem 0;
    border-bottom: 2px solid transparent;
    transition: color .15s ease, border-color .15s ease;
}

.site-nav a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-elev);
    color: var(--text);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

.nav-toggle:hover {
    border-color: var(--accent);
}

/* Las secciones no quedan tapadas por el header fijo al saltar con las anclas */
.hero,
.contact,
.services,
.about,
.contact-form {
    scroll-margin-top: 88px;
}

/* En celular el nav se colapsa en menú desplegable */
@media (max-width: 719px) {
    .nav-toggle {
        display: inline-flex;
    }

    .site-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: var(--bg-elev);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow);
        padding: .5rem 1.25rem 1rem;
        display: none;
    }

    .site-nav.is-open {
        display: flex;
    }

    .site-nav a {
        padding: .8rem 0;
        border-bottom: 1px solid var(--border);
    }

    .site-nav a:hover {
        border-bottom-color: var(--border);
    }
}

/* ---------- Layout principal ---------- */
.site-main {
    flex: 1;
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 2rem 1.25rem 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.section-title {
    font-size: clamp(1.6rem, 5vw, 2.4rem);
    font-weight: 800;
    text-align: center;
    letter-spacing: -.01em;
}

.section-subtitle {
    color: var(--text-muted);
    text-align: center;
    max-width: 46ch;
    margin: .5rem auto 0;
}

/* ---------- Inicio / hero ---------- */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: .75rem;
}

.hero__title {
    font-size: clamp(2rem, 6vw, 3rem);
    font-weight: 800;
    letter-spacing: -.01em;
    line-height: 1.1;
}

.hero__tagline {
    color: var(--text-muted);
    font-size: clamp(1rem, 2.6vw, 1.2rem);
    max-width: 44ch;
}

.hero__logo {
    width: clamp(150px, 42vw, 210px);
    height: auto;
    border-radius: 22px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

/* ---------- Aviso de disponibilidad ---------- */
.availability {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 1.1rem 1.4rem;
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius-sm);
    background: var(--bg-elev);
    color: var(--accent);
    text-align: center;
    font-weight: 800;
    font-size: clamp(1.15rem, 3.4vw, 1.55rem);
    line-height: 1.4;
    letter-spacing: -.01em;
    box-shadow: var(--shadow);
}

.availability--open {
    border-left-color: var(--ok);
}

/* ---------- Promoción (flyer en ventana) ----------
   z-index 90: por debajo del modal de registro (100), así si alguna vez
   coincidieran, el de registro queda arriba. */
.promo-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .72);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 90;
}

.promo-overlay[hidden] {
    display: none;
}

.promo-flyer {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    max-width: min(560px, 100%);
}

.promo-flyer__img {
    display: block;
    max-width: 100%;
    /* Deja aire para la X y el botón incluso con flyers verticales. */
    max-height: 78vh;
    width: auto;
    height: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.promo-flyer__acciones {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    flex-wrap: wrap;
}

.promo-flyer__cta {
    padding: .6rem 1.4rem;
    border-radius: 999px;
    background: var(--whatsapp);
    color: #06240f;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.promo-flyer__cta:hover {
    background: var(--whatsapp-strong);
}

/* La descarga es la acción principal: la promo se valida presentando el flyer. */
.promo-flyer__cta--descarga {
    background: #fff;
    color: #101720;
}

.promo-flyer__cta--descarga:hover {
    background: #e6edf3;
}

.promo-flyer__close {
    position: absolute;
    top: -.75rem;
    right: -.75rem;
    width: 2.25rem;
    height: 2.25rem;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: #101720;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.promo-flyer__close:focus-visible,
.promo-flyer__cta:focus-visible {
    outline: none;
    box-shadow: var(--ring);
}

@media (max-width: 560px) {
    .promo-flyer__close {
        /* Pegada al borde: en pantallas chicas afuera se cortaría. */
        top: .5rem;
        right: .5rem;
    }
}

/* ---------- Sección contacto ---------- */
.contact {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.cards {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--gap);
}

.card {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform .2s ease, border-color .2s ease;
}

.card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-strong);
}

.card__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}

.card__qr {
    width: 200px;
    height: 200px;
    border-radius: var(--radius-sm);
    background: #fff;
    padding: 8px;
}

.card__hint {
    font-size: .85rem;
    color: var(--text-muted);
}

.card__phone {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: .01em;
}

.card__promo {
    width: 100%;
    margin-top: .5rem;
    padding: .8rem 1rem;
    border: 1px dashed var(--accent);
    border-radius: var(--radius-sm);
    background: rgba(56, 220, 242, .07);
    font-size: .92rem;
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .6rem;
    text-align: center;
}

.card__promo-ok {
    color: var(--ok);
    font-weight: 700;
}

/* ---------- Botones ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .75rem 1.4rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 1rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn--whatsapp {
    background: var(--whatsapp);
    color: #04210f;
}

.btn--whatsapp:hover {
    background: var(--whatsapp-strong);
}

.btn--ghost {
    background: transparent;
    color: var(--accent);
    border-color: var(--border);
}

.btn--ghost:hover {
    border-color: var(--accent);
    background: rgba(34, 211, 238, .08);
}

/* ---------- Correo ---------- */
.email-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem 1rem;
    background: var(--bg-elev-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    flex-wrap: wrap;
    justify-content: center;
}

.email-chip__icon {
    width: 24px;
    height: 24px;
}

.email-chip__address {
    color: var(--text);
    font-weight: 600;
    word-break: break-all;
}

.email-chip__copy {
    /* Oculto en móvil: al tocar el correo se abre la app de mail (Gmail/Outlook).
       Se muestra desde tablet/desktop, donde suele usarse webmail y copiar es útil. */
    display: none;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-elev);
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
}

.email-chip__copy:hover {
    border-color: var(--accent);
    background: rgba(34, 211, 238, .08);
}

.email-chip__toast {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    background: var(--ok);
    color: #04210f;
    font-weight: 700;
    font-size: .85rem;
    padding: .35rem .8rem;
    border-radius: 8px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}

.email-chip__toast.is-visible {
    opacity: 1;
}

/* ---------- Transferencia (alias) ---------- */
.transfer,
.about {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.alias-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem 1rem;
    background: var(--bg-elev-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    flex-wrap: wrap;
    justify-content: center;
}

.alias-chip__label {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    font-weight: 700;
}

.alias-chip__value {
    color: var(--text);
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: .02em;
}

.alias-chip__copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-elev);
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
}

.alias-chip__copy:hover {
    border-color: var(--accent);
    background: rgba(34, 211, 238, .08);
}

.alias-chip__toast {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    background: var(--ok);
    color: #04210f;
    font-weight: 700;
    font-size: .85rem;
    padding: .35rem .8rem;
    border-radius: 8px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}

.alias-chip__toast.is-visible {
    opacity: 1;
}

/* ---------- Sobre mí ---------- */
.about__card {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow);
    max-width: 760px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
}

.about__intro {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.25rem;
}

.about__bio {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.about__avatar {
    flex-shrink: 0;
    width: 200px;
    aspect-ratio: 4 / 5;
    border-radius: 16px;
    background: var(--bg-elev-2);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.about__avatar-initials {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: .03em;
}

.about__avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.about__card p {
    color: var(--text-muted);
}

.about__card p strong {
    color: var(--text);
}

.about__subtitle {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--accent);
    font-weight: 700;
    margin-top: .5rem;
}

.about__list {
    margin: 0;
    padding-left: 1.15rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.tags {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    padding: 0;
    margin: 0;
}

.tags li {
    background: var(--bg-elev-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: .35rem .85rem;
    font-size: .85rem;
    color: var(--text);
}

.about__meta {
    font-size: .9rem;
}

.about__card .btn {
    align-self: flex-start;
    margin-top: .5rem;
}

/* ---------- Header: sesión de cliente ---------- */
.header-actions {
    display: flex;
    align-items: center;
    gap: .85rem;
}

.client-chip {
    font-size: .85rem;
    color: var(--text-muted);
}

.client-chip a {
    color: var(--accent);
}

/* ---------- Servicios y precios ---------- */
.services {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.service-card {
    text-align: left;
    align-items: flex-start;
}

.service-card__desc {
    color: var(--text-muted);
    font-size: .92rem;
}

.service-card__price {
    display: flex;
    align-items: baseline;
    gap: .6rem;
    margin-top: .25rem;
}

.service-card__old {
    text-decoration: line-through;
    color: var(--text-muted);
    font-size: .95rem;
}

.service-card__new {
    color: var(--accent);
    font-weight: 800;
    font-size: 1.3rem;
}

.service-card__consultar {
    color: var(--text-muted);
    font-weight: 700;
    font-size: 1.05rem;
    font-style: italic;
}

.btn--google {
    background: #fff;
    color: #1f1f1f;
    border: 1px solid var(--border);
}

.btn--google:hover {
    background: #f1f1f1;
}

/* ---------- Banner de bienvenida ---------- */
.welcome-banner {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: .9rem 1.2rem;
    border: 1px solid rgba(52, 211, 153, .4);
    background: rgba(52, 211, 153, .1);
    color: var(--ok);
    border-radius: var(--radius-sm);
    text-align: center;
    font-weight: 700;
}

/* ---------- Modal de registro ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 100;
}

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

.modal {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: 92vh;
    overflow-y: auto;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.75rem;
}

.modal__close {
    position: absolute;
    top: .7rem;
    right: .7rem;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-elev-2);
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
}

.modal__close:hover {
    color: var(--text);
    border-color: var(--accent);
}

.modal__title {
    font-size: 1.25rem;
    font-weight: 800;
    padding-right: 2rem;
    margin-bottom: 1rem;
}

.modal__tabs {
    display: flex;
    gap: .5rem;
    margin-bottom: 1rem;
}

.modal__tab {
    flex: 1;
    padding: .55rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-elev-2);
    color: var(--text-muted);
    font-weight: 700;
    cursor: pointer;
}

.modal__tab.is-active {
    background: var(--accent);
    color: #04222a;
    border-color: transparent;
}

/* El formulario dentro del modal no repite la "tarjeta" */
.modal .site-form {
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    max-width: none;
}

.modal__panel[hidden] {
    display: none;
}

/* ---------- Formulario de contacto ---------- */
.contact-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.site-form {
    width: 100%;
    max-width: 640px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
}

.site-form .field {
    display: flex;
    flex-direction: column;
    gap: .4rem;
}

.site-form .field > span {
    font-size: .85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.site-form input,
.site-form textarea {
    width: 100%;
    background: var(--bg-elev-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
    padding: .7rem .9rem;
    resize: vertical;
}

.site-form input:focus,
.site-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--ring);
}

.site-form__row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.form-privacy {
    font-size: .8rem;
    color: var(--text-muted);
}

.btn--primary {
    align-self: center;
    background: var(--accent);
    color: #04222a;
}

.btn--primary:hover {
    background: var(--accent-strong);
    color: #fff;
}

.form-alert {
    width: 100%;
    max-width: 640px;
    padding: .85rem 1.1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-weight: 600;
}

.form-alert--ok {
    color: var(--ok);
    border-color: rgba(52, 211, 153, .4);
    background: rgba(52, 211, 153, .08);
}

.form-alert--error {
    color: #fca5a5;
    border-color: rgba(248, 113, 113, .4);
    background: rgba(248, 113, 113, .08);
}

@media (min-width: 600px) {
    .site-form__row {
        grid-template-columns: 1fr 1fr;
    }
}

/* ---------- Footer ---------- */
.site-footer {
    width: 100%;
    padding: 1.25rem;
    border-top: 1px solid var(--border);
    background: var(--bg-elev);
    color: var(--text-muted);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    font-size: .9rem;
}

.site-footer__logo {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    opacity: .85;
}

/* =========================================================
   Responsive (mobile-first: se agrega a partir de tablet)
   ========================================================= */
@media (min-width: 600px) {
    /* En pantallas grandes (webmail) sí mostramos el botón de copiar */
    .email-chip__copy {
        display: inline-flex;
    }

    /* El avatar se ubica al lado del texto de la bio */
    .about__intro {
        flex-direction: row;
        align-items: flex-start;
        text-align: left;
    }
}

@media (min-width: 720px) {
    .cards {
        grid-template-columns: 1fr 1fr;
    }

    .site-main {
        padding-top: 3rem;
    }
}

@media (min-width: 1024px) {
    .brand__name {
        font-size: 1.5rem;
    }

    .card__qr {
        width: 220px;
        height: 220px;
    }
}

/* Accesibilidad: respeta preferencia de menos movimiento */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
