/* filiit · diseño v2 — limpio, claro, profesional. Mobile-first. */
:root {
  --bg: #eef1f8;
  --bg-grad: radial-gradient(1200px 600px at 50% -10%, #e7ecfb 0%, #eef1f8 55%);
  --surface: #ffffff;
  --surface-2: #f3f5fb;
  --border: #e3e8f1;
  --border-strong: #d3dae8;
  --text: #1a2230;
  --muted: #69748a;
  --brand: #4f6ef7;
  --brand-2: #7257f5;
  --brand-soft: #eef1fe;
  --ok: #12a150;
  --ok-soft: #e7f6ee;
  --warn: #b9770b;
  --warn-soft: #fbf1de;
  --err: #e5484d;
  --err-soft: #fdecec;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(20, 30, 60, .05), 0 10px 30px rgba(30, 45, 90, .06);
  --shadow-btn: 0 6px 16px rgba(79, 110, 247, .28);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.app { max-width: 560px; margin: 0 auto; padding: 0 16px 72px; }
.app.wide { max-width: 1160px; }
.app.wide > .topbar { display: none; }

/* topbar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 4px 14px; position: sticky; top: 0; z-index: 10;
  background: linear-gradient(var(--bg) 70%, rgba(238, 241, 248, 0));
}
.brand { font-weight: 800; letter-spacing: -.03em; font-size: 22px; color: var(--text); }
.brand span { background: linear-gradient(90deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.topbar a { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600; }
.topbar a:hover { color: var(--brand); }

/* cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin: 14px 0;
  box-shadow: var(--shadow);
}
.card h2 { margin: 0 0 4px; font-size: 19px; letter-spacing: -.01em; }
.card .sub { color: var(--muted); font-size: 14.5px; margin: 0 0 16px; }
.section-title {
  font-size: 12px; text-transform: uppercase; letter-spacing: .09em;
  color: var(--brand); margin: 22px 0 8px; font-weight: 700;
}

/* form */
label.field { display: block; margin: 13px 0; }
label.field .lab { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 7px; color: var(--text); }
label.field .req { color: var(--brand); }
label.field .help { display: block; color: var(--muted); font-size: 12px; margin-top: 5px; }
input, select, textarea {
  width: 100%; padding: 12px 14px; font-size: 16px; color: var(--text);
  background: var(--surface-2); border: 1.5px solid var(--border);
  border-radius: 11px; outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
input::placeholder, textarea::placeholder { color: #9aa4b6; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px var(--brand-soft); }
textarea { min-height: 84px; resize: vertical; }
input[type="file"] { padding: 10px; background: #fff; cursor: pointer; }
input[type="file"]::file-selector-button {
  border: 0; background: var(--brand-soft); color: var(--brand); font-weight: 700;
  padding: 8px 14px; border-radius: 8px; margin-right: 12px; cursor: pointer;
}
.field.bad input, .field.bad select, .field.bad textarea { border-color: var(--err); box-shadow: 0 0 0 4px var(--err-soft); }
.err-msg { color: var(--err); font-size: 12.5px; margin-top: 5px; display: none; font-weight: 600; }
.field.bad .err-msg { display: block; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px 18px; font-size: 16px; font-weight: 700;
  border: none; border-radius: 12px; cursor: pointer; margin-top: 10px;
  color: #fff; background: linear-gradient(90deg, var(--brand), var(--brand-2));
  box-shadow: var(--shadow-btn); transition: transform .08s, box-shadow .15s, opacity .15s;
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(79, 110, 247, .34); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; transform: none; }
.btn.ghost { background: #fff; color: var(--text); border: 1.5px solid var(--border-strong); box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--brand); color: var(--brand); }
.btn.sm { width: auto; padding: 8px 13px; font-size: 13px; margin: 0; border-radius: 9px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }

/* status badges */
.badge { font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; letter-spacing: .01em; }
.badge.generado { background: var(--surface-2); color: var(--muted); }
.badge.enviado  { background: var(--brand-soft); color: var(--brand); }
.badge.abierto  { background: var(--warn-soft); color: var(--warn); }
.badge.completado { background: var(--ok-soft); color: var(--ok); }
.badge.expirado { background: var(--err-soft); color: var(--err); }

/* link / doc list */
.link-item { border-top: 1px solid var(--border); padding: 16px 0; }
.link-item:first-child { border-top: none; padding-top: 4px; }
.link-item .head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.link-item .meta { color: var(--muted); font-size: 12.5px; margin: 7px 0; word-break: break-all; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--brand); }

/* privacy box */
.aviso {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px; max-height: 240px; overflow: auto;
  font-size: 13.5px; color: var(--muted); line-height: 1.6;
}
.aviso p { margin: 0 0 11px; }
.aviso p:last-child { margin-bottom: 0; }
.consent { display: flex; gap: 11px; align-items: flex-start; margin: 16px 0; }
.consent input { width: 20px; height: 20px; margin-top: 2px; flex: 0 0 auto; accent-color: var(--brand); }
.consent label { font-size: 14px; }

/* review */
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.kv:first-child { border-top: none; }
.kv .k { color: var(--muted); font-size: 13.5px; }
.kv .v { text-align: right; font-weight: 600; }

/* misc */
.progress { height: 7px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin: 6px 0 18px; border: 1px solid var(--border); }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .35s ease; }
.note { color: var(--muted); font-size: 13.5px; }
.center { text-align: center; }
.big-ok { font-size: 52px; line-height: 1; margin-bottom: 6px; }
.empty { color: var(--muted); text-align: center; padding: 26px 0; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(8px);
  background: #1a2230; color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px;
  font-weight: 600; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none;
  z-index: 50; box-shadow: 0 12px 30px rgba(20, 30, 60, .25); max-width: 90%;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
hr.sep { border: none; border-top: 1px solid var(--border); margin: 18px 0; }

/* Finder — navegador de carpetas (panel empresa) */
.finder-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.finder-bar h2 { font-size: 18px; }
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 12px; margin-top: 14px; }
.folder-tile {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 16px 8px 12px; border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface); color: var(--text); cursor: pointer; text-align: center;
  font: inherit; transition: transform .08s ease, box-shadow .12s ease, background .12s ease, border-color .12s ease;
}
.folder-tile:hover { background: var(--brand-soft); border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow); }
.folder-tile:active { transform: translateY(0); }
.folder-ico { font-size: 40px; line-height: 1; }
.folder-name { font-weight: 600; font-size: 13.5px; line-height: 1.2; word-break: break-word; }
.folder-count { font-size: 11.5px; color: var(--muted); }
.folder-tile.sin .folder-ico { opacity: .65; }
.folder-head { display: flex; align-items: center; gap: 10px; margin: 2px 0 14px; flex-wrap: wrap; }

/* Panel de dos columnas: carpetas (centro) + acciones (derecha) */
.dash-grid { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
@media (min-width: 880px) { .dash-grid { grid-template-columns: minmax(0, 1fr) 320px; } }
.dash-aside { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card.compact { padding: 16px; }
.card.compact h3 { margin: 0 0 8px; font-size: 15px; }
.card.compact .field { margin-bottom: 8px; }
.docs-list { margin-top: 14px; }

/* Migas de pan */
.crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--brand); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs .sep-c { color: var(--border-strong); }

/* Plantillas compactas en la barra lateral */
.tpls-mini { display: flex; flex-direction: column; gap: 6px; }
.tpl-mini { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; }
.tpl-mini-name { font-size: 13px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Fotos de propiedades */
.photo-sec { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 10px; }
.photo-thumb { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-del { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border: none; border-radius: 50%; background: rgba(20, 30, 60, .6); color: #fff; cursor: pointer; font-size: 12px; line-height: 1; }
.photo-del:hover { background: var(--err); }

/* Resumen de estatus + onboarding */
.stats { display: flex; gap: 10px; margin: 4px 0 14px; }
.stat { flex: 1; text-align: center; padding: 10px 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.stat-n { display: block; font-size: 22px; font-weight: 700; color: var(--brand); line-height: 1.1; }
.stat-l { font-size: 11.5px; color: var(--muted); }
.onboard { padding: 12px 14px; margin-bottom: 12px; background: var(--brand-soft); border-radius: 12px; font-size: 13.5px; color: var(--text); line-height: 1.4; }

/* Landing (pantalla de inicio) */
.lp-nav { display: flex; align-items: center; justify-content: space-between; padding: 22px 4px; }
.lp-hero { text-align: center; padding: 52px 12px 36px; }
.lp-title { font-size: clamp(30px, 5vw, 52px); line-height: 1.05; letter-spacing: -.03em; font-weight: 800; margin: 0 0 18px; }
.lp-accent { background: linear-gradient(90deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.lp-sub { max-width: 620px; margin: 0 auto 26px; color: var(--muted); font-size: 17px; }
.lp-cta { display: flex; gap: 12px; justify-content: center; }
.lp-cta .btn { min-width: 260px; width: auto; padding-left: 32px; padding-right: 32px; }
.lp-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 24px 0; }
.lp-feat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.lp-ic { font-size: 28px; }
.lp-feat h3 { margin: 10px 0 6px; font-size: 16px; }
.lp-feat p { margin: 0; color: var(--muted); font-size: 14px; }
.lp-client { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); max-width: 640px; margin: 8px auto 0; text-align: center; }
.lp-client-row { display: flex; gap: 8px; margin-top: 12px; }
.lp-client-row input { flex: 1; }
.lp-foot { text-align: center; color: var(--muted); font-size: 13px; padding: 40px 0 8px; }
@media (max-width: 560px) { .lp-cta .btn { min-width: 0; width: 100%; } .lp-client-row { flex-direction: column; } .lp-hero { padding: 32px 6px 24px; } }

/* Intro de escritura (papel → digital) */
.lp-intro { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: #f4efe4; background-image: radial-gradient(1200px 500px at 50% 40%, #faf6ee 0%, #efe8da 70%); transition: opacity .6s ease, transform .6s ease; }
.lp-intro.done { opacity: 0; transform: scale(1.05); pointer-events: none; }
.lp-intro-word { font-family: "Dancing Script", "Segoe Script", cursive; font-size: clamp(56px, 13vw, 132px); font-weight: 700; color: #1e3a5f; white-space: nowrap;
  overflow: hidden; clip-path: inset(0 100% 0 0); animation: lp-write 1.5s ease forwards .25s; }
@keyframes lp-write { to { clip-path: inset(0 -6% 0 0); } }
.lp-intro-dot { display: inline-block; transform-origin: center; animation: lp-dot .6s ease forwards 1.75s; }
@keyframes lp-dot { 0% { transform: scale(1); } 55% { transform: scale(1.7); color: var(--brand); } 100% { transform: scale(.28); color: var(--brand); } }
.lp-intro-hint { font-size: 12px; letter-spacing: .35em; text-transform: uppercase; color: #9a8e76; opacity: 0; animation: lp-fade .6s ease forwards 2s; }
@keyframes lp-fade { to { opacity: .85; } }

/* Fondo en movimiento (parallax suave) */
.lp-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .45; will-change: transform; }
.blob.b1 { width: 440px; height: 440px; background: #d7e0fb; top: -90px; left: -70px; }
.blob.b2 { width: 400px; height: 400px; background: #e7dcfb; top: 38%; right: -90px; }
.blob.b3 { width: 320px; height: 320px; background: #d5f0e8; bottom: -80px; left: 28%; }

/* Secciones del landing */
.lp-h2 { text-align: center; font-size: 26px; letter-spacing: -.02em; margin: 8px 0 22px; }
.lp-how { padding: 36px 0 12px; }
.lp-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.lp-step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.lp-num { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 700; font-size: 15px; }
.lp-step h3 { margin: 12px 0 6px; font-size: 16px; }
.lp-step p { margin: 0; color: var(--muted); font-size: 14px; }
.lp-manifesto { text-align: center; padding: 56px 16px; font-size: clamp(19px, 2.4vw, 26px); line-height: 1.5; color: var(--text); max-width: 880px; margin: 0 auto; }
.lp-manifesto strong { color: var(--brand); }
.lp-mvv { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; padding: 12px 0 40px; }
.lp-mvv .lp-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.lp-mvv .lp-card h3 { margin: 0 0 8px; font-size: 17px; }
.lp-mvv .lp-card p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.55; }
.lp-foot { text-align: center; color: var(--muted); padding: 48px 0 16px; border-top: 1px solid var(--border); margin-top: 24px; }
.lp-foot .brand { font-size: 24px; margin-bottom: 8px; }
.lp-foot p { margin: 4px 0; font-size: 14px; }
.lp-foot .lp-foot-sm { font-size: 12px; opacity: .8; }

/* Badge de simulación */
.sim-badge {
  text-align: center; font-size: 12px; font-weight: 700; letter-spacing: .04em;
  color: var(--warn); background: var(--warn-soft); border: 1px solid #f0d090;
  border-radius: 999px; padding: 5px 16px; margin: 12px auto 0; width: fit-content;
}

/* Header en pantallas de cliente (llenar/ver) */
.client-header {
  display: flex; align-items: center; justify-content: center;
  padding: 22px 0 4px;
}
.client-header .brand { font-size: 26px; }

/* Firma del cliente */
.firma-wrap { position: relative; margin-top: 8px; }
#firma-canvas { width: 100%; height: 200px; border: 1px dashed var(--border-strong); border-radius: 12px; background: #fff; touch-action: none; cursor: crosshair; display: block; }
.doc-preview { border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin: 10px 0; max-height: 260px; overflow: auto; font-size: 13px; background: var(--surface); }
.doc-preview .dp-sec { font-weight: 700; color: var(--brand); margin: 10px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .02em; }
.doc-preview .dp-row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px solid var(--border); }
.doc-preview .dp-row span { color: var(--muted); }
.firma-opt { display: flex; gap: 6px; align-items: center; margin: 6px 0; }
.firma-opt input { width: auto; }
