@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap");

/* ─── Reset + tokens ─── */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #F3F3F3;
  --surface:      #ffffff;
  --surface-soft: #EBEBEB;
  --ink:          #212121;
  --ink-2:        #374151;
  --muted:        #616161;
  --line:         #E0E0E0;
  --line-dark:    #C9C9C9;
  --error:        #B91C1C;
  --success-bg:   #E6F4EA;
  --success-fg:   #1A6B2E;
}

body {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--ink-2); }

/* ─── Nav ─── */

.portal-nav {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 20;
}
.portal-nav-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.portal-nav .logo {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.portal-nav .brand {
  display: inline-flex;
  align-items: center;
}
.portal-nav img {
  height: 24px;
}
.portal-nav .help {
  font-size: 12px;
  color: var(--muted);
  font-family: 'IBM Plex Mono', monospace;
}

/* ─── Shell ─── */

.portal-shell {
  max-width: 860px;
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
}
.portal-shell.narrow { max-width: 560px; }
.portal-shell.centered {
  min-height: calc(100vh - 170px);
  display: flex;
  align-items: center;
}

/* ─── Progress ─── */

.progress {
  height: 2px;
  background: var(--line);
  margin-bottom: 1rem;
}
.progress-fill {
  height: 100%;
  background: var(--ink-2);
  transition: width .3s;
}

/* ─── Step indicator ─── */

.step-indicator {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: .04em;
}
.portal-flow-intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 0 0 1.5rem;
}
.portal-flow-copy {
  max-width: 560px;
}
.portal-kicker {
  display: inline-block;
  margin-bottom: .6rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.portal-flow-copy h1,
.portal-flow-copy h2 {
  font-size: 1.75rem;
  line-height: 1.15;
  letter-spacing: -.02em;
  color: var(--ink);
  margin-bottom: .5rem;
}
.portal-flow-copy p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}
.portal-side-note {
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 1rem;
  box-shadow: 0 20px 40px rgba(0,0,0,.03);
}
.portal-side-note strong {
  display: block;
  margin-bottom: .4rem;
  font-size: 14px;
  color: var(--ink);
}
.portal-side-note p {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}
.portal-ref {
  display: inline-block;
  margin-top: .75rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: #9CA3AF;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.step-indicator .i         { color: var(--line-dark); }
.step-indicator .i.active  { color: var(--ink); font-weight: 500; }
.step-indicator .i.done    { color: var(--success-fg); }

/* ─── Card ─── */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2.5rem;
  box-shadow: 0 20px 40px rgba(0,0,0,.04);
}
.card h1 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: .5rem;
  letter-spacing: -.01em;
}
.card .sub {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 2rem;
}
.card.center { text-align: center; }
.card p strong { color: var(--ink); }

/* ─── Field ─── */

.field { margin-bottom: 1.25rem; }
.field label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: .02em;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  background: var(--surface-soft);
  border: 1px solid var(--line-dark);
  border-radius: 2px;
  padding: 10px 12px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: border-color .2s, background .2s;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--ink-2);
  background: var(--surface);
}
.field .hint {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  font-family: 'IBM Plex Mono', monospace;
}
.field.error input  { border-color: var(--error); }
.field.error .hint  { color: var(--error); }

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

/* ─── Buttons ─── */

.actions {
  display: flex;
  gap: .75rem;
  margin-top: 2rem;
  justify-content: space-between;
  align-items: center;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  letter-spacing: .02em;
  transition: all .2s;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary              { background: var(--ink-2); color: #fff; border-color: var(--ink-2); }
.btn-primary:hover        { background: #1F2937; color: #fff; border-color: #1F2937; }
.btn-primary:disabled     { background: var(--line-dark); border-color: var(--line-dark); cursor: not-allowed; }
.btn-secondary            { background: transparent; color: var(--ink); border-color: var(--line-dark); }
.btn-secondary:hover      { background: var(--surface-soft); }

/* ─── Summary rows ─── */

.summary { border-top: 1px solid var(--line); }
.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.summary-row .k { color: var(--muted); }
.summary-row .v { color: var(--ink); font-weight: 500; }

/* ─── Success ─── */

.success-mark {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--success-bg);
  color: var(--success-fg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin: 0 auto 1.5rem;
}
.success-wrap { text-align: center; padding: 2rem 0; }

/* ─── Footer ─── */

.portal-footer {
  padding: 24px 2rem 36px;
  border-top: 1px solid var(--line);
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #8a8a8a;
}
.portal-links {
  display: grid;
  gap: .75rem;
  margin-top: 1.5rem;
}
.portal-links .btn { width: 100%; }

/* ─── Redirect notice ─── */

.redirect-notice {
  background: #fefce8;
  border: 1px solid #e9d46a;
  border-radius: 2px;
  padding: 10px 14px;
  font-size: 13px;
  color: #4a3800;
  margin-bottom: 1rem;
}
.redirect-notice:empty { display: none; }

/* ─── Error text (standalone) ─── */

.error-text {
  min-height: 18px;
  color: var(--error);
  font-size: 12px;
  font-weight: 500;
  margin-bottom: .5rem;
}

/* ─── Dev hint ─── */

.dev-hint {
  background: #f2f2f2;
  border: 1px dashed #cfcfcf;
  border-radius: 2px;
  padding: 10px 12px;
  font-size: 12px;
  font-family: 'IBM Plex Mono', monospace;
  margin-bottom: .75rem;
}

/* ─── Address autocomplete ─── */

.suggestions {
  list-style: none;
  border: 1px solid var(--line-dark);
  background: #f7f7f7;
  margin-top: 2px;
}
.suggestion-item {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  font-size: 12px;
  cursor: pointer;
  font-family: 'IBM Plex Sans', sans-serif;
}
.suggestion-item:last-child { border-bottom: 0; }
.suggestion-item:hover { background: var(--surface-soft); }
.suggestion-item--no-number { color: #999; font-style: italic; }
.suggestion-item--no-number:hover { background: #f5f5f5; }
.suggestion-empty { padding: 10px 12px; font-size: 12px; color: var(--muted); }

input.address-confirmed { border-color: #22863a; background: #f0faf2; }
input.address-modified  { border-color: #b45309; background: #fffbeb; }

.address-mode-toggle-wrap { margin: 6px 0 0; }
.address-fallback-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  text-align: left;
  font-family: 'IBM Plex Sans', sans-serif;
}
.address-fallback-btn:hover { color: var(--ink); }

/* ─── Checkbox / legal ─── */

.checkbox-line {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  margin-bottom: .75rem;
}
.checkbox-line input { margin-top: 2px; flex-shrink: 0; }

.legal-scroller {
  background: #f1f1f1;
  border: 1px solid var(--line-dark);
  border-radius: 2px;
  padding: 14px;
  max-height: 180px;
  overflow: auto;
  font-size: 12px;
  color: #484848;
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

/* ─── Pricing card (step 4) ─── */

.pricing-card {
  border: 1px solid var(--line-dark);
  border-radius: 2px;
  background: var(--bg);
  padding: 20px;
  margin-bottom: 1.25rem;
  text-align: center;
}
.pricing-plan-name {
  margin: 0 0 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: 'IBM Plex Mono', monospace;
}
.pricing-price {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.02em;
  font-family: 'IBM Plex Mono', monospace;
}
.pricing-note {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  font-family: 'IBM Plex Mono', monospace;
}

/* ─── MercadoPago button ─── */

.mp-button { border-left: 3px solid #009ee3; }

/* ─── Subscription badge ─── */

.subscription-badge {
  display: inline-block;
  margin: 10px auto 1rem;
  padding: 6px 14px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-family: 'IBM Plex Mono', monospace;
  border-radius: 2px;
}
.subscription-badge.authorized { background: var(--success-bg); color: var(--success-fg); border: 1px solid #a8d5b5; }
.subscription-badge.pending    { background: #fef9e7; color: #7a5700; border: 1px solid #e9d46a; }

/* ─── Pago summary ─── */

.pago-summary {
  background: var(--bg);
  border: 1px solid var(--line-dark);
  border-radius: 2px;
  padding: 14px 16px;
  margin-bottom: 1rem;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}
.pago-summary strong { color: var(--ink); }

/* ─── Responsive ─── */

@media (max-width: 600px) {
  .portal-shell         { padding: 1.5rem 1rem 3rem; }
  .card                 { padding: 1.5rem; }
  .field-row            { grid-template-columns: 1fr; }
  .step-indicator       { gap: .75rem; font-size: 10px; flex-wrap: wrap; }
  .portal-flow-intro    { flex-direction: column; }
  .portal-side-note     { min-width: 0; width: 100%; }
  .actions              { flex-direction: column-reverse; }
  .actions .btn         { width: 100%; }
}
