:root {
  --bg: #0b0b0c;
  --bg2: #121214;
  --card: #18181b;
  --card2: #1f1f23;
  --line: #2c2c31;
  --gold: #c9a24b;
  --gold2: #e8cb7e;
  --text: #f2eee5;
  --muted: #a39d91;
  --ok: #62b982;
  --warn: #e3ab4c;
  --bad: #de6a63;
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 var(--font); min-height: 100vh; min-height: 100dvh;
}
img { max-width: 100%; height: auto; aspect-ratio: 1 / 1; display: block; }
a { color: var(--gold2); }
h1, h2, h3 { font-family: var(--serif); letter-spacing: .03em; line-height: 1.2; margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--gold2); outline-offset: 2px; }

/* Botones (zona tactil minima de 46px) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 46px; padding: .6rem 1.3rem; border-radius: 999px; border: 1px solid transparent;
  background: linear-gradient(180deg, var(--gold2), var(--gold)); color: #17130a;
  font-weight: 700; letter-spacing: .02em; cursor: pointer; text-decoration: none;
  transition: transform .08s, filter .15s;
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; transform: none; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--gold); color: var(--gold2); }
.btn.danger { background: transparent; color: var(--bad); border-color: #5a2d2a; }
.btn.small { min-height: 38px; padding: .3rem .9rem; font-size: .9rem; }
.btn.block { width: 100%; }

/* Formularios */
label.field { display: block; margin-bottom: 1rem; }
label.field > span { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .3rem; }
.input, select.input, textarea.input {
  width: 100%; min-height: 46px; padding: .6rem .85rem; font-size: 16px; /* 16px evita el zoom en iOS */
  background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; color: var(--text);
}
.input:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 3px rgba(201,162,75,.2); }
.check { display: flex; align-items: flex-start; gap: .6rem; cursor: pointer; }
.check input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--gold); flex: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.msg { padding: .7rem .9rem; border-radius: 10px; font-size: .95rem; margin: .8rem 0; }
.msg.err { background: #2a1513; border: 1px solid #5a2d2a; color: #f3b5b0; }
.msg.ok { background: #12241a; border: 1px solid #25533a; color: #a8e0bf; }
.msg.info { background: #1d1a10; border: 1px solid #4a4020; color: var(--gold2); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100;
  background: var(--card2); border: 1px solid var(--gold); color: var(--text);
  padding: .7rem 1.2rem; border-radius: 999px; box-shadow: 0 8px 30px #000a; max-width: 90vw;
}
.toast.bad { border-color: var(--bad); }

dialog {
  background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 18px;
  padding: 1.4rem; width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto;
}
dialog::backdrop { background: rgba(0,0,0,.72); }
dialog h3 { margin-bottom: 1rem; font-size: 1.3rem; }
dialog .actions { display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap; margin-top: 1.2rem; }

.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; margin: 2rem auto; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition: none !important; scroll-behavior: auto !important; } }
