/* Yio Club — design system */
:root {
  --bg: #f6f6f8;
  --surface: #ffffff;
  --surface-2: #f2f1f6;
  --border: #e6e4ee;
  --text: #15131c;
  --muted: #6d6a7c;
  --faint: #9a97a8;
  --primary: #15131c;
  --primary-text: #ffffff;
  --accent: #0ea5e9;
  --accent-soft: #e0f2fe;
  --accent-ink: #0369a1;
  --success: #17a36b;
  --success-soft: #e3f6ee;
  --warning: #d98a0b;
  --warning-soft: #fdf2df;
  --danger: #e0445a;
  --danger-soft: #fde8eb;
  --info: #2f7ef0;
  --info-soft: #e5effe;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 16, 40, .04), 0 4px 16px rgba(20, 16, 40, .05);
  --shadow-lg: 0 20px 60px rgba(20, 16, 40, .18);
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.02em; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0; }
img, svg { display: block; }
button { font-family: inherit; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent; font-size: 14px; font-weight: 600; cursor: pointer; transition: transform .08s, background .15s, box-shadow .15s, opacity .15s; white-space: nowrap; text-decoration: none; user-select: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--primary-text); }
.btn-primary:hover:not(:disabled) { background: #2c2838; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover:not(:disabled) { background: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn-soft { background: var(--accent-soft); color: var(--accent-ink); }
.btn-soft:hover:not(:disabled) { background: #bae6fd; }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: #fbd5db; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { height: 48px; padding: 0 24px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { width: 36px; padding: 0; }
.btn > svg { width: 18px; height: 18px; flex-shrink: 0; } /* Safari no dibuja SVG sin tamaño dentro de un botón flex */
.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Formularios ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--text); }
.hint { font-size: 12px; color: var(--muted); }
.input, .select, .textarea { width: 100%; height: 42px; padding: 0 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font: inherit; color: var(--text); transition: border .15s, box-shadow .15s; outline: none; }
.textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(14, 165, 233, .15); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236d6a7c' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.input-color { width: 42px; height: 42px; padding: 3px; border: 1px solid var(--border); border-radius: 10px; background: #fff; cursor: pointer; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 13px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 1px 0 0; flex-shrink: 0; }
.switch { position: relative; width: 40px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #d9d6e3; border-radius: 99px; cursor: pointer; transition: .2s; }
.switch span::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::before { transform: translateX(16px); }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; min-width: 0; }
.error-text { color: var(--danger); font-size: 13px; }

/* ---------- Superficies ---------- */
.card-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 20px; }
.badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.warning { background: var(--warning-soft); color: var(--warning); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.accent { background: var(--accent-soft); color: var(--accent-ink); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 1000; max-width: calc(100vw - 40px); }
.toast { background: var(--text); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-weight: 600; font-size: 13.5px; display: flex; gap: 10px; align-items: center; animation: toastIn .25s ease; max-width: 380px; }
.toast.error { background: var(--danger); }
.toast.success::before { content: '✓'; color: #7ef0bd; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Tarjeta digital (pase) ---------- */
.pass { --pbg: #0B2239; --pfg: #fff; --pac: #7DD3FC; width: 100%; max-width: 360px; border-radius: 22px; background: var(--pbg); color: var(--pfg); overflow: hidden; box-shadow: 0 24px 50px -12px rgba(20, 16, 40, .45); position: relative; font-family: var(--font); }
.pass-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 10px; gap: 10px; }
.pass-logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 15px; min-width: 0; }
.pass-logo .ico { width: 34px; height: 34px; border-radius: 10px; background: color-mix(in srgb, var(--pac) 30%, transparent); display: grid; place-items: center; font-size: 18px; flex-shrink: 0; }
.pass-logo span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pass-logo .logo-img { width: 34px; height: 34px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: rgba(255,255,255,.15); }
.pass-headfield { text-align: right; flex-shrink: 0; }
.pass-headfield .k { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; opacity: .7; font-weight: 700; }
.pass-headfield .hv { font-size: 20px; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }
.pass-banner { margin: 6px 14px; border-radius: 16px; height: 132px; background-size: cover; background-position: center; position: relative; overflow: hidden; display: flex; align-items: center; padding: 12px 14px; }
/* Sellos centrados sobre la foto, con una franja suave más oscura en medio para que se lean */
.pass-banner.has-stamps { align-items: center; }
.pass-banner.has-stamps::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 15%, rgba(0,0,0,.45) 50%, rgba(0,0,0,0) 85%); }
.pass-banner .stamps.on-banner { position: relative; width: 100%; display: grid; gap: 6px; justify-items: center; }
.pass-banner .stamp { width: 100%; max-width: 34px; border-width: 2px; border-color: rgba(255,255,255,.9); background: rgba(0,0,0,.25); color: #fff; font-size: 13px; }
/* Sello lleno: siempre con borde blanco y sombra, para que resalte aunque el acento sea oscuro */
.pass-banner .stamp.on { background: var(--pac); border: 2px solid #fff; color: var(--pbg); box-shadow: 0 2px 8px rgba(0,0,0,.45); }
/* La barra va debajo de la foto (no encima) para no tapar el banner */
/* Dato principal (saldo, visitas, puntos…) a la izquierda, con el color de texto de la tarjeta.
   Sobre la foto: degradado con el color de fondo de la tarjeta a la izquierda para que se lea. */
.pass-banner.has-info::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, color-mix(in srgb, var(--pbg) 80%, transparent) 0%, color-mix(in srgb, var(--pbg) 35%, transparent) 50%, transparent 80%); }
.banner-info { position: relative; width: 100%; color: var(--pfg); }
.banner-info .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; opacity: .75; }
.banner-info .big { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.banner-info .progress { width: 85%; margin-top: 8px; }
.banner-info.below { width: auto; margin: 8px 20px 2px; }
.banner-info.below .progress { width: 100%; }
/* Sin acento: sello lleno transparente (se ve el logo/emoji tal cual) y barra con el color del texto */
.pass.no-acc .pass-banner .stamp.on { background: rgba(255,255,255,.12); color: #fff; }
.pass.no-acc .stamp.on { background: transparent; }
.pass.no-acc .pass-strip { background: color-mix(in srgb, var(--pfg) 8%, transparent); }
.pass.no-acc .pass-logo .ico { background: color-mix(in srgb, var(--pfg) 12%, transparent); }
.stamp .stamp-img { width: 74%; height: 74%; border-radius: 50%; object-fit: cover; }
.pass-type { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; opacity: .7; font-weight: 700; text-align: right; }
.pass-strip { margin: 6px 14px; border-radius: 16px; padding: 18px; min-height: 120px; background: linear-gradient(135deg, color-mix(in srgb, var(--pac) 55%, transparent), color-mix(in srgb, var(--pac) 15%, transparent)); display: flex; flex-direction: column; justify-content: center; }
.pass-strip .big { font-size: 34px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.pass-strip .lbl { font-size: 12px; opacity: .8; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.stamps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.stamps.s-many { grid-template-columns: repeat(6, 1fr); }
.stamp { aspect-ratio: 1; border-radius: 50%; border: 2px dashed color-mix(in srgb, var(--pfg) 45%, transparent); display: grid; place-items: center; font-size: 15px; transition: .3s; }
.stamp.on { background: var(--pac); border: 2px solid var(--pac); color: var(--pbg); transform: scale(1.02); }
.pass-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; padding: 12px 20px; }
.pass-fields .k { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; opacity: .65; font-weight: 700; }
.pass-fields > div { min-width: 0; }
.pass-fields .v { font-weight: 700; font-size: 14px; line-height: 1.3; overflow: hidden; overflow-wrap: break-word; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.pass-qr { margin: 6px 20px 20px; background: #fff; border-radius: 14px; padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; color: #15131c; }
.pass-qr img { width: 150px; height: 150px; }
.pass-qr small { font-family: ui-monospace, monospace; font-size: 12px; letter-spacing: .12em; font-weight: 600; }
.progress { height: 6px; border-radius: 99px; background: color-mix(in srgb, var(--pfg) 20%, transparent); overflow: hidden; margin-top: 10px; }
.progress > i { display: block; height: 100%; background: var(--pfg); border-radius: 99px; transition: width .4s; }

/* ---------- utilidades ---------- */
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.bold { font-weight: 700; }
.center { text-align: center; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.flex { display: flex; } .items-center { align-items: center; } .between { justify-content: space-between; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 20px; letter-spacing: -0.03em; text-decoration: none; }
.logo-mark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, #38bdf8, #0284c7); display: grid; place-items: center; color: #fff; font-size: 16px; font-weight: 800; box-shadow: 0 4px 12px rgba(2, 132, 199, .35); }
