/* Cuenta Dicard (/cuenta). Monocromo: botón principal negro; azul solo en foco y progreso. */
:root {
  --paper: #eef0f3;
  --sheet: #ffffff;
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --line: #d2d2d7;
  --soft: #f5f5f7;
  --focus: #0071e3;
  --focus-ring: 0 0 0 4px rgba(0, 113, 227, .18);
  --danger: #c9162b;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; color: var(--ink); background: var(--paper);
  font: 16px/1.47 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: var(--ink); text-underline-offset: .2em; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ── Encabezado ── */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 1080px; margin: 0 auto; padding: max(18px, env(safe-area-inset-top)) 20px 0;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-height: 44px; }
.brand img { display: block; width: 96px; height: auto; }
.brand span { padding-left: 10px; border-left: 1px solid var(--line); font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.top .lang-switch { background: rgba(255, 255, 255, .6); }

/* ── Hoja ── */
main { width: 100%; max-width: 440px; margin: 0 auto; padding: clamp(28px, 7vh, 72px) 16px max(40px, env(safe-area-inset-bottom)); }
.sheet {
  background: var(--sheet); border-radius: 24px; padding: 28px 22px 26px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 12px 32px rgba(0, 0, 0, .06);
}
h1 { margin: 0 0 6px; font-size: 28px; line-height: 1.12; font-weight: 700; letter-spacing: -.025em; }
h2 { margin: 0 0 6px; font-size: 17px; line-height: 1.25; letter-spacing: -.015em; }
.sub { margin: 0 0 22px; color: var(--ink-2); font-size: 15px; overflow-wrap: anywhere; }

/* ── Selector Iniciar sesión / Crear cuenta ── */
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 3px; margin-bottom: 26px; border-radius: 12px; background: var(--soft); }
.segmented a {
  display: flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 8px; border-radius: 9px;
  color: var(--ink-2); font-size: 14px; font-weight: 600; text-decoration: none; text-align: center;
}
.segmented a[aria-current="page"] { background: var(--sheet); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }

/* ── Campos ── */
.form { display: grid; gap: 0; }
.field { display: block; margin-bottom: 16px; }
.field > span:first-child:not(.field__head), .field > label, .field__head label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; }
.field__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.field__head a { margin-bottom: 6px; color: var(--ink-2); font-size: 13px; text-decoration: none; }
.field__head a:hover { color: var(--ink); text-decoration: underline; }
input, .address {
  display: block; width: 100%; min-height: 50px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--sheet); color: var(--ink); font: inherit; font-size: 17px; transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: #a1a1a6; }
input:focus { outline: none; border-color: var(--focus); box-shadow: var(--focus-ring); }
input[aria-invalid="true"] { border-color: var(--danger); }
.secret { position: relative; display: block; }
.secret input { padding-right: 84px; }
.secret__toggle {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%); min-height: 38px; padding: 0 10px; border: 0; border-radius: 10px;
  background: transparent; color: var(--ink-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.secret__toggle:hover { background: var(--soft); color: var(--ink); }
.address { display: flex; align-items: center; flex-wrap: wrap; gap: 0; color: var(--ink-2); font-size: 15px; }
.address:focus-within { border-color: var(--focus); box-shadow: var(--focus-ring); }
.address > span { white-space: nowrap; }
.address input { flex: 1 1 7rem; min-width: 0; min-height: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; font-size: 17px; }
.address input:focus { box-shadow: none; }
.code { text-align: center; font-size: 26px; font-weight: 600; letter-spacing: .4em; padding-left: calc(14px + .4em); font-variant-numeric: tabular-nums; }
.hint { margin: -8px 0 16px; color: var(--ink-2); font-size: 13px; }
.recap { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.recap [data-email] { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }

/* ── Progreso del registro ── */
.progress { height: 3px; border-radius: 3px; background: var(--soft); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--focus); border-radius: inherit; transition: width .25s ease; }
.count { margin: 10px 0 18px; color: var(--ink-2); font-size: 12px; font-weight: 600; }

/* ── Mensajes ── */
.error { margin: 0 0 14px; color: var(--danger); font-size: 14px; }
.error:empty { display: none; }
.notice { margin: 0 0 14px; color: var(--ink-2); font-size: 14px; }

/* ── Botones ── */
.primary, .secondary {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 50px; padding: 0 20px; border-radius: 999px;
  font: inherit; font-size: 16px; font-weight: 600; text-decoration: none; cursor: pointer; transition: background .15s, opacity .15s;
}
.primary { border: 0; background: var(--ink); color: #fff; }
.primary:hover { background: #000; }
.primary[aria-busy="true"] { opacity: .55; cursor: progress; }
.secondary { border: 1px solid var(--line); background: var(--sheet); color: var(--ink); }
.secondary:hover { border-color: var(--ink-2); }
.link { padding: 0; border: 0; background: none; color: var(--ink); font: inherit; font-size: 15px; text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }
.back { justify-self: center; min-height: 44px; margin-top: 6px; color: var(--ink-2); }
.recap .link { font-size: 14px; color: var(--ink-2); }
.row-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; margin-top: 18px; font-size: 15px; }
.row-links form { margin: 0; }
.row-links a, .row-links .link { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink-2); }
.actions { display: grid; gap: 10px; margin-top: 22px; }

/* ── Clientes anteriores ── */
.legacy { margin-top: 18px; padding: 20px 22px; border-radius: 20px; background: rgba(255, 255, 255, .55); }
.legacy p { margin: 0 0 10px; color: var(--ink-2); font-size: 14px; }
.legacy__links { display: grid; gap: 2px; margin: 0 !important; }
.legacy__links a { display: flex; align-items: center; min-height: 40px; font-size: 15px; font-weight: 500; }

/* ── Mi cuenta ── */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--soft); }
.row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 64px; padding: 10px 2px;
  border-bottom: 1px solid var(--soft); color: inherit; text-decoration: none;
}
.row span { display: grid; min-width: 0; }
.row small { color: var(--ink-2); font-size: 12px; overflow-wrap: anywhere; }
.row strong { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.row .chevron { flex: none; color: #b0b0b5; }
a.row:hover .chevron { color: var(--ink); }
.row .secondary { width: auto; min-height: 40px; padding: 0 16px; font-size: 14px; flex: none; }
.found { margin-top: 26px; }
.found > p { margin: 0 0 12px; color: var(--ink-2); font-size: 14px; }
.reserved { display: grid; gap: 2px; margin: 0; padding: 14px 16px; border-radius: var(--radius); background: var(--soft); color: var(--ink-2); font-size: 13px; }
.reserved strong { color: var(--ink); font-size: 15px; overflow-wrap: anywhere; }
.after { display: grid; justify-items: center; gap: 6px; margin-top: 20px; font-size: 15px; }
.after details { text-align: center; }
.after summary { min-height: 44px; display: inline-flex; align-items: center; color: var(--ink-2); cursor: pointer; }
.after .legacy__links { justify-items: center; }
.after .link { min-height: 44px; color: var(--ink-2); }

@media (min-width: 600px) {
  .sheet { padding: 40px 40px 36px; }
  h1 { font-size: 32px; }
  .legacy { padding: 22px 28px; }
}
@media (max-width: 359px) {
  main { padding-inline: 10px; }
  .sheet { padding: 24px 16px 22px; border-radius: 20px; }
  h1 { font-size: 25px; }
  .brand img { width: 84px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
