/* =============================================================
   Sonrisa · SaaS para consultorios dentales
   Tabla de contenido:
   1. Tokens   2. Reset  3. UI base  4. Componentes  5. Landing
   6. App/Panel  7. Cuenta  8. Modal checkout  9. Responsive
   ============================================================= */

/* 1. Tokens */
:root {
  --azul: #0e7c8a;
  --azul-osc: #0a5f6b;
  --teal: #12b3b0;
  --menta: #d7f2ee;
  --crema: #f6f9f8;
  --blanco: #ffffff;
  --grafito: #16333a;
  --texto: #27464d;
  --muted: #6b848b;
  --borde: #dce8e6;
  --rojo: #e05d5d;
  --oro: #e0a73d;
  --sombra: 0 10px 30px rgba(14, 124, 138, .10);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --radio: 16px;
  --sans: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* 2. Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-size: 16px; line-height: 1.6; color: var(--texto);
  background: var(--crema); -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
h1,h2,h3,h4 { line-height: 1.15; letter-spacing: -.02em; color: var(--grafito); }
input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--azul); color: #fff; }
:focus-visible { outline: 2px solid var(--azul); outline-offset: 3px; border-radius: 6px; }

/* 3. UI base */
.container { width: min(1120px, 92%); margin-inline: auto; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.5rem; border-radius: 999px; font-weight: 600;
  transition: transform .25s var(--ease-out), box-shadow .25s, background .25s;
}
.btn-pri { background: var(--azul); color: #fff; }
.btn-pri:hover { background: var(--azul-osc); transform: translateY(-2px); box-shadow: var(--sombra); }
.btn-sec { background: var(--menta); color: var(--azul-osc); }
.btn-sec:hover { background: #c8ebe5; transform: translateY(-2px); }
.btn-linea { border: 1.5px solid var(--borde); color: var(--azul-osc); background: #fff; }
.btn-linea:hover { border-color: var(--azul); }
.btn-rojo { background: #fdecec; color: var(--rojo); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

.etiqueta {
  display: inline-block; padding: .3rem .8rem; border-radius: 999px;
  font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.etiqueta-teal { background: var(--menta); color: var(--azul-osc); }
.etiqueta-gris { background: #eef3f2; color: var(--muted); }

.titulo-sec { font-size: clamp(1.6rem, 3.5vw, 2.3rem); margin-bottom: .5rem; }
.sub-sec { color: var(--muted); max-width: 60ch; }

.tarjeta { background: var(--blanco); border: 1px solid var(--borde); border-radius: var(--radio); box-shadow: var(--sombra); }

.toast {
  position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--grafito); color: #fff; padding: .8rem 1.4rem; border-radius: 12px;
  font-size: .92rem; opacity: 0; pointer-events: none; transition: all .3s var(--ease-out);
  z-index: 300; max-width: 90vw; text-align: center;
}
.toast.ver { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--rojo); }
.toast.ok { background: #2fa46a; }

.campo { margin-bottom: 1rem; }
.campo label { display: block; font-size: .85rem; font-weight: 600; color: var(--grafito); margin-bottom: .35rem; }
.campo input, .campo select, .campo textarea {
  width: 100%; padding: .7rem .9rem; border: 1.5px solid var(--borde);
  border-radius: 10px; background: #fff; transition: border .2s;
}
.campo input:focus, .campo select:focus, .campo textarea:focus { border-color: var(--azul); outline: none; }

/* 4. Componentes */
.nav {
  position: sticky; top: 0; z-index: 100; backdrop-filter: blur(10px);
  background: rgba(246, 249, 248, .85); border-bottom: 1px solid var(--borde);
}
.nav-in { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.logo { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.2rem; color: var(--grafito); }
.logo-diente {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--azul), var(--teal)); color: #fff; font-size: 1.05rem;
}
.nav-links { display: flex; gap: 1.6rem; align-items: center; }
.nav-links a { font-weight: 600; color: var(--texto); }
.nav-links a:hover { color: var(--azul); }

/* 5. Landing */
.hero { padding: clamp(3rem, 8vw, 6rem) 0 3rem; background:
  radial-gradient(1200px 500px at 80% -10%, var(--menta), transparent 60%),
  var(--crema); }
.hero-grid { display: grid; gap: 2.5rem; align-items: center; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin: 1rem 0; }
.hero p.lead { font-size: 1.12rem; color: var(--muted); max-width: 52ch; margin-bottom: 1.8rem; }
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero-conf { margin-top: 1.4rem; display: flex; flex-wrap: wrap; gap: 1.4rem; color: var(--muted); font-size: .92rem; }
.hero-conf span { display: flex; align-items: center; gap: .4rem; }

/* mockup teléfono */
.phone {
  position: relative; width: min(340px, 100%); margin-inline: auto;
  background: var(--grafito); border-radius: 34px; padding: 14px;
  box-shadow: 0 30px 60px rgba(22,51,58,.35); border: 4px solid #0d262c;
}
.phone-screen { background: #f2f6f5; border-radius: 22px; overflow: hidden; min-height: 560px; display: flex; flex-direction: column; }
.phone-head { background: var(--azul); color: #fff; padding: 14px 16px; display: flex; align-items: center; gap: 10px; }
.phone-ava { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.2); display: grid; place-items: center; }
.phone-head b { font-size: .95rem; display: block; line-height: 1.1; }
.phone-head small { opacity: .8; font-size: .72rem; }
.phone-chat { flex: 1; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.burbuja { max-width: 82%; padding: 9px 13px; border-radius: 16px; font-size: .85rem; line-height: 1.4; }
.burbuja.in { align-self: flex-start; background: #fff; border-bottom-left-radius: 4px; box-shadow: 0 2px 6px rgba(0,0,0,.06); }
.burbuja.out { align-self: flex-end; background: var(--azul); color: #fff; border-bottom-right-radius: 4px; }
.phone-tip { display: flex; align-items: center; justify-content: space-between; background: #fff; border-top: 1px solid var(--borde); gap: 8px; padding: 10px 12px; }
.phone-tip span { flex: 1; color: var(--muted); font-size: .8rem; }
.phone-tip .mic { background: var(--azul); color: #fff; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; }

.seccion { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.banda-teal { background: var(--menta); }

.grid-ventajas { display: grid; gap: 1.2rem; margin-top: 2.5rem; }
.ventaja { background: #fff; border: 1px solid var(--borde); border-radius: var(--radio); padding: 1.6rem; }
.ventaja .ico {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: var(--menta); color: var(--azul); font-size: 1.3rem; margin-bottom: .9rem;
}
.ventaja h3 { font-size: 1.1rem; margin-bottom: .4rem; }

.planes-g { display: grid; gap: 1.2rem; margin-top: 2.5rem; align-items: stretch; }
.plan { background: #fff; border: 1.5px solid var(--borde); border-radius: var(--radio); padding: 1.8rem; display: flex; flex-direction: column; }
.plan.dest { border-color: var(--azul); box-shadow: var(--sombra); position: relative; }
.plan.dest .etiqueta { position: absolute; top: -12px; left: 20px; }
.plan h3 { font-size: 1.15rem; }
.plan .precio { font-size: 2.2rem; font-weight: 800; color: var(--grafito); margin: .6rem 0; }
.plan .precio small { font-size: .95rem; color: var(--muted); font-weight: 500; }
.plan ul { list-style: none; margin: 1rem 0 1.4rem; flex: 1; }
.plan ul li { padding: .4rem 0; display: flex; gap: .6rem; color: var(--texto); font-size: .95rem; }
.plan ul li::before { content: "✓"; color: var(--azul); font-weight: 800; }
.plan .btn { margin-top: auto; }

.modo-demo {
  display: flex; align-items: center; gap: .6rem; justify-content: center;
  background: #fff7e8; color: #9a6a12; border: 1px solid #f0d9a8;
  padding: .7rem 1.2rem; border-radius: 12px; font-weight: 600; font-size: .9rem;
}

.faq-item { border-bottom: 1px solid var(--borde); padding: 1.2rem 0; }
.faq-item summary { cursor: pointer; font-weight: 600; color: var(--grafito); font-size: 1.02rem; }
.faq-item p { margin-top: .7rem; color: var(--muted); }

.footer { background: var(--grafito); color: #c9dcdf; padding: 3rem 0; }
.footer-in { display: grid; gap: 1.5rem; align-items: start; }
.footer .logo { color: #fff; }
.footer a { color: #9fc8cd; }
.footer small { color: #7fa2a7; }

/* 6. App / panel */
.estructura-appale { display: grid; grid-template-columns: 1fr; min-height: calc(100vh - 68px); }
.sidebar {
  background: var(--grafito); color: #d6e6e8; padding: 1.2rem; display: flex;
  flex-direction: column; gap: 2rem;
}
.sidebar .logo { color: #fff; }
.side-links { display: flex; flex-direction: column; gap: .3rem; }
.side-link {
  display: flex; align-items: center; gap: .8rem; padding: .75rem 1rem;
  border-radius: 10px; font-weight: 600; color: #b9cfd2; cursor: pointer; transition: all .2s;
}
.side-link:hover { background: rgba(255,255,255,.06); }
.side-link.act { background: var(--azul); color: #fff; }
.main-panel { padding: 1.6rem; max-width: 980px; width: 100%; margin-inline: auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.6rem; flex-wrap: wrap; }
.creditos-pill {
  background: var(--menta); color: var(--azul-osc); font-weight: 700; padding: .4rem .9rem;
  border-radius: 999px; display: inline-flex; align-items: center; gap: .4rem; font-size: .88rem;
}
.badge-demo { display: inline-flex; align-items: center; gap: .5rem; background:#fff7e8; color:#9a6a12;
  border:1px solid #f0d9a8; padding:.3rem .8rem; border-radius:999px; font-weight:700; font-size:.78rem; }

.panel-titulo { font-size: 1.5rem; margin-bottom: 1.2rem; }
.vista { display: none; }
.vista.act { display: block; }

.kpis { display: grid; gap: 1rem; margin-bottom: 1.6rem; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); }
.kpi { background: #fff; border: 1px solid var(--borde); border-radius: 14px; padding: 1.1rem; }
.kpi .num { font-size: 1.8rem; font-weight: 800; color: var(--grafito); }
.kpi .lb { font-size: .82rem; color: var(--muted); }

.listas { display: grid; gap: .8rem; }
.item-lead { background: #fff; border: 1px solid var(--borde); border-radius: 12px; padding: 1rem; display: flex; flex-direction: column; gap: .6rem; }
.item-lead .arriba { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; }
.item-lead h4 { font-size: 1rem; }
.item-lead .mensaje { font-size: .9rem; color: var(--muted); }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip { padding: .28rem .7rem; border-radius: 999px; font-size: .75rem; font-weight: 600; cursor: pointer; background: #eef3f2; color: var(--muted); }
.chip.act { background: var(--azul); color: #fff; }
.estado-pill { font-size: .72rem; font-weight: 700; padding: .25rem .6rem; border-radius: 999px; }
.estado-nuevo { background: #e8f1ff; color: #2a6fd6; }
.estado-seguimiento { background: #fff3e0; color: #c07a12; }
.estado-convertido { background: #e4f7ec; color: #1e8a4c; }
.estado-perdido { background: #fdecec; color: var(--rojo); }

.form-cita { background: #fff; border: 1px solid var(--borde); border-radius: var(--radio); padding: 1.4rem; margin-bottom: 1.4rem; }
.form-cita .grid { display: grid; gap: 1rem; }
.lista-citas { display: grid; gap: .7rem; }
.cita-item { background:#fff; border:1px solid var(--borde); border-radius:12px; padding:1rem; display:flex; justify-content:space-between; align-items:center; gap:1rem; flex-wrap:wrap; }
.cita-item .fecha { font-weight:800; color:var(--azul-osc); }

/* chat asistente */
.chat-wrap { display: grid; grid-template-columns: 1fr; gap: 1.4rem; }
.asistente-card { background:#fff; border:1px solid var(--borde); border-radius:var(--radio); overflow:hidden; display:flex; flex-direction:column; }
.asistente-head { background: var(--azul); color:#fff; padding:1rem 1.2rem; display:flex; align-items:center; gap:.8rem; }
.asistente-body { height: 380px; overflow-y:auto; padding:1.2rem; display:flex; flex-direction:column; gap:.8rem; background:#f6f9f8; }
.asistente-body .burbuja { white-space: pre-wrap; }
.asistente-input { display:flex; gap:.6rem; padding:1rem; border-top:1px solid var(--borde); background:#fff; }
.asistente-input input { flex:1; padding:.8rem 1rem; border:1.5px solid var(--borde); border-radius:999px; }
.asistente-input input:focus { border-color: var(--azul); outline:none; }
.enviar { background: var(--azul); color:#fff; width:46px; height:46px; border-radius:50%; display:grid; place-items:center; font-size:1.1rem; }
.nota-demo { font-size:.78rem; color:var(--muted); padding:0 1.2rem 1rem; }

/* 7. Cuenta */
.centro { max-width: 560px; margin-inline: auto; padding: 3rem 1.2rem; }
.caja-auth { background:#fff; border:1px solid var(--borde); border-radius:var(--radio); padding:2rem; box-shadow: var(--sombra); }
.caja-auth h1 { font-size:1.5rem; margin-bottom:.3rem; }
.caja-auth .sub { color:var(--muted); font-size:.95rem; margin-bottom:1.5rem; }
.cambiar { text-align:center; margin-top:1rem; font-size:.9rem; color:var(--muted); }
.cambiar a { color:var(--azul); font-weight:600; }

/* 8. Modal checkout */
.overlay { position: fixed; inset:0; background:rgba(22,51,58,.5); display:none; place-items:center; padding:1rem; z-index:200; }
.overlay.ver { display:grid; }
.modal { background:#fff; border-radius:18px; max-width:440px; width:100%; padding:2rem; position:relative; }
.modal h2 { font-size:1.3rem; margin-bottom:.5rem; }
.modal .cerrar { position:absolute; top:1rem; right:1rem; font-size:1.3rem; color:var(--muted); }
.fake-card { background:linear-gradient(135deg, var(--grafito), #254a53); color:#fff; border-radius:14px; padding:1.4rem; margin:1rem 0; }
.fake-card .num { font-family: ui-monospace, monospace; font-size:1.15rem; letter-spacing:.08em; margin:.7rem 0; }
.fake-card .row { display:flex; justify-content:space-between; font-size:.8rem; opacity:.85; }

/* 9. Responsive */
@media (min-width: 720px) {
  .hero-grid { grid-template-columns: 1.1fr .9fr; }
  .grid-ventajas { grid-template-columns: repeat(3, 1fr); }
  .planes-g { grid-template-columns: repeat(3, 1fr); }
  .estructura-appale { grid-template-columns: 240px 1fr; }
  .form-cita .grid { grid-template-columns: 1fr 1fr; }
  .chat-wrap { grid-template-columns: 1.3fr .7fr; }
  .footer-in { grid-template-columns: 1.5fr 1fr 1fr; }
}
@media (min-width: 540px) {
  .item-lead { flex-direction: row; align-items:center; justify-content:space-between; }
}
