.site-ppc-form-root,
.site-ppc-form-root * {
  box-sizing: border-box;
}

.site-ppc-form-root {
  width: 100%;
  margin: 0 auto;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #111827;
}

.spf-shell {
  width: min(100%, var(--spf-max-width, 720px));
  margin: 0 auto;
  padding: 16px 10px;
}

.spf-card {
  background: #ffffff;
  border-radius: 22px;
  padding: clamp(20px, 4vw, 34px);
  box-shadow: 0 24px 65px rgba(15, 23, 42, 0.18);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.spf-card.spf-first-step {
  box-shadow: 0 24px 65px rgba(15, 23, 42, 0.18), 0 0 0 5px color-mix(in srgb, var(--spf-accent, #f5a623) 45%, transparent);
}

.spf-hero {
  text-align: center;
  margin-bottom: 24px;
  padding: clamp(20px, 4vw, 30px);
  border-radius: 20px;
  background: linear-gradient(135deg, var(--spf-accent, #f5a623), var(--spf-accent-dark, #e09510));
  color: #fff;
  box-shadow: 0 12px 28px rgba(245, 166, 35, 0.32);
}

.spf-hero h2 {
  margin: 0 0 8px;
  font-size: clamp(26px, 4vw, 34px);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #fff;
}

.spf-hero p {
  margin: 0;
  font-size: clamp(16px, 2vw, 19px);
  font-weight: 600;
  color: rgba(255,255,255,0.95);
}

.spf-progress-head {
  margin-bottom: 24px;
}

.spf-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
  font-size: 14px;
  color: #4b5563;
}

.spf-progress-meta strong {
  color: var(--spf-secondary, #1f3c88);
  font-size: 16px;
}

.spf-progress-bar {
  width: 100%;
  height: 11px;
  border-radius: 999px;
  overflow: hidden;
  background: #e5e7eb;
}

.spf-progress-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--spf-secondary, #1f3c88), var(--spf-accent, #f5a623));
  transition: width 0.28s ease;
}

.spf-progress-help {
  margin: 10px 0 0;
  text-align: center;
  font-size: 14px;
  color: #4b5563;
  font-weight: 600;
}

.spf-step {
  display: none;
  animation: spfFade 0.24s ease both;
}

.spf-step.active {
  display: block;
}

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

.spf-step h3 {
  margin: 0 0 22px;
  text-align: center;
  color: #111827;
  font-size: clamp(20px, 3vw, 27px);
  line-height: 1.22;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.spf-step .spf-left-title {
  text-align: left;
  max-width: 660px;
  margin-left: auto;
  margin-right: auto;
}

.spf-grid {
  display: grid;
  gap: 12px;
}

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

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

.spf-option {
  appearance: none;
  border: 2px solid #d1d5db;
  border-radius: 15px;
  padding: 16px 14px;
  background: #fff;
  color: #374151;
  font: inherit;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
  min-height: 58px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.spf-option:hover,
.spf-option:focus {
  outline: none;
  transform: translateY(-2px);
  border-color: var(--spf-accent, #f5a623);
  color: var(--spf-accent-dark, #e09510);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.14);
}

.spf-option.selected {
  border-color: var(--spf-accent, #f5a623);
  background: color-mix(in srgb, var(--spf-accent, #f5a623) 14%, white);
  color: #111827;
  box-shadow: 0 12px 28px rgba(245, 166, 35, 0.28);
}

.spf-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-width: 660px;
  margin: 0 auto;
}

.spf-field-grid.spf-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.spf-field-grid .spf-full {
  grid-column: 1 / -1;
}

.spf-field label {
  display: block;
  margin: 0 0 7px;
  font-size: 14px;
  font-weight: 750;
  color: #374151;
}

.spf-input,
.spf-select,
.spf-textarea {
  width: 100%;
  min-height: 48px;
  border: 2px solid #d1d5db;
  border-radius: 12px;
  padding: 12px 14px;
  color: #111827;
  background: #fff;
  font: inherit;
  font-size: 16px;
  line-height: 1.3;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.spf-input:focus,
.spf-select:focus,
.spf-textarea:focus {
  outline: none;
  border-color: var(--spf-accent, #f5a623);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--spf-accent, #f5a623) 22%, transparent);
}

.spf-input.error,
.spf-select.error,
.spf-textarea.error {
  border-color: #ef4444;
}

.spf-error-text,
.spf-error {
  margin-top: 7px;
  font-size: 13px;
  color: #dc2626;
  font-weight: 600;
}

.spf-error-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 14px;
  margin-bottom: 18px;
}

.spf-info-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 14px;
  margin-bottom: 18px;
}

.spf-address-results {
  margin-top: 16px;
}

.spf-address-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  border: 1px solid #d1d5db;
  border-radius: 14px;
  padding: 14px;
  background: #f9fafb;
  margin-bottom: 10px;
}

.spf-address-card p {
  margin: 0;
  color: #111827;
  font-weight: 650;
}

.spf-address-card small {
  display: block;
  margin-top: 3px;
  color: #4b5563;
}

.spf-address-card button,
.spf-small-btn {
  border: 0;
  background: var(--spf-secondary, #1f3c88);
  color: #fff;
  border-radius: 10px;
  padding: 9px 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.spf-address-card button:hover,
.spf-small-btn:hover {
  background: #162d66;
}

.spf-add-prev {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  border: 1px solid rgba(31, 60, 136, 0.22);
  background: linear-gradient(135deg, #eff6ff, #fff);
  border-radius: 16px;
  padding: 17px;
  margin-top: 16px;
}

.spf-add-prev p {
  margin: 0;
  color: #374151;
  font-size: 14px;
}

.spf-add-prev strong {
  display: block;
  color: var(--spf-secondary, #1f3c88);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.04em;
  margin-bottom: 3px;
}

.spf-signature-wrap {
  max-width: 660px;
  margin: 0 auto;
}

.spf-last-step-pill {
  display: inline-flex;
  padding: 8px 13px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: var(--spf-secondary, #1f3c88);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.spf-signature-copy {
  color: #374151;
  line-height: 1.6;
  font-size: 14px;
  margin: 0 0 14px;
}

.spf-legal-box {
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 14px;
  padding: 14px 16px;
  color: #374151;
  font-size: 13px;
  line-height: 1.55;
  margin: 16px 0;
  max-height: 190px;
  overflow: auto;
}

.spf-legal-box a {
  color: var(--spf-secondary, #1f3c88);
  font-weight: 700;
}

.spf-signature-canvas-wrap {
  border: 1px solid #d1d5db;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.spf-signature-canvas {
  display: block;
  width: 100%;
  height: 180px;
  touch-action: none;
  cursor: crosshair;
}

.spf-signature-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  gap: 12px;
  font-size: 12px;
  color: #6b7280;
}

.spf-link-btn {
  appearance: none;
  background: none;
  border: 0;
  color: var(--spf-secondary, #1f3c88);
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.spf-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid #e5e7eb;
}

.spf-actions.spf-right-only {
  justify-content: flex-end;
}

.spf-btn {
  appearance: none;
  border: 0;
  border-radius: 13px;
  min-height: 48px;
  padding: 13px 22px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, opacity 0.16s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.spf-btn-primary {
  background: var(--spf-accent, #f5a623);
  color: #fff;
  box-shadow: 0 10px 22px rgba(245, 166, 35, 0.3);
}

.spf-btn-primary:hover,
.spf-btn-primary:focus {
  background: var(--spf-accent-dark, #e09510);
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(245, 166, 35, 0.34);
  color: #fff;
}

.spf-btn-secondary {
  background: #fff;
  color: var(--spf-secondary, #1f3c88);
  border: 1px solid rgba(31, 60, 136, 0.16);
}

.spf-btn-secondary:hover,
.spf-btn-secondary:focus {
  background: #eff6ff;
  color: #162d66;
}

.spf-btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.spf-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255,255,255,.5);
  border-top-color: #fff;
  border-radius: 999px;
  animation: spfSpin 0.8s linear infinite;
}

@keyframes spfSpin {
  to { transform: rotate(360deg); }
}

.spf-success {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  padding: 18px 0;
}

.spf-success-icon {
  width: 82px;
  height: 82px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #22c55e, #15803d);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  font-weight: 900;
  box-shadow: 0 18px 35px rgba(34,197,94,.24);
}

.spf-success h2 {
  margin: 0 0 10px;
  color: #111827;
  font-size: clamp(24px, 4vw, 32px);
}

.spf-success p {
  margin: 0 auto 20px;
  color: #4b5563;
  line-height: 1.6;
}

.spf-next-box {
  text-align: left;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 8px 20px rgba(15,23,42,.06);
}

.spf-next-box h3 {
  text-align: left;
  margin-bottom: 12px;
  font-size: 20px;
}

.spf-next-box li {
  margin-bottom: 10px;
  color: #374151;
  line-height: 1.5;
}

.spf-loading-panel {
  text-align: center;
  padding: 38px 12px;
}

.spf-loading-panel .spf-loader-large {
  width: 52px;
  height: 52px;
  margin: 0 auto 18px;
  border: 5px solid #dbeafe;
  border-top-color: var(--spf-secondary, #1f3c88);
  border-radius: 999px;
  animation: spfSpin 0.8s linear infinite;
}

.spf-hidden {
  display: none !important;
}

@media (max-width: 720px) {
  .spf-card { border-radius: 18px; }
  .spf-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spf-field-grid,
  .spf-field-grid.spf-3 { grid-template-columns: 1fr; }
  .spf-add-prev,
  .spf-actions { flex-direction: column; align-items: stretch; }
  .spf-actions .spf-btn { width: 100%; }
}

@media (max-width: 460px) {
  .spf-grid-2,
  .spf-grid-3 { grid-template-columns: 1fr; }
  .spf-option { font-size: 16px; }
  .spf-shell { padding-left: 0; padding-right: 0; }
}
