:root {
  --ui-font: "Plus Jakarta Sans", system-ui, sans-serif;
  --ui-font-mono: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --ui-bg: #f4f7f7;
  --ui-bg-elevated: #ffffff;
  --ui-bg-muted: #e8efef;
  --ui-border: #d5e0df;
  --ui-text: #14221f;
  --ui-text-secondary: #4a5f5b;
  --ui-text-muted: #6b7f7b;
  --ui-brand: #0f766e;
  --ui-brand-hover: #0d9488;
  --ui-brand-ink: #ffffff;
  --ui-danger: #b91c1c;
  --ui-danger-bg: #fee2e2;
  --ui-success: #15803d;
  --ui-success-bg: #dcfce7;
  --ui-info: #0e4f4a;
  --ui-info-bg: #ccfbf1;
  --ui-shadow-md: 0 8px 24px rgba(16, 34, 31, 0.08);
  --ui-radius: 12px;
  --ui-radius-lg: 16px;
}

* { box-sizing: border-box; }
html { font-size: 100%; }
html, body {
  height: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--ui-font);
  color: var(--ui-text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(15, 118, 110, 0.12), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(194, 65, 12, 0.08), transparent 50%),
    var(--ui-bg);
}

.ps-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  max-width: min(60rem, 100%);
  margin: 0 auto;
  padding: clamp(1.25rem, 4vh, 2.5rem) clamp(1rem, 3vw, 1.5rem);
}

.ps-top {
  margin-bottom: clamp(1rem, 3vh, 1.75rem);
  text-align: center;
}
.ps-brand {
  font-weight: 800;
  font-size: clamp(1.05rem, 2.4vw, 1.25rem);
  letter-spacing: -0.02em;
  color: var(--ui-brand);
  text-decoration: none;
}

.ps-main {
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
}
.ps-foot {
  margin-top: clamp(1.5rem, 4vh, 2.5rem);
  color: var(--ui-text-muted);
  font-size: 0.875rem;
  text-align: center;
}

.ps-hero {
  padding: clamp(1rem, 3vh, 2rem) 0.5rem;
  text-align: center;
}
.ps-hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.ps-hero p {
  margin: 0 auto 1.75rem;
  max-width: 36rem;
  color: var(--ui-text-secondary);
  font-size: 1.05rem;
}

.ps-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.ps-card {
  background: var(--ui-bg-elevated);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-lg);
  box-shadow: var(--ui-shadow-md);
  padding: clamp(1.25rem, 3vw, 1.75rem) clamp(1rem, 3vw, 1.5rem);
  max-width: 27.5rem;
  width: 100%;
  margin: 0 auto;
}
.ps-card--wide { max-width: 47.5rem; }
.ps-card h1 {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}
.ps-card__head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.ps-muted { color: var(--ui-text-muted); margin: 0 0 1.125rem; }
.ps-validity {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--ui-text-secondary);
}
.ps-validity strong {
  color: var(--ui-text);
  font-weight: 700;
}

.ps-form {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}
.ps-form label {
  display: grid;
  gap: 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ui-text-secondary);
}
.ps-form input {
  width: 100%;
  min-height: 2.625rem;
  border: 1px solid var(--ui-border);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font: inherit;
  color: var(--ui-text);
  background: #fff;
}
.ps-form input:focus {
  outline: 2px solid rgba(20, 184, 166, 0.45);
  border-color: var(--ui-brand);
}

.ps-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0 1.125rem;
  border-radius: 0.625rem;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

/* WCAG AA: keep white ink on brand green for all link states (visited was overriding). */
a.ps-btn--primary,
a.ps-btn--primary:link,
a.ps-btn--primary:visited,
a.ps-btn--primary:hover,
a.ps-btn--primary:active,
a.ps-btn--primary:focus,
.ps-btn--primary {
  background: var(--ui-brand);
  color: var(--ui-brand-ink) !important;
  -webkit-text-fill-color: var(--ui-brand-ink);
}
a.ps-btn--primary:hover,
.ps-btn--primary:hover {
  background: var(--ui-brand-hover);
  color: var(--ui-brand-ink) !important;
}
a.ps-btn--primary:focus-visible,
.ps-btn--primary:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.45);
  outline-offset: 2px;
}

.ps-btn--ghost,
a.ps-btn--ghost:link,
a.ps-btn--ghost:visited {
  background: transparent;
  border-color: var(--ui-border);
  color: var(--ui-text);
}
.ps-btn--ghost:hover,
a.ps-btn--ghost:hover {
  background: var(--ui-bg-muted);
  color: var(--ui-text);
}

.ps-alert {
  padding: 0.75rem 0.875rem;
  border-radius: 0.625rem;
  margin-bottom: 0.875rem;
  font-size: 0.925rem;
}
.ps-alert p {
  margin: 0 0 0.35rem;
}
.ps-alert p:last-child {
  margin-bottom: 0;
}
.ps-alert--danger { background: var(--ui-danger-bg); color: var(--ui-danger); }
.ps-alert--ok { background: var(--ui-success-bg); color: var(--ui-success); }
.ps-alert--info {
  background: var(--ui-info-bg);
  color: var(--ui-info);
  border: 1px solid rgba(15, 118, 110, 0.2);
}

.ps-welcome h1 {
  margin: 0 0 0.5rem;
}
.ps-expiry {
  margin: 0 0 0.875rem;
}
.ps-expiry__caption {
  margin: 0 0 0.25rem;
  font-size: 0.925rem;
  color: var(--ui-text-secondary);
}
.ps-expiry__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem;
  margin: 0;
}
.ps-expiry__date {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ui-text);
}

.ps-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
}
.ps-badge__dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.ps-badge--ok,
.ps-expiry .ps-badge--ok {
  background: var(--ui-success-bg);
  color: #15803d;
}
.ps-badge--ok .ps-badge__label {
  color: #15803d;
}
.ps-badge--danger,
.ps-expiry .ps-badge--danger {
  background: var(--ui-danger-bg);
  color: #b91c1c;
}
.ps-badge--danger .ps-badge__label {
  color: #b91c1c;
}

.ps-plans-lead {
  margin: 0 0 0.875rem;
  color: var(--ui-text-muted);
  font-size: 0.95rem;
}

.ps-links {
  margin-top: 1.125rem;
  font-size: 0.9rem;
}
.ps-links a { color: var(--ui-brand); }

.ps-pix-block {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.ps-pix-block label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ui-text-secondary);
}
.ps-qr-copy,
.ps-pay-url {
  width: 100%;
  border: 1px solid var(--ui-border);
  border-radius: 0.5rem;
  padding: 0.625rem 0.75rem;
  font: inherit;
  font-size: 0.85rem;
  color: var(--ui-text);
  background: var(--ui-bg-muted);
  resize: vertical;
}
.ps-pay-url {
  min-height: 2.5rem;
}
.ps-copy-btn {
  justify-self: start;
  min-height: 2.25rem;
  font-size: 0.85rem;
}

.ps-result {
  display: grid;
  gap: 0.625rem;
  margin-bottom: 1.125rem;
  padding: 0.875rem;
  background: var(--ui-bg-muted);
  border-radius: 0.625rem;
}
.ps-result div {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.95rem;
}
.ps-result strong { color: var(--ui-text-secondary); font-weight: 600; }

.ps-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.875rem;
}
.ps-plan {
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  padding: 1.125rem 1rem;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.ps-plan h2 {
  margin: 0;
  font-size: 1.05rem;
}
.ps-price {
  margin: 0.25rem 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ui-brand);
}
.ps-plan .ps-btn { margin-top: 0.625rem; width: 100%; }

@media (max-width: 35rem) {
  .ps-card__head { flex-direction: column; }
  .ps-shell {
    justify-content: flex-start;
  }
  .ps-main {
    justify-content: flex-start;
  }
}
