/* Amarra · sistema de diseño común (panel, contrato, páginas públicas) */
:root {
  --brand: #0e7490;
  --brand-ink: #ffffff;
  --brand-soft: #e0f2fe;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --bg: #f8fafc;
  --card: #ffffff;
  --ok: #16a34a;
  --ok-soft: #dcfce7;
  --warn: #f59e0b;
  --warn-soft: #fef3c7;
  --bad: #dc2626;
  --bad-soft: #fee2e2;
  --info-soft: #eff6ff;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .06);
  --shadow-lg: 0 10px 40px rgba(15, 23, 42, .18);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.5; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; }
small, .muted { color: var(--muted); }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }

/* botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45em; border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: .62em 1.05em; font-weight: 600; cursor: pointer; background: var(--brand); color: var(--brand-ink); text-decoration: none; transition: filter .15s, background .15s, transform .05s; white-space: nowrap; }
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.btn.secondary { background: var(--card); color: var(--ink); border-color: var(--line-2); }
.btn.secondary:hover { background: var(--bg); filter: none; }
.btn.ghost { background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: rgba(15, 23, 42, .05); filter: none; }
.btn.danger { background: var(--bad); }
.btn.ok { background: var(--ok); }
.btn.sm { padding: .38em .7em; font-size: .87rem; border-radius: 8px; }
.btn.lg { padding: .85em 1.4em; font-size: 1.05rem; border-radius: 12px; }
.btn.block { width: 100%; }

/* formularios */
.field { display: flex; flex-direction: column; gap: .3em; margin-bottom: .9em; min-width: 0; }
.field > label, .label { font-size: .84rem; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: .8rem; color: var(--muted); }
.input, input:not([type]), input[type=search], input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=time], input[type=password], input[type=url], input[type=color], select, textarea {
  width: 100%; border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: .6em .75em; background: #fff; color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s; min-width: 0; }
input[type=color] { padding: .2em; height: 2.6em; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.check { display: flex; gap: .6em; align-items: flex-start; cursor: pointer; font-size: .93rem; }
.check input { margin-top: .25em; width: 1.05em; height: 1.05em; accent-color: var(--brand); flex: none; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1em; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 1em; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* selector segmentado */
.seg { display: inline-flex; background: #eef2f7; border-radius: 12px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: .5em .9em; border-radius: 9px; cursor: pointer; font-weight: 600; color: var(--ink-2); font-size: .9rem; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

/* tarjetas */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.2em; }
.card + .card { margin-top: 1em; }
.card h2 { margin-bottom: .6em; }

/* etiquetas */
.tag { display: inline-flex; align-items: center; gap: .3em; padding: .15em .55em; border-radius: 999px; font-size: .77rem; font-weight: 700; background: #eef2f7; color: var(--ink-2); white-space: nowrap; }
.tag.ok { background: var(--ok-soft); color: #166534; }
.tag.warn { background: var(--warn-soft); color: #92400e; }
.tag.bad { background: var(--bad-soft); color: #991b1b; }
.tag.info { background: var(--brand-soft); color: #075985; }
.tag.hotel { background: #fef3c7; color: #92400e; }
.tag.perk { background: #fce7f3; color: #9d174d; }

/* avisos */
.alert { padding: .85em 1em; border-radius: var(--radius-sm); background: var(--info-soft); border: 1px solid #bfdbfe; font-size: .92rem; }
.alert.warn { background: var(--warn-soft); border-color: #fde68a; }
.alert.bad { background: var(--bad-soft); border-color: #fecaca; color: #7f1d1d; }
.alert.ok { background: var(--ok-soft); border-color: #bbf7d0; }

/* tablas */
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: .6em .7em; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: .7em; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: #f8fafc; }
.table-wrap { overflow-x: auto; }

/* toast */
.toast-host { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: .7em 1.1em; border-radius: 12px; box-shadow: var(--shadow-lg); font-weight: 600; font-size: .92rem; animation: toast-in .2s ease-out; max-width: 92vw; }
.toast.bad { background: var(--bad); }
.toast.ok { background: #15803d; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* modal */
.modal-back { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; z-index: 1000; overflow-y: auto; animation: fade .15s; }
.modal { background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; padding: 1.4em; position: relative; }
.modal.wide { max-width: 860px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 1em; margin-bottom: 1em; }
.modal-head h2 { margin: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: .6em; margin-top: 1.2em; flex-wrap: wrap; }
.x { border: 0; background: #f1f5f9; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 18px; line-height: 1; flex: none; }
@keyframes fade { from { opacity: 0; } }

.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.center { display: flex; align-items: center; justify-content: center; }
.row { display: flex; gap: .6em; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack > * + * { margin-top: .8em; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
