/* ClickPromo · estilos base · mobile-first
   Diseño 100% móvil. Fondo claro, botones oscuros,
   textos grandes, lectura cómoda. */

:root {
    --bg:          #ffffff;
    --bg-muted:    #f3f4f6;
    --bg-elev:     #ffffff;
    --border:      #e5e7eb;
    --text:        #1a1a1a;
    --text-soft:   #4b5563;
    --text-muted:  #6b7280;
    --accent:      #e53935;
    --accent-dark: #b71c1c;
    --button-bg:   #1a1a1a;
    --button-text: #ffffff;
    --shadow:      0 2px 8px rgba(0, 0, 0, 0.06);
    --radius:      12px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg-muted);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 19px;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
}

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

a { color: var(--text); }

/* --- Cabecera --- */
.cabecera {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.logo-link { display: inline-block; line-height: 0; }
.logo { height: 56px; width: auto; }
.cabecera-nav {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
}
.cab-link {
    color: var(--text-soft);
    text-decoration: none;
    font-size: 15px;
    padding: 8px 10px;
    border-radius: 8px;
    line-height: 1;
}
.cab-link:hover { background: var(--bg-muted); }
.cab-link-soft { color: var(--text-muted); }
.cab-link-cta {
    background: var(--button-bg);
    color: var(--button-text);
    font-weight: 600;
}
.cab-link-cta:hover { background: #000; }

/* --- Contenido --- */
.contenido {
    max-width: 480px;
    margin: 0 auto;
    padding: 14px 16px 24px;
}

/* --- Tipografía --- */
h1 { font-size: 26px; line-height: 1.25; margin: 0 0 10px; font-weight: 800; }
h2 { font-size: 22px; line-height: 1.3;  margin: 0 0 8px;  font-weight: 700; }
h3 { font-size: 19px; line-height: 1.3;  margin: 0 0 6px;  font-weight: 700; }
p  { margin: 0 0 10px; }

.texto-soft  { color: var(--text-soft); }
.texto-muted { color: var(--text-muted); font-size: 16px; }

/* --- Tarjeta --- */
.tarjeta {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}

/* --- Botones --- */
.btn {
    display: inline-block;
    width: 100%;
    background: var(--button-bg);
    color: var(--button-text);
    font-size: 19px;
    font-weight: 700;
    padding: 16px 20px;
    border: none;
    border-radius: var(--radius);
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
}
.btn:active { opacity: 0.85; }

.btn-acento { background: var(--accent); }
.btn-acento:active { background: var(--accent-dark); }

.btn-secundario {
    background: transparent;
    color: var(--text);
    border: 2px solid var(--button-bg);
}

.btn-peligro {
    background: transparent;
    color: #b32020;
    border: 2px solid #b32020;
}
.btn-peligro:active { background: rgba(179, 32, 32, 0.08); }

.btn + .btn { margin-top: 10px; }

.contador {
    font-size: 18px;
    text-align: center;
    margin: 8px 0 0;
}
.contador strong { color: var(--accent); }

/* --- Formularios --- */
label {
    display: block;
    font-weight: 700;
    font-size: 19px;
    margin-bottom: 8px;
    color: var(--text);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    font-size: 19px;
    padding: 16px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
}
input:focus, textarea:focus, select:focus {
    outline: 2px solid var(--button-bg);
    outline-offset: -1px;
}
textarea { min-height: 96px; resize: vertical; }

.campo  { margin-bottom: 16px; }
.ayuda  { font-size: 16px; color: var(--text-soft); margin-top: 8px; line-height: 1.4; }

/* --- Mensajes --- */
.mensaje {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 12px;
    font-size: 16px;
}
.mensaje-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.mensaje-ok    { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.mensaje-aviso { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* --- Pie --- */
.pie {
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
    padding: 18px 16px 28px;
}
.pie-enlace { color: var(--text-muted); text-decoration: none; }
.pie-enlace:hover { color: var(--text); text-decoration: underline; }

/* --- Precio destacado --- */
.precio {
    font-size: 32px;
    font-weight: 800;
    color: var(--accent);
    line-height: 1.1;
}

/* --- Utilidades --- */
.centro { text-align: center; }
.mb-0 { margin-bottom: 0; }
.mt-12 { margin-top: 12px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }

.enlace-discreto {
    color: var(--text-soft);
    text-decoration: underline;
    font-size: 14px;
}
.enlace-discreto:hover { color: var(--text); }

/* ===== Landing ===== */
.hero {
    text-align: center;
    padding: 6px 0 14px;
}
.hero h1 {
    font-size: 26px;
    line-height: 1.2;
    margin-bottom: 6px;
}
.hero-sub {
    color: var(--text-soft);
    font-size: 16px;
    margin: 0;
}

.btn-grande {
    font-size: 21px;
    padding: 19px 20px;
}

.seccion-titulo {
    margin: 22px 0 10px;
    text-align: center;
}

.paso {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 10px;
    box-shadow: var(--shadow);
}
.paso-num {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--button-bg);
    color: #fff;
    font-weight: 800;
    font-size: 19px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.paso h3 { margin-bottom: 4px; }
.paso p { margin-bottom: 0; }

/* ===== Formulario "Crear" ===== */
.producto {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    margin: 0 0 12px;
    box-shadow: var(--shadow);
}
.producto-titulo {
    font-weight: 800;
    font-size: 24px;
    color: var(--text);
    padding: 0 0 8px;
    margin-bottom: 14px;
    border-bottom: 2px solid var(--border);
    width: 100%;
    letter-spacing: -0.3px;
}
.producto-oculto { display: none; }

.fotos-fila {
    display: flex;
    gap: 8px;
}
.foto-input {
    flex: 1;
    cursor: pointer;
    margin-bottom: 0;
    font-weight: 400;
    position: relative;
}
.foto-input input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}
.foto-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    border: 2px dashed var(--border);
    border-radius: 10px;
    background: var(--bg-muted);
    color: var(--text-muted);
    overflow: hidden;
    position: relative;
}
.foto-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.foto-icono {
    font-size: 26px;
    line-height: 1;
    color: var(--text-soft);
    margin-bottom: 2px;
}
.foto-label { font-size: 13px; }
.foto-cargada {
    border-style: solid;
    border-color: var(--button-bg);
}
.foto-quitar {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 13px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
.foto-quitar:hover,
.foto-quitar:focus { background: rgba(0, 0, 0, 0.85); }

.foto-rotar {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 13px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
.foto-rotar:hover,
.foto-rotar:focus { background: rgba(0, 0, 0, 0.85); }

.foto-procesando {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}
.foto-procesando::after {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: 28px;
    height: 28px;
    border: 3px solid rgba(0, 0, 0, 0.18);
    border-top-color: var(--button-bg);
    border-radius: 50%;
    animation: cp-spin 0.8s linear infinite;
}
@keyframes cp-spin { to { transform: rotate(360deg); } }

.btn-camara {
    display: flex;
    width: -moz-fit-content;
    width: fit-content;
    max-width: 100%;
    margin: 14px auto 4px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    font-size: 19px;
    font-weight: 700;
    background: linear-gradient(135deg, #fbbf24, #f97316);
    color: #ffffff;
    border: none;
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.32);
}
.btn-camara::before {
    content: '\1F4F7';
    font-size: 20px;
}
.btn-camara:active {
    background: linear-gradient(135deg, #f59e0b, #ea580c);
    box-shadow: 0 2px 6px rgba(249, 115, 22, 0.40);
}
.camara-oculta {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

#btn-anadir-producto {
    margin-top: 6px;
    background: #1a1a1a;
    color: #ffffff;
    border: none;
}
#btn-anadir-producto:active {
    background: #000000;
    opacity: 1;
}
.btn-anadir {
    background: #1a1a1a;
    color: #ffffff;
    border: none;
}

/* ===== Pantalla "Creada" ===== */
.exito {
    text-align: center;
    padding: 6px 0;
}
.exito h1 { margin-bottom: 4px; }
.exito-marca {
    display: inline-block;
    background: #065f46;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.enlace-publico {
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    font-family: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
    font-size: 14px;
    word-break: break-all;
    margin-bottom: 8px;
}

/* ===== Stepper (1·2·3) ===== */
.pasos {
    display: flex;
    list-style: none;
    margin: 0 -16px 14px;
    padding: 10px 16px;
    gap: 6px;
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg-muted);
}
.paso-item {
    flex: 1;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    padding: 8px 4px;
    background: var(--bg-muted);
    border-radius: 8px;
    border: 1px solid var(--border);
}
.paso-completado {
    color: #065f46;
    background: #ecfdf5;
    border-color: #a7f3d0;
}
.paso-actual {
    color: #fff;
    background: var(--button-bg);
    border-color: var(--button-bg);
}

/* ===== Vista pública del producto ===== */
.previa-marco {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 12px;
    background: var(--bg-elev);
    margin-bottom: 6px;
}

.promo-titulo {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    margin: 4px 0 14px;
}

.producto-publico {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}

.producto-publico-titulo {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.2;
    margin: 6px 0 4px;
}

.producto-publico-desc {
    color: var(--text-soft);
    font-size: 16px;
    margin: 6px 0 0;
}

.producto-publico .precio {
    margin: 4px 0;
}

.galeria {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
    scrollbar-width: thin;
}
.galeria::-webkit-scrollbar { height: 4px; }
.galeria::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.galeria-foto {
    flex: 0 0 100%;
    scroll-snap-align: center;
    aspect-ratio: 4 / 3;
    background: var(--bg-muted);
    border-radius: 10px;
    overflow: hidden;
}
.galeria-foto img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.galeria-nota {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin: 6px 0 0;
}

/* ===== CTA suscripción ===== */
/* (estilos completos abajo en "Bloque CTA post-compartir") */

.texto-ahorro {
    display: inline-block;
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    border-radius: 999px;
    padding: 1px 8px;
    font-size: 13px;
    font-weight: 700;
    margin-left: 4px;
    vertical-align: middle;
}

/* ===== Landing nueva (formulario inline) ===== */
.hero-landing {
    position: relative;
    text-align: center;
    padding: 24px 12px 28px;
    background:
        radial-gradient(circle at 15% 0%, rgba(251, 191, 36, 0.18), transparent 55%),
        radial-gradient(circle at 85% 100%, rgba(229, 57, 53, 0.14), transparent 60%);
    border-radius: var(--radius);
    margin-bottom: 18px;
    overflow: hidden;
}
.hero-landing h1 {
    font-size: 32px;
    line-height: 1.15;
    margin: 4px 8px 10px;
    font-weight: 800;
    letter-spacing: -0.5px;
}
.hero-landing .hero-sub {
    margin-bottom: 6px;
    font-size: 17px;
}
.hero-tip {
    color: var(--text-muted);
    font-size: 15px;
    margin: 0;
}

/* Animación: el H1 cae de arriba a su sitio */
.hero-titulo-anim {
    animation: cp-titulo-caida 0.95s cubic-bezier(0.18, 0.89, 0.32, 1.28) both;
}
@keyframes cp-titulo-caida {
    0%   { opacity: 0; transform: translateY(-160%) scale(0.92); }
    55%  { opacity: 1; transform: translateY(8%)    scale(1.03); }
    78%  {              transform: translateY(-3%)  scale(0.99); }
    100% {              transform: translateY(0)    scale(1);    }
}
@media (prefers-reduced-motion: reduce) {
    .hero-titulo-anim { animation: none; }
}

.hero-flecha {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fbbf24, #f97316);
    border: none;
    color: #ffffff;
    font-size: 28px;
    font-weight: 800;
    text-decoration: none;
    margin-top: 14px;
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.40);
    position: relative;
    animation: cp-flecha-pulse 1.6s ease-in-out infinite;
}
.hero-flecha::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid rgba(249, 115, 22, 0.45);
    animation: cp-flecha-anillo 1.6s ease-out infinite;
}
.hero-flecha-icono {
    display: inline-block;
    animation: cp-flecha-bote 1.4s ease-in-out infinite;
    line-height: 1;
}
@keyframes cp-flecha-pulse {
    0%, 100% { transform: scale(1);    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.40); }
    50%      { transform: scale(1.06); box-shadow: 0 12px 30px rgba(249, 115, 22, 0.55); }
}
@keyframes cp-flecha-anillo {
    0%   { transform: scale(0.85); opacity: 0.85; }
    100% { transform: scale(1.45); opacity: 0;    }
}
@keyframes cp-flecha-bote {
    0%, 100% { transform: translateY(0);  }
    50%      { transform: translateY(5px); }
}
@media (prefers-reduced-motion: reduce) {
    .hero-flecha,
    .hero-flecha::before,
    .hero-flecha-icono { animation: none; }
}

/* Avisos flotantes (tooltip dinámico al focus) */
.cp-tip {
    position: fixed;
    z-index: 1000;
    background: #1a1a1a;
    color: #fff;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.35;
    max-width: 280px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}
.cp-tip.visible {
    opacity: 1;
    transform: translateY(0);
}
.cp-tip::after {
    content: '';
    position: absolute;
    top: -6px;
    left: 16px;
    border: 6px solid transparent;
    border-top: 0;
    border-bottom-color: #1a1a1a;
}
.cp-tip.abajo::after {
    top: auto;
    bottom: -6px;
    border-top: 6px solid #1a1a1a;
    border-bottom: 0;
}

/* ===== Pista de éxito al rellenar (callout grande) ===== */
.campo .pista-ok {
    display: none;
    align-items: flex-start;
    gap: 12px;
    margin-top: 10px;
    padding: 12px 14px;
    background: linear-gradient(180deg, #ecfdf5, #d1fae5);
    color: #064e3b;
    border-left: 5px solid #10b981;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.18);
}
.campo.ok .pista-ok { display: flex; }
.campo.ok .pista-ok.animar {
    animation: cp-callout-in 0.45s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
@keyframes cp-callout-in {
    0%   { opacity: 0; transform: translateY(-6px) scale(0.96); }
    60%  { opacity: 1; transform: translateY(0) scale(1.02); }
    100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
    .campo.ok .pista-ok.animar { animation: none; }
}

.pista-tick {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #10b981;
    position: relative;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.4);
}
.pista-tick::after {
    content: '';
    position: absolute;
    top: 7px;
    left: 9px;
    width: 7px;
    height: 12px;
    border: solid #fff;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}
/* ===== Pista de error al rellenar (callout rojo) ===== */
.campo .pista-error {
    display: none;
    align-items: flex-start;
    gap: 12px;
    margin-top: 10px;
    padding: 12px 14px;
    background: linear-gradient(180deg, #fef2f2, #fee2e2);
    color: #7f1d1d;
    border-left: 5px solid #ef4444;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.18);
}
.campo.ko .pista-error { display: flex; }
.campo.ko .pista-error.animar {
    animation: cp-callout-in 0.35s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
.campo.ko input {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}
.pista-cruz {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #ef4444;
    position: relative;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
}
.pista-cruz::before,
.pista-cruz::after {
    content: '';
    position: absolute;
    top: 13px;
    left: 7px;
    width: 14px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
}
.pista-cruz::before { transform: rotate(45deg); }
.pista-cruz::after  { transform: rotate(-45deg); }

.pista-texto {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    color: #065f46;
    line-height: 1.35;
    align-self: center;
}

/* Botón "Llamar" en página pública */
.btn-llamar { margin-top: 12px; }

/* Botón discreto "Preguntar por este producto" bajo cada producto */
.btn-contactar-prod {
    display: inline-block;
    width: auto;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 999px;
}

/* ===== Panel admin ===== */
.admin-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 8px 12px;
    margin: -4px -16px 12px;
    background: #f9fafb;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.admin-bar > a { color: var(--text-soft); text-decoration: none; }
.admin-bar > a:hover { color: var(--text); text-decoration: underline; }

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 10px 0 6px;
}
.kpi-grid-5 {
    grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 640px) {
    .kpi-grid-5 { grid-template-columns: repeat(5, 1fr); }
}
.kpi {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 8px;
    box-shadow: var(--shadow);
}
.kpi-num { font-size: 26px; font-weight: 800; color: var(--text); line-height: 1; }
.kpi-lab { font-size: 12px; color: var(--text-muted); margin-top: 4px; text-align: center; }

.tabla-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
.tabla {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: var(--bg-elev);
}
.tabla th, .tabla td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}
.tabla th {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    background: #f9fafb;
}
.tabla td.num, .tabla th.num { text-align: right; }
.tabla small { font-size: 13px; color: var(--text-soft); }

.badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.badge-activa    { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.badge-caducada  { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.badge-eliminada { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.badge-cortesia  { background: #ede9fe; color: #5b21b6; border: 1px solid #ddd6fe; margin-left: 4px; }

.timeline { list-style: none; padding: 0; margin: 8px 0; }
.timeline li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.timeline-tipo {
    font-size: 12px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    background: #eef2ff;
    color: #3730a3;
    min-width: 160px;
    text-align: center;
}
.timeline-vista        { background: #f3f4f6; color: #374151; }
.timeline-share_wa     { background: #dcfce7; color: #166534; }
.timeline-share_otros  { background: #ecfeff; color: #0e7490; }
.timeline-contact_wa   { background: #fef9c3; color: #854d0e; }
.timeline-contact_call { background: #fee2e2; color: #991b1b; }
.timeline-meta { font-size: 13px; color: var(--text-muted); }

.btn-link-peligro {
    background: none;
    border: 0;
    color: #b91c1c;
    font-size: 13px;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
}
.btn-link-peligro:hover { color: #7f1d1d; }

/* --- Planes de suscripción --- */
.planes-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 12px;
}
.plan-tarjeta {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
}
.plan-tarjeta-destacada {
    border-color: var(--accent);
    border-width: 2px;
}
.plan-precio {
    font-size: 32px;
    font-weight: 800;
    margin: 8px 0;
    line-height: 1;
    color: var(--text);
}
.plan-precio span {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-muted);
    margin-left: 4px;
}

/* --- Lista de promos en mi-cuenta --- */
.lista-promos {
    list-style: none;
    padding: 0;
    margin: 0;
}
.lista-promo {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: var(--shadow);
}
.lista-promo-caducada { opacity: 0.7; }
.lista-promo-acciones .btn {
    width: auto;
    padding: 8px 14px;
    font-size: 15px;
    margin: 0;
}

.texto-aviso { color: #92400e; }

/* --- Campo de contraseña con ojo de mostrar/ocultar --- */
.campo-pass { position: relative; }
.campo-pass input { padding-right: 48px; width: 100%; }
.campo-pass-ojo {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    background: none;
    border: 0;
    padding: 8px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}
.campo-pass-ojo:hover { color: var(--text); background: var(--bg-muted); }
.campo-pass-ojo:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* --- Bloque CTA post-compartir (versión destacada) --- */
.tarjeta-cta {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    border: 2px solid #fed7aa;
    background:
        radial-gradient(120% 80% at 0% 0%, #fff7ed 0%, transparent 60%),
        radial-gradient(120% 80% at 100% 100%, #fef3c7 0%, transparent 55%),
        #ffffff;
    padding: 34px 18px 22px;
    margin-top: 24px;
    margin-bottom: 12px;
    box-shadow: 0 14px 36px rgba(229, 57, 53, 0.10);
}
.tarjeta-cta::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #e53935 0%, #fb923c 50%, #f59e0b 100%);
}
.cta-cinta {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    font-weight: 800;
    font-size: 18px;
    letter-spacing: 0.01em;
    padding: 8px 18px;
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(229, 57, 53, 0.30);
    margin: 0 auto 14px;
    text-align: center;
}
.tarjeta-cta { text-align: center; }
.cta-intro {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 4px 0 10px;
    text-align: center;
}
.cta-lista {
    list-style: none;
    padding: 0;
    margin: 8px 0 18px;
    text-align: left;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}
.cta-lista li {
    padding: 10px 0 10px 38px;
    position: relative;
    line-height: 1.45;
    font-size: 15.5px;
    color: #1a1a1a;
}
.cta-lista li + li {
    border-top: 1px dashed #fde6c6;
}
.cta-lista li::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 13px;
    width: 22px;
    height: 22px;
    background: #16a34a;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(22, 163, 74, 0.30);
}
.cta-lista li::after {
    content: "✓";
    position: absolute;
    left: 4px;
    top: 10px;
    width: 22px;
    height: 22px;
    text-align: center;
    color: #fff;
    font-weight: 800;
    font-size: 14px;
    line-height: 22px;
}
.cta-precios {
    background: #ffffff;
    border: 1.5px dashed #fcd34d;
    border-radius: 12px;
    padding: 14px 14px;
    margin: 0 0 16px;
    text-align: center;
    color: #1a1a1a;
}
.cta-precio-grande {
    display: block;
    font-weight: 800;
    font-size: 20px;
    color: var(--accent);
    margin-bottom: 4px;
}
.cta-precio-linea {
    display: block;
    font-size: 14px;
    color: #4b5563;
}
.cta-sep {
    color: #d1d5db;
    margin: 0 4px;
}
.btn-cta-final {
    display: block;
    width: 100%;
    text-align: center;
    padding: 16px 20px;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.01em;
    box-shadow: 0 10px 24px rgba(229, 57, 53, 0.28);
    animation: cta-pulse 2.4s ease-in-out infinite;
}
@keyframes cta-pulse {
    0%, 100% { box-shadow: 0 10px 24px rgba(229, 57, 53, 0.28); transform: translateY(0); }
    50%      { box-shadow: 0 14px 32px rgba(229, 57, 53, 0.45); transform: translateY(-1px); }
}
@media (prefers-reduced-motion: reduce) {
    .btn-cta-final { animation: none; }
}

/* ===== Pantalla compartir: vista "después" ===== */
[hidden] { display: none !important; }

.cp-titulo-listo {
    text-align: center;
    color: #065f46;
    font-size: 28px;
    margin: 8px 0 14px;
}
@media (max-width: 380px) {
    .cp-titulo-listo { font-size: 24px; }
}

/* ===== Página "Cómo funciona" ===== */
.como-pasos {
    list-style: none;
    padding: 0;
    margin: 16px 0 0;
}
.como-pasos li {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 14px 0;
    border-bottom: 1px solid #eee;
}
.como-pasos li:last-child { border-bottom: none; }
.como-pasos h2 {
    font-size: 18px;
    margin: 0 0 6px;
    line-height: 1.3;
}
.como-pasos p {
    margin: 0;
    color: #4b5563;
    line-height: 1.55;
}
.como-num {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e53935;
    color: #fff;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 2px 6px rgba(229, 57, 53, 0.25);
}

/* ===== Páginas legales ===== */
.texto-legal {
    line-height: 1.65;
    color: #1a1a1a;
}
.texto-legal h2 {
    font-size: 19px;
    margin: 26px 0 8px;
    line-height: 1.3;
}
.texto-legal h3 {
    font-size: 16px;
    margin: 18px 0 6px;
    line-height: 1.3;
}
.texto-legal p { margin: 0 0 12px; }
.texto-legal ul {
    margin: 8px 0 14px;
    padding-left: 22px;
}
.texto-legal li { margin: 4px 0; }
.texto-legal a {
    color: #1a1a1a;
    text-decoration: underline;
}
.texto-legal code {
    background: #f3f4f6;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.9em;
}

.tabla-cookies {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0 16px;
    font-size: 14px;
}
.tabla-cookies th,
.tabla-cookies td {
    border: 1px solid #e5e7eb;
    padding: 8px 10px;
    text-align: left;
    vertical-align: top;
}
.tabla-cookies th {
    background: #f3f4f6;
    font-weight: 700;
}

/* ===== Footer con enlaces ===== */
.pie {
    margin-top: 32px;
    padding: 18px 16px 24px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}
.pie-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 14px;
    margin-bottom: 10px;
    font-size: 14px;
}
.pie-nav .pie-enlace { white-space: nowrap; }
.pie-copyright {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
}

/* ===== Tab bar inferior ===== */
body.con-tab-bar {
    /* Hueco al final del body para que la tab bar fija no tape contenido. */
    padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px));
}

.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.04);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    display: flex;
    z-index: 100;
}

/* Cuando el usuario está escribiendo (teclado abierto) ocultamos la tab bar
   para que no tape los campos del formulario. El padding inferior se quita
   también para que la página no deje un hueco al final mientras se escribe. */
body.cp-teclado .tab-bar { display: none; }
body.cp-teclado.con-tab-bar { padding-bottom: env(safe-area-inset-bottom, 0px); }
.tab-item {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 4px 7px;
    text-decoration: none;
    color: #4b5563;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.1;
    text-align: center;
    transition: color 0.15s ease;
}
.tab-item svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.7;
    display: block;
}
.tab-item.tab-activo,
.tab-item:hover,
.tab-item:focus-visible {
    color: #e53935;
}
.tab-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* ===== Panel admin · rediseño 2026-05-16 ===== */

/* KPI grid de 2 columnas (Clientes + Promos) */
.kpi-grid-2 { grid-template-columns: repeat(2, 1fr); }

/* KPI grid de 3 columnas (Clientes · Promos clientes · Promos anónimas) */
.kpi-grid-3 { grid-template-columns: repeat(3, 1fr); }
.kpi-grid-3 .kpi { padding: 10px 6px; }
.kpi-grid-3 .kpi-num { font-size: 22px; }
.kpi-grid-3 .kpi-lab { font-size: 11px; }

/* Tarjetas KPI clicables (cuando son <a>) */
a.kpi {
    color: inherit;
    text-decoration: none;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
a.kpi:hover,
a.kpi:focus-visible {
    transform: translateY(-1px);
    border-color: var(--accent, #e53935);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    outline: none;
}

/* Pestañas del panel (Clientes / Cortesías) */
.admin-tabs {
    display: flex;
    gap: 4px;
    margin: 14px 0 12px;
    border-bottom: 1px solid var(--border);
}
.admin-tab {
    flex: 1;
    text-align: center;
    padding: 12px 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-soft);
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
}
.admin-tab:hover { color: var(--text); }
.admin-tab-activa {
    color: var(--accent, #e53935);
    border-bottom-color: var(--accent, #e53935);
}

/* Lista de clientes / cortesías / promos como tarjetas */
.clientes-lista {
    list-style: none;
    padding: 0;
    margin: 8px 0 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cliente-card {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.cliente-card-cuerpo {
    display: block;
    padding: 12px 14px;
    color: inherit;
    text-decoration: none;
    transition: background 0.12s ease;
}
.cliente-card-cuerpo:hover { background: #fafafa; }
.cliente-card-cuerpo-estatico { cursor: default; }
.cliente-card-cuerpo-estatico:hover { background: transparent; }

.cliente-card-cabecera {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}
.cliente-card-nombre {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.cliente-card-estado {
    flex-shrink: 0;
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.cliente-card-estado-suscrito    { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.cliente-card-estado-gratis      { background: #f3f4f6; color: #374151; border: 1px solid #e5e7eb; }
.cliente-card-estado-desactivado { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.cliente-card-estado-cortesia    { background: #ede9fe; color: #5b21b6; border: 1px solid #ddd6fe; }
.cliente-card-estado-activa      { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.cliente-card-estado-caducada    { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.cliente-card-estado-eliminada   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

.cliente-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    font-size: 13px;
    color: var(--text-soft);
}
.cliente-card-meta-stats {
    gap: 4px 14px;
    font-weight: 600;
    color: var(--text);
}
.cliente-card-promos {
    margin-left: auto;
    background: #f3f4f6;
    color: var(--text);
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}
.cliente-card-pie { margin-top: 6px; }

/* Acciones inline en la tarjeta — fila bajo el cuerpo en móvil */
.cliente-card-acciones {
    display: flex;
    gap: 4px;
    padding: 6px 8px;
    border-top: 1px solid var(--border);
    background: #fafafa;
}
.cliente-card-form { flex: 1; margin: 0; }
.cliente-card-form button { width: 100%; }

.btn-mini {
    width: 100%;
    background: var(--bg-elev);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.12s ease;
}
.btn-mini:hover { background: #f3f4f6; }
.btn-mini-peligro {
    background: #fff;
    color: #b91c1c;
    border-color: #fecaca;
}
.btn-mini-peligro:hover { background: #fee2e2; }

/* En desktop la tarjeta es horizontal: cuerpo a la izquierda, acciones a la derecha */
@media (min-width: 720px) {
    .cliente-card {
        flex-direction: row;
        align-items: stretch;
    }
    .cliente-card-cuerpo { flex: 1; }
    .cliente-card-acciones {
        flex-direction: column;
        width: 200px;
        border-top: 0;
        border-left: 1px solid var(--border);
        background: #fafafa;
        padding: 8px;
    }
}

/* Detalle de cliente (dl) */
.cliente-detalle {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 8px 0 20px;
    padding: 12px 14px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
}
.cliente-detalle > div {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border);
}
.cliente-detalle > div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}
.cliente-detalle dt {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    min-width: 110px;
}
.cliente-detalle dd {
    margin: 0;
    font-size: 15px;
    color: var(--text);
    word-break: break-word;
}

/* Acciones grandes al final del detalle (Desactivar / Eliminar) */
.cliente-acciones-grandes {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 8px;
}
@media (min-width: 640px) {
    .cliente-acciones-grandes { grid-template-columns: 1fr 1fr; }
}
.cliente-accion-form {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    box-shadow: var(--shadow);
    margin: 0;
}
.cliente-accion-form button { width: 100%; }

