/* Portal de códigos Disney · Premium y Códigos
   Diseño primero para celular (320 px en adelante). Unidades rem para
   respetar el tamaño de letra elegido por la persona. */
:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --text: #121826;
  --muted: #4a5568;
  --line: #d5dbe7;
  --primary: #1746c2;
  --primary-text: #ffffff;
  --primary-hover: #10359a;
  --focus: #f59e0b;
  --ok: #0f7a3d;
  --ok-bg: #e7f6ee;
  --warn-bg: #fff6dc;
  --warn: #7a5200;
  --err: #b42318;
  --err-bg: #fdecea;
  --code-bg: #eef3ff;
  --badge: #0f7a3d;
  --demo-bg: #5b21b6;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 2px 8px rgba(16, 24, 40, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1220;
    --surface: #161d2f;
    --text: #eef1f7;
    --muted: #b4bdd0;
    --line: #2c3650;
    --primary: #6d93ff;
    --primary-text: #0b1020;
    --primary-hover: #8eabff;
    --ok: #4ade80;
    --ok-bg: #11291c;
    --warn-bg: #2d2410;
    --warn: #f5cf6b;
    --err: #ff8a80;
    --err-bg: #331513;
    --code-bg: #1d2742;
    --badge: #4ade80;
    --shadow: none;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.125rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
a { color: var(--primary); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }

.demo-banner {
  background: var(--demo-bg); color: #fff; font-size: .9rem; padding: .5rem 1rem; text-align: center;
}
.demo-banner a { color: #fff; }
.topbar { padding: .75rem 1rem; max-width: 34rem; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.topbar .linklike { min-height: 2.75rem; font-size: .95rem; }
.brand { font-weight: 700; text-decoration: none; color: var(--text); letter-spacing: .01em; }
.page { max-width: 34rem; margin: 0 auto; padding: 0 1rem 3rem; }
.admin .page { max-width: 60rem; }

h1 { font-size: 1.6rem; line-height: 1.25; margin: .25rem 0 .5rem; }
h2 { font-size: 1.25rem; margin: 0 0 .5rem; }
.lead { color: var(--muted); margin: 0 0 1rem; }
.hint { color: var(--muted); font-size: .95rem; margin: .4rem 0 0; }
.center { text-align: center; }
.break { overflow-wrap: anywhere; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem 1rem; margin: 0 0 1rem; box-shadow: var(--shadow);
}
.intro h1 { font-size: 1.75rem; }

.form { display: grid; gap: 1rem; margin: 0 0 .5rem; }
.field { display: grid; gap: .35rem; border: 0; padding: 0; margin: 0; min-width: 0; }
.label { font-weight: 600; }
input[type=email], input[type=text], input[type=tel], input[type=password], select, textarea {
  width: 100%; font: inherit; font-size: 1.125rem; color: var(--text); background: var(--surface);
  border: 2px solid var(--line); border-radius: 12px; padding: .8rem .9rem; min-height: 3.25rem;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 30%, transparent); }
.otp { letter-spacing: .3em; font-size: 1.5rem !important; text-align: center; font-variant-numeric: tabular-nums; }
.check, .radio { display: flex; gap: .6rem; align-items: center; min-height: 2.75rem; }
.check input, .radio input { width: 1.4rem; height: 1.4rem; flex: none; accent-color: var(--primary); }

.btn {
  display: flex; align-items: center; justify-content: center; text-align: center; width: 100%;
  min-height: 3.25rem; padding: .75rem 1rem; border-radius: 12px; border: 2px solid transparent;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; margin: 0 0 .75rem;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.btn:last-child { margin-bottom: 0; }
.btn-primary { background: var(--primary); color: var(--primary-text); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-small { min-height: 2.75rem; font-size: 1rem; font-weight: 600; background: transparent; color: var(--primary); border-color: var(--line); }
.btn[disabled] { opacity: .6; cursor: default; }
.linklike {
  background: none; border: 0; padding: .5rem 0; font: inherit; color: var(--primary); text-decoration: underline;
  cursor: pointer; min-height: 2.75rem; text-align: left;
}
.inline-form { margin: 0; }

.alert { border-radius: 12px; padding: .75rem .9rem; margin: 0 0 1rem; font-weight: 500; }
.alert-error { background: var(--err-bg); color: var(--err); border: 1px solid currentColor; }
.alert-ok { background: var(--ok-bg); color: var(--ok); border: 1px solid currentColor; }
.alert-warn { background: var(--warn-bg); color: var(--warn); border: 1px solid currentColor; }
.suggestion { margin: -.5rem 0 0; font-size: 1rem; }

.secondary-links { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; justify-content: center; margin: 1.5rem 0 0; }
.secondary-links a, .secondary-links .linklike { display: inline-flex; align-items: center; min-height: 2.75rem; font-size: 1rem; }

.steps { padding-left: 1.4rem; margin: 0 0 1rem; }
.steps li { margin: 0 0 .35rem; }

/* Cuentas */
.account-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.account-card {
  display: grid; gap: .2rem; padding: 1rem; border-radius: var(--radius); background: var(--surface);
  border: 2px solid var(--line); text-decoration: none; color: var(--text); box-shadow: var(--shadow);
}
.account-card:hover, .account-card:focus-visible { border-color: var(--primary); }
.account-label { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.account-email { font-weight: 700; font-size: 1.1rem; }
.account-meta { color: var(--muted); font-size: 1rem; }
.account-cta { color: var(--primary); font-weight: 700; margin-top: .35rem; }
.account-notice { color: var(--warn); background: var(--warn-bg); border-radius: 8px; padding: .3rem .5rem; font-size: .95rem; margin-top: .3rem; }
.account-bar {
  display: grid; gap: .1rem; padding: .75rem 1rem; margin: 0 0 1rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
}
.switch { font-weight: 600; margin-top: .35rem; display: inline-flex; min-height: 2.75rem; align-items: center; }

/* Códigos */
.status { display: flex; gap: .5rem; align-items: flex-start; font-size: .95rem; color: var(--muted); margin: 0 0 1rem; }
.dot { width: .7rem; height: .7rem; border-radius: 50%; flex: none; margin-top: .4rem; }
.dot-ok { background: var(--ok); animation: pulse 2s infinite; }
.dot-err { background: var(--err); }
.dot-wait { background: var(--focus); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .dot-ok, .dot-wait { animation: none; } .code-card.fresh { animation: none; } }

.code-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .75rem; }
.code-card {
  position: relative; background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 1rem; box-shadow: var(--shadow);
}
.code-card.newest { border-color: var(--primary); }
.code-card.fresh { animation: arrive 1.2s ease-out; }
@keyframes arrive { from { background: var(--code-bg); } }
.badge {
  display: inline-block; background: var(--badge); color: var(--surface); font-weight: 700; font-size: .8rem;
  letter-spacing: .05em; text-transform: uppercase; border-radius: 999px; padding: .15rem .6rem;
}
.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-variant-numeric: tabular-nums;
  font-size: min(3.25rem, 14.5vw); font-weight: 700; letter-spacing: .12em; line-height: 1.1;
  margin: .4rem 0 .3rem; user-select: all; -webkit-user-select: all; white-space: nowrap;
}
.code-card:not(.newest) .code { font-size: min(2.5rem, 12vw); }
.code-meta { color: var(--muted); font-size: 1rem; margin: 0 0 .75rem; }
.copied { min-height: 1.5rem; margin: -.4rem 0 .4rem; color: var(--ok); font-weight: 700; text-align: center; }
.empty { background: var(--surface); border: 2px dashed var(--line); border-radius: var(--radius); padding: 1.25rem 1rem; margin: 0 0 1rem; }
.empty-title { font-weight: 700; font-size: 1.2rem; margin: 0 0 .4rem; }
.empty.waiting { border-color: var(--focus); }
.empty.failing { border-color: var(--err); }

.help { margin: 0 0 1rem; }
.missing-report { margin: 1.5rem 0 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.missing-q { margin: 0 0 .5rem; font-weight: 600; }
.missing-report .inline-form, .missing-report .btn { width: 100%; }
.missing-report .hint { margin: .4rem 0 0; }
details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin: 0 0 .5rem; }
summary { cursor: pointer; padding: .8rem 1rem; font-weight: 600; min-height: 3rem; list-style-position: inside; }
details > :not(summary) { margin: 0 1rem .8rem; }
details ul { padding-left: 1.2rem; }

.wa-panel h2 { font-size: 1.15rem; }
.wa-command {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.4rem; font-weight: 700;
  background: var(--code-bg); border-radius: 10px; padding: .6rem .8rem; text-align: center; user-select: all;
}
.wa-state { display: flex; gap: .5rem; align-items: flex-start; font-weight: 600; }
.wa-feedback { min-height: 1.5rem; margin: .25rem 0 0; font-weight: 600; }

.ref { font-family: ui-monospace, Menlo, monospace; font-size: 1.8rem; font-weight: 700; text-align: center; letter-spacing: .08em; margin: 0 0 1rem; user-select: all; }

/* Demostración y administración */
.demo-card { border: 2px dashed var(--demo-bg); }
.demo-tag { color: var(--demo-bg); font-weight: 700; font-size: .85rem; margin: 0 0 .5rem; }
@media (prefers-color-scheme: dark) { .demo-tag { color: #c4b5fd; } .demo-card { border-color: #8b5cf6; } }
.demo-body { white-space: pre-wrap; word-break: break-word; font-size: .95rem; background: var(--bg); padding: .6rem; border-radius: 8px; margin: .4rem 0; }
.people, .log, .stats, .kv { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.people li, .log li { border-bottom: 1px solid var(--line); padding-bottom: .5rem; font-size: 1rem; }
.log pre { white-space: pre-wrap; font-size: .85rem; }
.lvl-error { color: var(--err); }
.lvl-warn { color: var(--warn); }
.stat { display: grid; gap: .1rem; padding: .6rem .8rem; border-radius: 10px; border: 1px solid var(--line); font-size: 1rem; }
.stat-ok { border-left: 6px solid var(--ok); }
.stat-err { border-left: 6px solid var(--err); }
.kv li { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); }

@media (min-width: 640px) {
  .page { padding-bottom: 4rem; }
  .card { padding: 1.5rem; }
  h1 { font-size: 1.9rem; }
}
