:root {
  --navy: #071a33;
  --navy-2: #102b4e;
  --blue: #1677ff;
  --sky: #dceeff;
  --orange: #ff8a1f;
  --ink: #142033;
  --muted: #607087;
  --line: #dce4ed;
  --surface: #ffffff;
  --background: #f3f7fb;
  --success: #137a4f;
  --danger: #b42318;
  --shadow: 0 20px 60px rgba(7, 26, 51, .12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--background);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--background); }
body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top right, rgba(22,119,255,.12), transparent 34rem),
    linear-gradient(180deg, #f9fbfd 0%, var(--background) 100%);
}
button, input { font: inherit; }

.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  color: white;
  background: var(--navy);
  box-shadow: 0 8px 26px rgba(7,26,51,.18);
}
.brand { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 13px;
  display: grid; place-items: center;
  font-weight: 900; font-size: 1.25rem;
  color: var(--navy); background: linear-gradient(135deg, white, var(--sky));
}
.brand strong { display: block; font-size: .95rem; line-height: 1.2; }
.brand span { display: block; margin-top: .15rem; font-size: .76rem; color: #bdcce0; }
.help-link {
  border: 0; padding: .65rem .9rem; border-radius: 999px;
  color: white; background: rgba(255,255,255,.1); cursor: pointer;
}
.help-link:hover { background: rgba(255,255,255,.18); }

.main {
  width: min(100% - 2rem, 720px);
  margin: clamp(1.5rem, 5vw, 3.5rem) auto;
  flex: 1;
}
.status-strip { margin-bottom: 1rem; }
.progress-track {
  height: 7px; overflow: hidden; border-radius: 999px; background: #dce5ef;
}
.progress-fill {
  height: 100%; width: 20%; border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--orange));
  transition: width .35s ease;
}
.progress-copy {
  display: flex; justify-content: space-between; gap: 1rem;
  margin-top: .6rem; font-size: .78rem; color: var(--muted);
}
.card {
  position: relative;
  min-height: 520px;
  padding: clamp(1.25rem, 5vw, 2.5rem);
  border: 1px solid rgba(220,228,237,.8);
  border-radius: 24px;
  background: rgba(255,255,255,.96);
  box-shadow: var(--shadow);
}
.hero-icon {
  width: 66px; height: 66px; border-radius: 20px;
  display: grid; place-items: center;
  margin-bottom: 1.4rem;
  font-size: 1.8rem;
  color: var(--navy); background: var(--sky);
}
.eyebrow {
  display: inline-flex; align-items: center; gap: .4rem;
  margin-bottom: .65rem; font-size: .76rem; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase; color: var(--blue);
}
h1 { margin: 0; color: var(--navy); font-size: clamp(1.8rem, 7vw, 2.7rem); line-height: 1.06; }
h2 { color: var(--navy); }
.lead { margin: 1rem 0 1.5rem; color: var(--muted); font-size: 1.02rem; line-height: 1.6; }
.summary {
  display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .75rem;
  margin: 1.4rem 0;
}
.summary-item {
  padding: 1rem; border: 1px solid var(--line); border-radius: 16px; background: #fbfdff;
}
.summary-item span { display: block; font-size: .76rem; color: var(--muted); }
.summary-item strong { display: block; margin-top: .25rem; color: var(--navy); }
.notice {
  display: flex; gap: .7rem; align-items: flex-start;
  padding: .9rem 1rem; border-radius: 14px;
  color: #684010; background: #fff4df; font-size: .86rem; line-height: 1.45;
}
.notice.success { color: #0d5d3b; background: #e9f8f1; }
.form-grid { display: grid; gap: 1rem; margin-top: 1.5rem; }
.field label { display: block; margin-bottom: .42rem; color: var(--navy); font-size: .86rem; font-weight: 750; }
.field input {
  width: 100%; min-height: 54px; padding: .85rem 1rem;
  border: 1px solid #cbd7e4; border-radius: 14px; outline: none;
  color: var(--ink); background: white;
}
.field input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(22,119,255,.12); }
.field small { display: block; margin-top: .4rem; color: var(--muted); }
.actions { display: grid; gap: .75rem; margin-top: 1.5rem; }
.primary-button, .secondary-button {
  min-height: 54px; border-radius: 14px; padding: .85rem 1rem;
  display: inline-flex; justify-content: center; align-items: center;
  border: 0; text-align: center; font-weight: 800; text-decoration: none; cursor: pointer;
}
.primary-button { color: white; background: linear-gradient(135deg, var(--blue), #0858c7); }
.primary-button:hover { filter: brightness(1.04); }
.primary-button:disabled { opacity: .55; cursor: wait; }
.secondary-button { color: var(--navy); background: #edf3f9; }
.small-copy { margin-top: 1rem; color: var(--muted); font-size: .78rem; text-align: center; line-height: 1.45; }
.otp {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: .45rem; margin: 1.5rem 0;
}
.otp input {
  width: 100%; aspect-ratio: 1; min-width: 0;
  border: 1px solid #cbd7e4; border-radius: 12px; text-align: center;
  font-size: 1.3rem; font-weight: 800; color: var(--navy);
}
.contract-frame {
  width: 100%; height: 330px; margin-top: 1rem;
  border: 1px solid var(--line); border-radius: 16px; background: #f7f9fc;
}
.mock-contract {
  height: 100%; overflow: auto; padding: 1.25rem; color: #394960; line-height: 1.55;
}
.mock-contract h3 { margin-top: 0; color: var(--navy); }
.check-row { display: flex; gap: .65rem; align-items: flex-start; margin-top: 1rem; font-size: .84rem; color: var(--muted); }
.payment-box {
  margin: 1.5rem 0; padding: 1.15rem; border: 1px solid var(--line);
  border-radius: 18px; background: #fbfdff;
}
.payment-line { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; }
.payment-line.total { margin-top: .4rem; padding-top: .9rem; border-top: 1px solid var(--line); font-size: 1.15rem; font-weight: 900; color: var(--navy); }
.loader {
  width: 54px; height: 54px; margin: 3rem auto 1.2rem; border: 6px solid #dce9f7;
  border-top-color: var(--blue); border-radius: 50%; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.center { text-align: center; }
.qr-wrap {
  width: min(100%, 330px); margin: 1.35rem auto; padding: 1rem;
  border: 1px solid var(--line); border-radius: 22px; background: white;
  box-shadow: 0 12px 35px rgba(7,26,51,.10);
}
#accessQr canvas, #accessQr img { width: 100% !important; height: auto !important; display: block; }
.pass-meta { display: flex; justify-content: center; gap: .6rem; flex-wrap: wrap; }
.pill {
  display: inline-flex; gap: .35rem; align-items: center;
  padding: .5rem .75rem; border-radius: 999px; font-size: .78rem; font-weight: 800;
  color: var(--success); background: #e9f8f1;
}
.pill.warning { color: #76420d; background: #fff2dc; }
.security-list {
  display: grid; gap: .7rem; margin: 1.25rem 0 0; padding: 0; list-style: none; text-align: left;
}
.security-list li { display: flex; gap: .7rem; align-items: flex-start; color: var(--muted); font-size: .85rem; }
.security-list strong { color: var(--navy); }
.footer {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 1.2rem clamp(1rem, 4vw, 3rem); color: #76869a; font-size: .72rem;
}
.help-dialog {
  width: min(100% - 2rem, 430px); border: 0; border-radius: 22px;
  padding: 2rem; box-shadow: var(--shadow);
}
.help-dialog::backdrop { background: rgba(7,26,51,.55); backdrop-filter: blur(4px); }
.dialog-close {
  position: absolute; right: 1rem; top: .8rem; border: 0; background: transparent;
  font-size: 1.8rem; color: var(--muted); cursor: pointer;
}
.help-dialog .primary-button, .help-dialog .secondary-button { margin-top: .7rem; width: 100%; }

@media (max-width: 560px) {
  .main { width: min(100% - 1rem, 720px); margin-top: .8rem; }
  .card { min-height: 610px; border-radius: 20px; padding: 1.2rem; }
  .progress-copy { flex-direction: column; gap: .2rem; }
  .summary { grid-template-columns: 1fr; }
  .footer { flex-direction: column; }
  .brand strong { font-size: .82rem; }
  .brand span { display: none; }
}
