:root {
  --brand-teal: #08a7a5;
  --brand-teal-dark: #057f82;
  --brand-orange: #f5821f;
  --brand-orange-dark: #e65312;
  --ink: #101828;
  --muted: #667085;
  --line: #d8e0dc;
  --paper: #fffdfa;
  --surface: rgba(255, 255, 255, 0.92);
  --shadow: 0 24px 80px rgba(11, 19, 36, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(245, 130, 31, 0.12) 0 22%, transparent 22% 100%),
    linear-gradient(155deg, transparent 0 58%, rgba(8, 167, 165, 0.16) 58% 100%),
    linear-gradient(180deg, #fffaf2 0%, #f5f8f7 52%, #edf8f7 100%);
  color: var(--ink);
  font-family: "Instrument Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand img {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 16px 34px rgba(17, 19, 18, 0.14);
}

.brand strong {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: 20px;
}

.brand small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.workspace {
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: 18px;
  align-items: start;
}

.summary-panel,
.flow-panel {
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.summary-panel {
  position: sticky;
  top: 20px;
  display: grid;
  gap: 22px;
  padding: 24px;
}

.eyebrow,
.mini-label {
  margin: 0;
  color: var(--brand-teal-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: 0;
}

h1 {
  margin-top: 10px;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 0.96;
}

h2 {
  font-size: clamp(24px, 3vw, 34px);
}

h3 {
  font-size: 26px;
}

.summary-copy {
  color: var(--muted);
  line-height: 1.65;
}

.selected-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  padding: 18px;
}

dl {
  display: grid;
  gap: 12px;
  margin: 0;
}

dl div,
.total-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #eef2f0;
  padding-top: 12px;
}

dt,
.total-line span {
  color: var(--muted);
  font-size: 13px;
}

dd {
  margin: 0;
  text-align: right;
  font-weight: 700;
}

.total-line strong {
  font-size: 20px;
}

.flow-panel {
  min-height: 690px;
  padding: 24px;
}

.flow-step {
  display: grid;
  gap: 20px;
}

.hidden {
  display: none !important;
}

.step-heading {
  display: grid;
  gap: 8px;
}

.compact-heading {
  gap: 6px;
  margin-top: 2px;
}

.compact-heading h3 {
  font-size: 20px;
}

.plan-grid,
.method-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.app-lock-card {
  border: 1px solid rgba(8, 167, 165, 0.26);
  border-radius: 18px;
  background: #fff;
  padding: 18px;
}

.app-lock-card strong {
  display: block;
  margin-top: 6px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 24px;
}

.app-lock-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.option-card {
  display: grid;
  gap: 12px;
  min-height: 154px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  padding: 18px;
  text-align: left;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.plan-card {
  min-height: 68px;
  gap: 7px;
  padding: 13px;
}

.plan-card strong {
  font-size: 18px;
}

.plan-card span:not(.tag-pill) {
  font-size: 13px;
  line-height: 1.35;
}

.plan-card .price {
  font-size: 14px;
}

.option-card:hover {
  border-color: rgba(8, 167, 165, 0.45);
  transform: translateY(-1px);
}

.option-card.selected {
  border-color: var(--brand-orange);
  box-shadow: inset 0 4px 0 var(--brand-orange), 0 18px 38px rgba(245, 130, 31, 0.12);
}

.option-card strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 20px;
}

.option-heading {
  display: grid;
  gap: 10px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  background: rgba(245, 130, 31, 0.13);
  color: var(--brand-orange-dark);
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.option-card span {
  color: var(--muted);
  line-height: 1.5;
}

.price {
  margin-top: auto;
  color: var(--brand-teal-dark);
  font-weight: 800;
}

.price-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid.compact {
  margin-top: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 14px;
  font-weight: 700;
}

label.wide,
.wide {
  grid-column: 1 / -1;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 14px 15px;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

input:focus,
select:focus {
  border-color: var(--brand-orange);
  box-shadow: 0 0 0 4px rgba(245, 130, 31, 0.13);
}

.phone-combo {
  display: grid;
  grid-template-columns: minmax(190px, 0.42fr) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.phone-combo:focus-within {
  border-color: var(--brand-orange);
  box-shadow: 0 0 0 4px rgba(245, 130, 31, 0.13);
}

.phone-combo select,
.phone-combo input {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.phone-combo select {
  border-right: 1px solid var(--line);
  background: #f8fbfa;
  color: var(--ink);
  font-weight: 800;
  min-width: 0;
}

.phone-combo input:focus,
.phone-combo select:focus {
  box-shadow: none;
}

.installment-panel {
  border: 1px solid rgba(8, 167, 165, 0.22);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  padding: 14px;
}

.actions-row {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 4px;
}

.primary-button,
.ghost-button {
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  padding: 0 18px;
  font-weight: 800;
}

.primary-button {
  background: linear-gradient(135deg, var(--brand-orange), var(--brand-orange-dark) 54%, var(--brand-teal-dark));
  color: #fff;
  box-shadow: 0 16px 32px rgba(245, 130, 31, 0.22);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.ghost-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.card-preview {
  display: flex;
  flex-direction: column;
  width: min(100%, 520px);
  aspect-ratio: 1.586 / 1;
  overflow: hidden;
  border-radius: 18px;
  background:
    radial-gradient(circle at top left, rgba(245, 130, 31, 0.34), transparent 34%),
    linear-gradient(135deg, #101828, #073e42 72%, #057f82);
  color: #fff;
  padding: clamp(18px, 4vw, 26px);
  box-shadow: 0 18px 44px rgba(16, 24, 40, 0.22);
}

.card-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card-topline div {
  display: grid;
  gap: 8px;
}

.card-brand-badge,
.card-topline em,
.card-topline small {
  font-style: normal;
}

.card-topline em {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  padding: 7px 10px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.card-preview span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.card-chip {
  width: 56px;
  height: 40px;
  margin-top: auto;
  border-radius: 13px;
  background:
    linear-gradient(90deg, transparent 31%, rgba(255, 255, 255, 0.18) 31% 34%, transparent 34% 66%, rgba(255, 255, 255, 0.18) 66% 69%, transparent 69%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.12));
}

.card-preview strong {
  display: block;
  margin-top: 18px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(22px, 4vw, 32px);
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.card-meta {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) 0.72fr 0.5fr;
  gap: 12px;
  margin-top: 18px;
}

.card-meta div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.card-meta small,
.card-topline small {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.92);
  font-size: 14px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inline-alert {
  border-radius: 14px;
  padding: 14px 15px;
  font-size: 14px;
  font-weight: 700;
}

.inline-alert.error {
  border: 1px solid #fecaca;
  background: #fff1f2;
  color: #9f1239;
}

.inline-alert.success,
.inline-alert.info {
  border: 1px solid #bae6fd;
  background: #f0f9ff;
  color: #075985;
}

.result-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: 18px;
  border-radius: 20px;
  background: #101828;
  color: #fff;
  padding: 22px;
}

.result-panel p {
  color: rgba(255, 255, 255, 0.7);
}

.qrcode-wrapper {
  display: grid;
  justify-items: center;
  gap: 14px;
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  padding: 18px;
}

#result-debug {
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  padding: 14px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  white-space: pre-wrap;
}

.site-footer {
  margin-top: 32px;
  background: #032f36;
  color: #d7e2e4;
  padding: 32px 0;
}

.footer-inner {
  display: grid;
  gap: 24px;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 0 24px;
}

.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.footer-brand img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
}

.footer-brand p {
  margin: 0;
  color: #fff;
  font-family: "Space Grotesk", sans-serif;
  font-size: 19px;
  font-weight: 800;
}

.footer-brand span,
.footer-company,
.footer-info {
  color: #b8c9cc;
  font-size: 14px;
}

.footer-company {
  margin: 0;
}

.footer-info {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
}

.footer-info p {
  margin: 0;
}

.footer-info p:last-child {
  text-align: right;
}

.footer-info span {
  margin: 0 6px;
  color: #6f888d;
}

.footer-link {
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.footer-link:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .shell {
    padding: 14px;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .summary-panel {
    display: none;
    position: static;
  }

  body[data-step="payment"] .summary-panel {
    display: grid;
  }

  .method-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .plan-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .actions-row {
    flex-direction: column-reverse;
  }

  .primary-button,
  .ghost-button {
    width: 100%;
  }

  .footer-top,
  .footer-info {
    grid-template-columns: 1fr;
  }

  .footer-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-info p:last-child {
    text-align: left;
  }

}

@media (max-width: 540px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .summary-panel,
  .flow-panel {
    border-radius: 18px;
    padding: 18px;
  }

  h1 {
    font-size: 36px;
  }

  .phone-combo {
    grid-template-columns: minmax(132px, 0.42fr) minmax(0, 1fr);
  }

  .phone-combo select {
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .card-preview {
    border-radius: 16px;
  }

  .card-meta {
    grid-template-columns: 1fr 0.72fr 0.5fr;
    gap: 8px;
  }
}
