:root {
  --bg: #fafaf7;
  --bg-soft: #f3f2ed;
  --bg-card: #ffffff;
  --fg: #18181b;
  --fg-mute: #6b6b70;
  --fg-soft: #a1a1a8;
  --line: #e6e5df;
  --line-soft: #efeee9;
  --accent: #2563eb;
  --accent-fg: #ffffff;
  --accent-soft: #dbeafe;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --shadow-sm: 0 1px 2px rgba(15,15,15,.04), 0 0 0 1px rgba(15,15,15,.04);
  --shadow-md: 0 8px 30px rgba(15,15,15,.06), 0 2px 6px rgba(15,15,15,.04);
  --max: 1080px;
  --font-sans: "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; }

/* ─── LAYOUT ─── */
.shell {
  max-width: var(--max);
  margin: 0 auto;
  padding: 24px 24px 80px;
}

/* ─── TOPBAR ─── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0 22px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-mark {
  display: block;
  width: 26px; height: 26px;
  min-width: 26px;
  border-radius: 6px;
  object-fit: contain;
}

.brand-name {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .02em;
  color: var(--fg);
}

.brand-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-mute);
  border-left: 1px solid var(--line);
  padding-left: 12px;
  margin-left: 4px;
}

@media (max-width: 540px) {
  .brand-tag { display: none; }
}

.topbar-links a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-mute);
  margin-left: 22px;
}
.topbar-links a:hover { color: var(--fg); text-decoration: none; }

/* ─── CENTER WRAP (login/registro/verificar) ─── */
.center-wrap {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 220px);
  padding: 24px 0;
}

.card {
  width: 100%;
  max-width: 460px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 40px 36px;
  border-radius: 22px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.card h1 {
  font-size: 1.6rem;
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: -.02em;
}

.card .lead, .lead {
  color: var(--fg-mute);
  margin: 0 0 24px;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ─── FORM FIELDS ─── */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.field label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-mute);
}

.field input,
.field select,
.field textarea {
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 12px 14px;
  color: var(--fg);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  border-radius: 12px;
  transition: border-color .15s, box-shadow .15s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.password-field {
  position: relative;
}
.password-toggle {
  position: absolute;
  right: 8px;
  top: 30px;
  background: none;
  border: none;
  color: var(--fg-soft);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s;
  z-index: 2;
}
.password-toggle:hover { color: var(--fg); }
.password-toggle svg { width: 18px; height: 18px; pointer-events: none; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 480px) {
  .field-row { grid-template-columns: 1fr; gap: 0; }
}

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--fg);
  color: var(--bg);
  border: 1px solid transparent;
  padding: 13px 20px;
  font-weight: 500;
  font-size: 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .15s ease;
  width: 100%;
  text-decoration: none;
}

.btn:hover {
  background: var(--accent);
  color: var(--accent-fg);
  transform: translateY(-1px);
}
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--fg);
}
.btn-ghost:hover {
  border-color: var(--fg);
  background: transparent;
  color: var(--fg);
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-secondary:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.actions { margin-top: 18px; }

/* ─── HINTS / FLASH ─── */
.hint {
  text-align: center;
  font-size: 0.85rem;
  color: var(--fg-mute);
  margin-top: 20px;
  line-height: 1.6;
}

.flash {
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.85rem;
  margin-bottom: 16px;
  display: none;
}
.flash.show { display: block; }
.flash.error { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.flash.ok    { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }

/* ─── CODE INPUT (verificar) ─── */
.code-input input {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  letter-spacing: 0.6em;
  text-align: center;
  font-weight: 600;
  padding: 14px;
}

/* ─── DASHBOARD TOP ─── */
.dashtop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 32px;
}

.dashtop h1 {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: -.02em;
}

.dashtop .who {
  font-family: var(--font-mono);
  color: var(--fg-mute);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  margin-top: 6px;
}

/* ─── DASHBOARD TILES ─── */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 32px;
  background: var(--bg-card);
}

.tile {
  padding: 28px 26px;
  border-right: 1px solid var(--line);
  transition: background .2s;
}
.tile:last-child { border-right: none; }
.tile:hover { background: var(--bg-soft); }

@media (max-width: 720px) {
  .tile { border-right: none; border-bottom: 1px solid var(--line); }
  .tile:last-child { border-bottom: none; }
}

.tile h2 {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-mute);
  margin: 0 0 14px;
  font-weight: 500;
}

.tile .big {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tile .sub {
  color: var(--fg-mute);
  font-size: 0.8rem;
  margin-top: 8px;
  line-height: 1.5;
}

/* ─── BADGES ─── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge.ok      { color: #15803d; background: #f0fdf4; }
.badge.warn    { color: #92400e; background: #fffbeb; }
.badge.danger  { color: #b91c1c; background: #fef2f2; }
.badge.muted   { color: var(--fg-mute); background: var(--bg-soft); }

/* ─── SECTION TITLE ─── */
.section-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 36px 0 16px;
  letter-spacing: -.01em;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

/* ─── PLAN GRID ─── */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.plan {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform .2s, box-shadow .2s;
}
.plan:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.plan h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -.01em;
}

.plan .price {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--fg);
}

.plan .desc {
  color: var(--fg-mute);
  font-size: 0.85rem;
  line-height: 1.6;
}

/* ─── STORE LIST ─── */
.store-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}
.store-list li {
  background: var(--bg-card);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  transition: background .15s;
}
.store-list li:last-child { border-bottom: none; }
.store-list li:hover { background: var(--bg-soft); }
.store-list .name {
  font-weight: 600;
  font-size: 1rem;
}
.store-list .meta {
  font-family: var(--font-mono);
  color: var(--fg-mute);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  margin-top: 4px;
}
.store-list .btn,
.store-list .btn-secondary {
  width: auto;
  padding: 10px 16px;
  font-size: 13px;
}

.empty {
  text-align: center;
  color: var(--fg-mute);
  font-size: 0.9rem;
  padding: 40px 20px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  font-family: var(--font-mono);
}

.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ─── DASHBOARD: card variants ─── */
.card h3 {
  font-weight: 600;
  letter-spacing: -.01em;
  font-size: 1.1rem;
  margin: 0 0 8px;
}

.shell > .card {
  max-width: none;
}

/* responsive */
@media (max-width: 600px) {
  .shell { padding: 16px 16px 60px; }
  .card  { padding: 28px 22px; border-radius: 16px; }
  .dashtop h1 { font-size: 1.5rem; }
  .section-title { font-size: 1.05rem; }
  .plan .price { font-size: 1.6rem; }
  .topbar-links a { margin-left: 14px; }
}
