/* ============================================================
   ProFlex Media — Kit Owner Onboarding Portal
   Black Sand system: black base, cyan key light, Plus Jakarta Sans.
   ============================================================ */

.portal {
  min-height: calc(100vh - 70px);
  padding: 64px 24px 96px;
  max-width: 860px;
  margin: 0 auto;
}

.portal-wrap {
  max-width: 720px;
  margin: 0 auto;
}

/* ---------- Head ---------- */
.portal-head {
  text-align: center;
  margin-bottom: 48px;
}

.portal-kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 16px;
}

.portal-head h1 {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 16px;
}

.portal-lead {
  color: var(--dim);
  font-size: 17px;
  max-width: 52ch;
  margin: 0 auto;
  line-height: 1.6;
}

/* ---------- Stepper ---------- */
.stepper {
  list-style: none;
  display: flex;
  gap: 4px;
  margin-bottom: 48px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.stepper li {
  flex: 1;
  min-width: 90px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--dim-2);
  text-transform: uppercase;
}

.stepper li span {
  width: 26px;
  height: 26px;
  border-radius: var(--pfx-radius-full);
  border: 1.5px solid var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  color: var(--dim);
  transition: all 0.3s ease;
}

.stepper li.active {
  color: var(--ink);
}

.stepper li.active span {
  background: var(--cyan);
  border-color: var(--cyan);
  color: var(--black);
}

.stepper li.done span {
  background: var(--charcoal);
  border-color: var(--cyan);
  color: var(--cyan);
}

/* ---------- Steps ---------- */
.step {
  display: none;
  animation: fadeUp 0.35s ease;
}

.step.active {
  display: block;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.step-head {
  margin-bottom: 32px;
}

.step-head h2 {
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.step-head p {
  color: var(--dim);
  font-size: 15px;
}

/* ---------- Form fields ---------- */
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-wide {
  grid-column: 1 / -1;
}

.field label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
}

.field input,
.field select,
.field textarea {
  background: var(--charcoal);
  border: 1px solid var(--line-strong);
  border-radius: var(--pfx-radius-md);
  padding: 14px 16px;
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 234, 217, 0.12);
}

.field input::placeholder {
  color: var(--dim-2);
}

.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23fdfcf8' stroke-opacity='0.5' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
  cursor: pointer;
}

.field input[required]:invalid {
  border-color: rgba(255, 80, 80, 0.5);
}

/* ---------- Buttons ---------- */
.btn-primary,
.btn-ghost {
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: var(--pfx-radius-md);
  padding: 14px 28px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: var(--cyan);
  color: var(--black);
}

.btn-primary:hover {
  background: #00ffea;
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
}

.btn-ghost:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

/* ---------- Form nav ---------- */
.form-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

.form-nav .form-note {
  flex: 1;
  text-align: center;
  font-size: 13px;
  color: var(--dim);
}

/* ---------- Kit list ---------- */
.kit-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 20px;
}

.kit-row {
  border: 1px solid var(--line-strong);
  border-radius: var(--pfx-radius-lg);
  padding: 24px;
  background: var(--charcoal);
}

.kit-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.kit-row-num {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
}

.kit-row-remove {
  background: none;
  border: none;
  color: var(--dim);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--pfx-radius-sm);
  transition: all 0.2s ease;
}

.kit-row-remove:hover {
  color: #ff5050;
  background: rgba(255, 80, 80, 0.1);
}

/* ---------- Agreement ---------- */
.agreement-box {
  border: 1px solid var(--line-strong);
  border-radius: var(--pfx-radius-lg);
  padding: 32px;
  background: var(--charcoal);
  margin-bottom: 32px;
  max-height: 380px;
  overflow-y: auto;
}

.agreement-box h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.agreement-meta {
  font-size: 13px;
  color: var(--dim);
  margin-bottom: 20px;
}

.agreement-clauses {
  list-style: none;
  counter-reset: clause;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.agreement-clauses li {
  counter-increment: clause;
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink);
  padding-left: 28px;
  position: relative;
}

.agreement-clauses li::before {
  content: counter(clause);
  position: absolute;
  left: 0;
  top: 0;
  width: 20px;
  height: 20px;
  background: var(--black);
  border: 1px solid var(--line-strong);
  border-radius: var(--pfx-radius-full);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cyan);
}

.agreement-clauses li strong {
  color: var(--ink);
}

.agreement-note {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--dim);
}

/* ---------- Signature ---------- */
.sig-wrap {
  margin-bottom: 24px;
}

.sig-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
  display: block;
  margin-bottom: 8px;
}

.sig-pad-wrap {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--pfx-radius-lg);
  overflow: hidden;
  background: var(--ink);
  position: relative;
}

#sig-pad {
  width: 100%;
  height: 160px;
  display: block;
  touch-action: none;
}

.sig-actions {
  position: absolute;
  bottom: 10px;
  right: 10px;
  display: flex;
  gap: 8px;
}

.sig-actions .btn-ghost {
  padding: 6px 14px;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.6);
  border-color: var(--line-strong);
  color: var(--ink);
}

.sig-actions .btn-ghost:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.sig-hint {
  font-size: 12px;
  color: var(--dim);
  margin-top: 8px;
}

/* ---------- Checkbox row ---------- */
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink);
  line-height: 1.5;
}

.check-row input[type="checkbox"] {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  accent-color: var(--cyan);
  flex-shrink: 0;
  cursor: pointer;
}

/* ---------- Stripe ---------- */
.stripe-placeholder,
.stripe-connected {
  border: 1px solid var(--line-strong);
  border-radius: var(--pfx-radius-lg);
  padding: 32px;
  background: var(--charcoal);
  text-align: center;
}

.stripe-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #635bff;
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--pfx-radius-pill);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 20px;
}

.stripe-badge.connected {
  background: rgba(0, 234, 217, 0.12);
  color: var(--cyan);
}

.stripe-badge .tick {
  font-size: 16px;
}

.stripe-text {
  color: var(--dim);
  font-size: 15px;
  max-width: 46ch;
  margin: 0 auto 24px;
  line-height: 1.6;
}

.stripe-note {
  margin-top: 20px;
  padding: 14px 16px;
  background: var(--black);
  border-radius: var(--pfx-radius-md);
  font-size: 12px;
  color: var(--dim);
  line-height: 1.6;
  text-align: left;
}

.stripe-note code {
  color: var(--cyan);
  font-size: 12px;
}

/* ---------- Review ---------- */
.review {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.review-block {
  border: 1px solid var(--line-strong);
  border-radius: var(--pfx-radius-lg);
  padding: 24px;
  background: var(--charcoal);
}

.review-block h4 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 14px;
}

.review-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
}

.review-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.review-item .k {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dim-2);
}

.review-item .v {
  font-size: 15px;
  color: var(--ink);
}

.review-kit-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.review-kit-item:last-child {
  border-bottom: none;
}

.review-kit-item .v {
  font-weight: 600;
}

.review-kit-item .meta {
  font-size: 13px;
  color: var(--dim);
  margin-top: 4px;
}

.review-sig {
  margin-top: 12px;
}

.review-sig img {
  max-width: 240px;
  background: var(--ink);
  border-radius: var(--pfx-radius-md);
  padding: 8px;
}

/* ---------- Success ---------- */
.step-success {
  text-align: center;
  padding: 48px 0;
}

.success-mark {
  width: 72px;
  height: 72px;
  border-radius: var(--pfx-radius-full);
  background: rgba(0, 234, 217, 0.12);
  color: var(--cyan);
  font-size: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.step-success h2 {
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.step-success p {
  color: var(--dim);
  font-size: 16px;
  max-width: 46ch;
  margin: 0 auto 16px;
  line-height: 1.6;
}

.step-success .btn-primary {
  margin-top: 16px;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .portal {
    padding: 40px 16px 72px;
  }

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

  .stepper li {
    font-size: 0;
  }

  .stepper li span {
    margin: 0 auto;
  }

  .agreement-box {
    padding: 20px;
  }

  .form-nav {
    flex-direction: column-reverse;
  }

  .form-nav > * {
    width: 100%;
  }

  .form-nav .form-note {
    order: 3;
  }
}
