/* =====================================================================
   Palma · estilos compartidos de las páginas nuevas
   (inicio, ingresar, panel del asesor y publicar).
   El buscador tiene sus propios estilos, con los mismos colores.
   ===================================================================== */

/* ---------- Brand: change the color and typeface here ---------- */
:root {
  --brand: #0d7c66;
  --brand-dark: #0a5e4e;
  --brand-soft: #e3f3ef;
  --brand-text: #0d7c66;
  --brand-ink: #0a5e4e;
  --ink: #1d1d1f;
  --ink-2: #3c4043;
  --on-ink: #fff;
  --muted: #5f6368;
  --line: #e6e6e6;
  --line-strong: #c8c8c8;
  --line-hover: #9a9a9a;
  --bg: #f7f7f5;
  --surface: #fff;
  --surface-2: #f4f4f2;
  --hover: #f2f2f2;
  --ok-bg: #e6f5ec; --ok-ink: #16653a;
  --warn-bg: #fff4e5; --warn-ink: #9a4b00;
  --err: #b3261e;
  --wa: #17814a; --wa-dark: #126b3c;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.06);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
html.dark {
  --brand-dark: #0a6654;
  --brand-soft: #143c34;
  --brand-text: #5fd3b3;
  --brand-ink: #8ce6cc;
  --ink: #f2f2f4;
  --ink-2: #c9c9ce;
  --on-ink: #141416;
  --muted: #a3a3aa;
  --line: #34343a;
  --line-strong: #4a4a52;
  --line-hover: #75757d;
  --bg: #121214;
  --surface: #1c1c1f;
  --surface-2: #26262a;
  --hover: #2c2c31;
  --ok-bg: #173d29; --ok-ink: #7fdca5;
  --warn-bg: #46300f; --warn-ink: #ffc77a;
  --err: #ff8a80;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.35);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; line-height: 1.5; min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand-text); }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media screen { main.wrap { padding-block: 28px 64px; } } /* .wrap would win over the space each page gives its main */

/* ---------- Top bar ---------- */
.top { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 12px; min-height: 60px; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
.logo svg { width: 30px; height: 30px; }
.logo b { font-size: 20px; font-weight: 700; letter-spacing: -.02em; color: var(--brand-text); }
.logo small { font-size: 12px; color: var(--muted); font-weight: 500; border-left: 1px solid var(--line); padding-left: 8px; }
.top nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.top nav a.nav { padding: 8px 12px; border-radius: 999px; color: var(--ink-2); text-decoration: none; font-size: 14px; font-weight: 500; }
.top nav a.nav:hover { background: var(--hover); color: var(--ink); }
.top nav a.nav.on { color: var(--brand-ink); background: var(--brand-soft); }
.avatar { text-decoration: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; font-size: 13px; flex-shrink: 0; }

/* Agent bar: on mobile and tablet the links go in a menu */
.themeToggle-btn { width: 38px; height: 38px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); cursor: pointer; font-size: 16px; line-height: 1; padding: 0; }
.themeToggle-btn:hover { border-color: var(--line-hover); }
.menu-links { display: flex; align-items: center; gap: 2px; } .num-nav { margin-left: 6px; } .top .menu-btn { display: none; }
@media (max-width: 980px) {
  .top .menu-btn { display: inline-flex; }
  .menu-links { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; padding: 8px 16px 14px; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .menu-links.open { display: flex; } .top nav .menu-links a.nav { padding: 12px; font-size: 16px; }
  .top:has(.menu-links.open) { backdrop-filter: none; }
}
@media (max-width: 480px) { .top nav.agentBarRow .avatar { display: none; } .top nav.agentBarRow > .btn.sm { padding: 7px 10px; } }
/* "More" menu of a listing */
.li:has(.moreMenu[open]) { position: relative; z-index: 5; opacity: 1 !important; }
.moreMenu { position: relative; } .moreMenu summary { list-style: none; } .moreMenu summary::-webkit-details-marker { display: none; }
.moreMenu > div { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 190px; display: grid; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.18); }
.moreMenu > div a, .moreMenu > div button { padding: 10px 12px; border: none; border-radius: 8px; background: none; text-align: left; font-size: 14px; color: var(--ink); text-decoration: none; cursor: pointer; } .moreMenu > div a:hover, .moreMenu > div button:hover { background: var(--hover); } .moreMenu > div .del { color: var(--err); }
@media (max-width: 640px) { .moreMenu > div { right: auto; left: 0; } }
@media print { .themeToggle-btn { display: none; } }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; min-height: 44px; border: none; border-radius: 10px; background: var(--brand); color: #fff; font-size: 14.5px; font-weight: 600; text-decoration: none; cursor: pointer; transition: background .15s, transform .1s, border-color .15s; white-space: nowrap; }
.btn:hover { background: var(--brand-dark); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); }
.btn.ghost:hover { border-color: var(--ink); background: var(--surface); }
.btn.sm { min-height: 36px; padding: 7px 14px; font-size: 13.5px; }
.btn.lg { min-height: 52px; padding: 14px 24px; font-size: 16px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn.danger { background: none; color: var(--err); border: 1px solid var(--line); }
.btn.danger:hover { border-color: var(--err); background: none; }
.btn.wa { background: var(--wa); } .btn.wa:hover { background: var(--wa-dark); }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.link { background: none; border: none; padding: 0; color: var(--brand-text); font-weight: 500; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; }
.field > label, .label { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.field small, .hint { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.input, .field input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), .field select, .field textarea {
  width: 100%; padding: 11px 13px; min-height: 44px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--surface); color: var(--ink); font-size: 15px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.field.err input, .field.err select, .field.err textarea { border-color: var(--err); }
.field .msg { font-size: 12.5px; color: var(--err); min-height: 0; }
.field .msg:empty { display: none; }
::placeholder { color: var(--muted); opacity: 1; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }
.with-unit { position: relative; }
.with-unit span { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; font-size: 14px; pointer-events: none; }
.with-unit input { padding-left: 56px !important; }

/* Option buttons (like chips) */
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { padding: 9px 14px; min-height: 40px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 500; cursor: pointer; transition: all .15s; }
.opt:hover { border-color: var(--line-hover); }
.opt.on, .opt[aria-pressed="true"] { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-ink); box-shadow: inset 0 0 0 1px var(--brand); }
/* Large options (cards) */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.tile { display: grid; gap: 4px; padding: 14px; text-align: left; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); cursor: pointer; transition: all .15s; }
.tile:hover { border-color: var(--line-hover); }
.tile b { font-size: 15px; }
.tile small { font-size: 12.5px; color: var(--muted); }
.tile .ic { font-size: 22px; line-height: 1; }
.tile[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.tile[aria-pressed="true"] small { color: var(--brand-ink); }
.check { min-height: 24px; display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; cursor: pointer; }
.check input { width: 24px; height: 24px; margin: 0; accent-color: var(--brand); flex-shrink: 0; }
.check small { display: block; color: var(--muted); font-size: 12.5px; }

/* ---------- Cards and badges ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 20px; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok-ink); }
.badge.warn { background: var(--warn-bg); color: var(--warn-ink); }
.badge.brand { background: var(--brand); color: #fff; }
.muted { color: var(--muted); }
h1, h2, h3 { letter-spacing: -.02em; line-height: 1.2; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--ink); color: var(--on-ink); padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 500; box-shadow: 0 8px 24px rgba(0,0,0,.25); transition: all .25s; z-index: 1000; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Demo note */
.demo-note { font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }

@media (max-width: 640px) {
  .logo small { display: none; }
  .top nav a.nav.hide-sm { display: none; }
}
