/* ==========================================================================
   SurePay — sandbox access request
   Loaded after docs.css: reuses its tokens (light and dark), header and buttons.
   ========================================================================== */

.sb-page { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg-side); }

.sb {
  flex: 1; width: 100%; max-width: 1180px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 540px);
  gap: clamp(32px, 6vw, 88px); align-items: start;
  padding: calc(var(--top) + clamp(32px, 6vw, 72px)) clamp(16px, 4vw, 40px) 56px;
}

/* ── intro ─────────────────────────────────────────────────────────────── */
.sb__intro { padding-top: 8px; }
.sb__back {
  display: inline-flex; align-items: center; gap: 4px; margin: 0 0 28px -8px; padding: 6px 12px 6px 6px;
  border-radius: 9px; font-size: .86rem; font-weight: 600; color: var(--body);
}
.sb__back svg { width: 17px; height: 17px; }
.sb__back:hover { background: var(--surface); color: var(--accent-deep); text-decoration: none; }
.sb__eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: .8rem; }
.sb__intro h1 { font-size: clamp(2rem, 3.6vw, 3rem); letter-spacing: -.04em; line-height: 1.08; max-width: 16ch; }
.sb__lead { margin-top: 1.1rem; max-width: 52ch; font-size: 1.02rem; line-height: 1.7; }
.sb__perks { list-style: none; margin: 2.2rem 0 0; padding: 0; display: grid; gap: 18px; max-width: 52ch; }
.sb__perks li { display: flex; gap: 14px; align-items: flex-start; }
.sb__perks svg {
  flex: none; width: 38px; height: 38px; padding: 9px; border-radius: 11px;
  background: var(--accent-soft); color: var(--accent-deep);
}
.sb__perks b { display: block; color: var(--ink); font-size: .95rem; font-weight: 700; }
.sb__perks span { display: block; font-size: .9rem; line-height: 1.6; }
.sb__perks code { font-family: var(--mono); font-size: .84em; padding: .1em .38em; border-radius: 5px; background: var(--surface); color: var(--ink); }

/* ── card ──────────────────────────────────────────────────────────────── */
.sb__card {
  position: relative; padding: clamp(22px, 3.4vw, 36px);
  background: var(--bg); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 30px 70px -40px rgba(16,27,54,.35);
  scroll-margin-top: calc(var(--top) + 16px);
}
.sb__card h2 { font-size: 1.45rem; letter-spacing: -.03em; }
.sb__hint { margin: .5rem 0 1.4rem; font-size: .92rem; line-height: 1.6; }
.sb__hint b { color: var(--ink); font-weight: 600; word-break: break-all; }
.sb__step:focus { outline: none; }
.sb fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.sb fieldset:disabled { opacity: .65; }

/* stepper */
.steps { list-style: none; display: flex; gap: 8px; margin: 0 0 28px; padding: 0; counter-reset: s; }
.step {
  flex: 1; display: flex; align-items: center; gap: 9px; min-width: 0;
  padding-top: 12px; border-top: 3px solid var(--line);
  font-size: .8rem; font-weight: 600; color: var(--muted);
  transition: border-color .2s ease, color .2s ease;
}
.step__n {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%; font-size: .72rem; font-weight: 700;
  background: var(--surface); color: var(--muted);
}
.step__t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step.is-current { border-top-color: var(--accent); color: var(--ink); }
.step.is-current .step__n { background: var(--accent); color: var(--accent-ink); }
.step.is-done { border-top-color: var(--accent); color: var(--body); }
.step.is-done .step__n { background: var(--accent-soft); color: var(--accent-deep); font-size: 0; }
.step.is-done .step__n::after { content: "✓"; font-size: .74rem; }

/* alert */
.sb__alert {
  display: flex; align-items: flex-start; gap: 10px; margin: 0 0 22px; padding: 12px 12px 12px 14px;
  border-radius: 12px; background: var(--err-bg); color: var(--err); font-size: .88rem; line-height: 1.55;
}
.sb__alert svg { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.sb__alert p { flex: 1; min-width: 0; }
.sb__alert--ok { background: var(--ok-bg); color: var(--ok); }
.sb__alert-x { flex: none; width: 24px; height: 24px; border-radius: 6px; font-size: 1.1rem; line-height: 1; color: inherit; opacity: .7; }
.sb__alert-x:hover { opacity: 1; background: rgba(127,127,127,.12); }

/* fields */
.grid { display: grid; gap: 0 16px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.2fr) minmax(0, .8fr); }
.field { margin-bottom: 14px; min-width: 0; }
.field label {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  margin-bottom: 6px; font-size: .84rem; font-weight: 600; color: var(--ink);
}
.field__opt { font-size: .74rem; font-weight: 500; color: var(--muted); }
.field input, .field select {
  width: 100%; height: 46px; padding: 0 14px; font: inherit; font-size: .95rem;
  color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  transition: border-color .14s ease, box-shadow .14s ease;
}
.field select {
  appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2368708A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
}
.field input::placeholder { color: var(--muted); opacity: .7; }
.field input:hover, .field select:hover { border-color: color-mix(in srgb, var(--line) 50%, var(--muted)); }
.field input:focus, .field select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.field__err { min-height: 0; margin-top: 5px; font-size: .78rem; line-height: 1.4; color: var(--err); }
.field__err:empty { display: none; }
.field.is-invalid input, .field.is-invalid select { border-color: var(--err); }
.field.is-invalid input:focus, .field.is-invalid select:focus { box-shadow: 0 0 0 3px var(--err-bg); }

.code {
  height: 60px !important; text-align: center; font-family: var(--mono) !important;
  font-size: 1.6rem !important; font-weight: 600; letter-spacing: .5em; padding-left: calc(14px + .5em) !important;
}

.sb__who {
  display: flex; align-items: center; gap: 12px; margin: 1rem 0 1.4rem; padding: 12px 14px;
  border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2);
}
.sb__who svg { flex: none; width: 30px; height: 30px; padding: 7px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); }
.sb__who div { min-width: 0; }
.sb__who b { display: block; color: var(--ink); font-size: .92rem; }
.sb__who span { display: block; font-size: .84rem; overflow: hidden; text-overflow: ellipsis; }

.sb__resend { margin: 2px 0 0; font-size: .86rem; color: var(--muted); }
.sb__resend span { font-variant-numeric: tabular-nums; }

.link { font-weight: 600; color: var(--accent); }
.link:hover:not(:disabled) { text-decoration: underline; }
.link:disabled { color: var(--muted); cursor: not-allowed; }

/* actions */
.sb__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.btn--block { width: 100%; }
.btn--ghost { color: var(--body); border: 1px solid var(--line); background: var(--bg); }
.btn--ghost:hover { background: var(--surface); color: var(--ink); }
.btn:disabled { cursor: not-allowed; opacity: .75; }
.btn.is-busy { position: relative; color: transparent !important; }
.btn.is-busy::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--accent-ink); border-right-color: transparent;
  animation: sb-spin .7s linear infinite;
}
@keyframes sb-spin { to { transform: rotate(360deg); } }

/* done */
.sb__done { text-align: center; padding: 12px 0 6px; }
.sb__done-icon {
  display: inline-flex; width: 64px; height: 64px; padding: 17px; margin-bottom: 18px;
  border-radius: 50%; background: var(--ok-bg); color: var(--ok);
}
.sb__done-icon svg { width: 100%; height: 100%; }
.sb__done p { margin: .7rem auto 1.6rem; max-width: 40ch; font-size: .95rem; line-height: 1.65; }
.sb__done b { color: var(--ink); word-break: break-all; }

.sb__foot { padding: 0 16px 32px; text-align: center; font-size: .84rem; color: var(--muted); }

/* ── responsive ────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .sb { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .sb__perks { display: none; }
  .sb__back { margin-bottom: 18px; }
}
@media (max-width: 560px) {
  .grid--2, .grid--3 { grid-template-columns: minmax(0, 1fr); }
  .step__t { display: none; }
  .step.is-current { flex: 3; }
  .step.is-current .step__t { display: inline; }
  .sb__actions { flex-direction: column-reverse; }
  .sb__actions .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .btn.is-busy::after { animation-duration: 2s; } }
