:root {
  --brand: #6e56f8;
  --brand-dark: #5a43e0;
  --accent: #fd7301;
  --text: #1f2330;
  --muted: #5b6172;
  --bg: #ffffff;
  --bg-alt: #f1efff;
  --border: #e5e7eb;
  --card: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #8c78ff;
    --brand-dark: #a596ff;
    --text: #eceef4;
    --muted: #a7acbb;
    --bg: #12131a;
    --bg-alt: #1b1c27;
    --border: #2c2e3c;
    --card: #1b1c27;
  }
}

* { box-sizing: border-box; }
/* `hidden` must win over the display of any class (e.g. .account-box is a flex box). */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}
img { max-width: 100%; height: auto; }
/* Links in text (not buttons): the brand colour, readable in light and dark. */
main a:not(.btn):not(.brand) { color: var(--brand); font-weight: 600; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

.site-header { border-bottom: 1px solid var(--border); background: var(--bg); position: sticky; top: 0; z-index: 10; }
.header-row { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.25rem; color: var(--text); text-decoration: none; }

.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid var(--brand);
  transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn-small { padding: 8px 16px; font-size: .95rem; }
.btn-large { padding: 16px 32px; font-size: 1.15rem; }
.btn-ghost { background: transparent; color: var(--brand); }
.btn-ghost:hover { background: var(--bg-alt); color: var(--brand); }
.btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }

.hero { padding: 64px 0 48px; }
.hero-grid { display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: center; }
.hero-icon { width: 256px; border-radius: 56px; box-shadow: 0 20px 50px rgba(110, 86, 248, .3); }
.eyebrow { color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .85rem; margin-bottom: .5em; }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 36em; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

.section { padding: 56px 0; }
.section-alt { background: var(--bg-alt); }
/* Anchor jumps land below the sticky header. */
section[id] { scroll-margin-top: 64px; }

.features { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.features li { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 20px; }
.features p { color: var(--muted); margin: 0; font-size: .97rem; }

.pill { display: inline-block; margin: 0 0 8px; padding: 4px 12px; border-radius: 999px; background: var(--brand); color: #fff; font-size: .85rem; font-weight: 700; }

.features-art li { text-align: center; }
.feature-art { display: block; width: 160px; height: 120px; margin: 0 auto 12px; }

.plans { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.plans > li { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 24px; }
.plans > li.plan-featured { border: 2px solid var(--brand); }
.plan-tag { color: var(--muted); font-size: .95rem; }
.plan-price { font-size: 1.8rem; font-weight: 800; margin: .2em 0 0; }
.plan-period { font-size: 1rem; font-weight: 600; color: var(--muted); }
.plan-annual { color: var(--muted); font-size: .9rem; margin: 0 0 .8em; }
.plan-list { padding-left: 1.2em; margin: 0; }
.plan-list li { margin-bottom: .35em; }
.plans-note { color: var(--muted); margin-top: 20px; max-width: 46em; }

.download { max-width: 720px; }
.download-box { background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 28px; text-align: center; margin: 24px 0 32px; }
.download-meta { color: var(--muted); font-size: .95rem; margin: 12px 0 0; }
.steps { padding-left: 1.3em; }
.steps li { margin-bottom: .5em; }

.faq { max-width: 720px; }
.faq details { border-bottom: 1px solid var(--border); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq details p { color: var(--muted); margin: 10px 0 0; }

/* Customer card (/c/<id>): always white, so the barcode reads in dark mode too. */
.customer { max-width: 560px; }
.customer-card { background: #fff; color: #1b1b1f; border: 1px solid var(--border); border-radius: 20px; padding: 24px 20px; text-align: center; box-shadow: 0 12px 32px rgba(110, 86, 248, .15); }
.customer-label { color: #5b6172; font-size: .9rem; margin: 0; }
.customer-id { font-size: clamp(1.8rem, 8vw, 2.6rem); font-weight: 800; letter-spacing: .01em; margin: 0 0 12px; overflow-wrap: anywhere; }
.customer-barcode { display: block; width: 100%; height: 110px; }
.customer-code { color: #5b6172; font-size: .85rem; letter-spacing: .08em; margin: 6px 0 0; }
.customer-help { color: var(--muted); margin: 16px 0; }
.customer-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.customer-actions .btn { flex: 1 1 200px; text-align: center; cursor: pointer; font: inherit; font-weight: 700; }
.wallet-btn { background: #000; border-color: #000; }
.wallet-btn:hover { background: #222; border-color: #222; }
/* The invite to create an account, above the save/share buttons: it has to stand out from them. */
.account-box.account-invite { border: 2px solid var(--brand); background: var(--bg-alt); }
.account-box.account-invite p strong { color: var(--text); }
.account-box.account-invite .btn { align-self: flex-start; text-align: center; }
.customer-actions-title { font-size: 1rem; color: var(--muted); margin: 20px 0 10px; }
.customer-note { color: var(--muted); font-size: .95rem; min-height: 1.6em; margin-top: 12px; }

/* Mi cuenta de cliente (/mi-cuenta). */
.account { max-width: 720px; }
.account-box { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 20px; margin: 16px 0; display: flex; flex-direction: column; gap: 10px; }
.account-box h2 { font-size: 1.1rem; margin: 0; }
.account-box p { color: var(--muted); margin: 0; font-size: .95rem; }
.account-box input, .account-box select { font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); }
.account-box .btn { cursor: pointer; font: inherit; font-weight: 700; }
.phone-row { display: flex; gap: 8px; }
.header-actions { display: flex; gap: 8px; align-items: center; }
.header-actions .btn { white-space: nowrap; }
@media (max-width: 420px) {
  .header-actions { gap: 6px; }
  .header-actions .btn-small { padding: 7px 12px; font-size: .9rem; }
}
/* Too narrow for the wordmark and both buttons: the logo alone (the link keeps its label). */
@media (max-width: 380px) {
  .site-header:has(.header-actions) .brand span { display: none; }
}
.phone-row input { flex: 1; min-width: 0; }
.account-hint { color: var(--muted); font-size: .95rem; }
.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.account-grid .account-box { margin: 0; }
.account-soon { border-style: dashed; }
.account-delete #delete-panel, .account-delete #delete-review, .account-delete form { display: flex; flex-direction: column; gap: 10px; }
.account-delete .btn { align-self: flex-start; }
.account-delete-list { margin: 0; padding-left: 20px; color: var(--muted); font-size: .95rem; }
.account-delete-list li { margin: 4px 0; }
.account-delete-check { display: flex; align-items: center; gap: 8px; }
.account-delete-check input { width: 18px; height: 18px; padding: 0; }
.btn-danger { background: #d92d20; border-color: #d92d20; color: #fff; }
.btn-danger:hover { background: #b42318; border-color: #b42318; color: #fff; }
.btn-danger:disabled { opacity: .5; cursor: not-allowed; }
.btn-danger-ghost { color: #d92d20; border-color: transparent; padding-left: 0; }
.btn-danger-ghost:hover { color: #b42318; background: transparent; text-decoration: underline; }
/* Landing: the customers section's call to action for customers themselves. */
.customer-cta { max-width: 560px; margin-top: 24px; }
.customer-cta .btn { align-self: flex-start; }
.customer-picker { display: flex; flex-direction: column; gap: 6px; margin: 16px 0 0; font-weight: 600; }
.customer-picker select { font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--card); color: var(--text); }
.account-settings { margin-top: 8px; }
.account-box label, .account-change label { font-weight: 600; font-size: .95rem; }
.link-btn { background: none; border: 0; padding: 8px 0; color: var(--brand); font: inherit; font-weight: 700; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.account-change { display: flex; flex-direction: column; gap: 10px; padding-top: 10px; }
.account-change input { font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); }
.account-change .btn { cursor: pointer; font: inherit; font-weight: 700; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
/* The live check of a number being chosen. */
.id-check { font-size: .95rem; font-weight: 600; min-height: 0; }
.id-check:empty { display: none; }
.id-check.pending { color: var(--muted); }
.id-check.ok { color: #067647; }
.id-check.taken, .id-check.bad { color: #b42318; }
@media (prefers-color-scheme: dark) {
  .id-check.ok { color: #75e0a7; }
  .id-check.taken, .id-check.bad { color: #fda29b; }
}
.id-suggestions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; font-weight: 400; color: var(--muted); }
.id-suggestion { border: 1px solid var(--brand); color: var(--brand); background: transparent; border-radius: 999px; padding: 4px 12px; font: inherit; font-weight: 600; cursor: pointer; }
.id-suggestion:hover { background: var(--bg-alt); }
/* An error right under the field it's about — red box, readable in both themes. */
.form-alert {
  margin: 0;
  padding: 10px 12px 10px 38px;
  border: 1px solid #f5a3a3;
  border-left: 4px solid #d92d20;
  border-radius: 10px;
  background: #fef3f2 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23d92d20'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z'/%3E%3C/svg%3E") no-repeat 11px 11px / 18px;
  color: #b42318;
  font-weight: 600;
  font-size: .95rem;
}
.account-box .form-alert { color: #b42318; }
.account-box input[aria-invalid="true"],
.account-box input[aria-invalid="true"]:focus { border-color: #d92d20; outline: 2px solid #d92d20; outline-offset: 1px; box-shadow: 0 0 0 4px rgba(217, 45, 32, .18); }
@media (prefers-color-scheme: dark) {
  .form-alert, .account-box .form-alert { background-color: #3a1513; border-color: #7a271a; border-left-color: #f97066; color: #fecdca; }
}
.account-customer { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 20px; margin: 16px 0; }
.account-customer-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.account-customer-id { font-size: 1.6rem; font-weight: 800; margin: 0; overflow-wrap: anywhere; }
.account-total { font-weight: 700; color: var(--brand); margin: 8px 0; }
.account-org { border-top: 1px solid var(--border); padding: 10px 0; }
.account-org summary { cursor: pointer; display: flex; justify-content: space-between; gap: 12px; }
.account-branches { list-style: none; padding: 0; margin: 8px 0 0; }
.account-branches li { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .95rem; padding: 4px 0; flex-wrap: wrap; }

/* Legal pages (/privacidad): readable line length. */
.legal { max-width: 760px; }
.legal h2 { margin-top: 1.6em; font-size: clamp(1.25rem, 3vw, 1.5rem); }
.legal h3 { margin-top: 1.2em; font-size: 1.05rem; }
.legal li { margin-bottom: .4em; }
.legal-meta { color: var(--muted); font-size: .95rem; }

.site-footer { border-top: 1px solid var(--border); padding: 24px 0; color: var(--muted); font-size: .9rem; }
.site-footer a { color: inherit; }

@media (max-width: 720px) {
  .hero { padding-top: 40px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-icon { order: -1; width: 128px; border-radius: 28px; }
}
