/* =============================================================================
   Tradie Leads NSW - Onboarding Flow Styles
   Mobile-first, WCAG 2.2 AA accessible, high-contrast navy & slate palette
   ============================================================================= */

:root {
  --onboard-bg: #070d18;
  --card-bg: #0f1f33;
  --card-border: #223854;
  --focus-ring: #38bdf8;
  --error-color: #ef4444;
  --success-color: #10b981;
}

body.onboard-body {
  background-color: var(--onboard-bg);
  color: #f1f5f9;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header-compact {
  padding: 12px 0;
  border-bottom: 1px solid var(--card-border);
}

.header-status {
  display: flex;
  align-items: center;
  gap: 16px;
}

.secure-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-save-later {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

.btn-save-later:hover {
  color: #f1f5f9;
}

.onboard-main {
  flex: 1;
  padding: 24px 16px 80px;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

/* -------------------------------------------------- Progress Track */
.step-nav {
  margin-bottom: 24px;
}

.step-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.85rem;
}

.step-indicator {
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.02em;
}

.step-timer {
  color: #94a3b8;
}

.progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #1d68bd, #38bdf8);
  border-radius: 999px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* -------------------------------------------------- Cards & Grid */
.thank-you-banner {
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 20px;
  margin-bottom: 24px;
}

.thank-you-pill {
  display: inline-flex;
  align-items: center;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.onboard-subtitle {
  font-size: 1.15rem;
  font-weight: 700;
  color: #38bdf8;
  margin-top: -6px;
  margin-bottom: 8px;
}

.onboard-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 28px 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  margin-bottom: 24px;
}

.step-desc {
  color: #94a3b8;
  font-size: 0.95rem;
  line-height: 1.5;
  margin-top: -6px;
  margin-bottom: 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }
  .span-2 {
    grid-column: span 2;
  }
}

.field-group {
  display: flex;
  flex-direction: column;
}

.field-group label {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: #e2e8f0;
}

.req {
  color: #f87171;
  font-weight: bold;
}

.opt {
  color: #94a3b8;
  font-weight: normal;
  font-size: 0.8rem;
}

.field-hint {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 5px;
  line-height: 1.35;
}

.field-error {
  color: var(--error-color);
  font-size: 0.8rem;
  font-weight: 500;
  margin-top: 4px;
  min-height: 1.1em;
}

/* -------------------------------------------------- Form Inputs */
.letter-paragraph-input {
  min-height: 110px !important;
  line-height: 1.55 !important;
  font-size: 0.92rem !important;
  resize: vertical;
}

/* Logo Upload & Preview */
.logo-upload-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.logo-preview-box {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: #070d18;
  border: 1px dashed #38bdf8;
  padding: 8px 12px;
  border-radius: 8px;
  width: fit-content;
}

.logo-preview-box img {
  max-height: 48px;
  max-width: 140px;
  object-fit: contain;
}

.btn-remove-logo {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.letter-logo {
  max-height: 52px;
  max-width: 160px;
  object-fit: contain;
  margin-bottom: 8px;
  display: block;
}

/* Touchpoint Explainer Callout */
.touchpoint-explainer {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 10px;
  padding: 16px;
  margin: 6px 0;
}

.touchpoint-badge {
  display: inline-block;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.touchpoint-explainer p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #cbd5e1;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
textarea,
select {
  background: #0b1728;
  border: 1px solid #294466;
  border-radius: 8px;
  color: #ffffff;
  padding: 12px 14px;
  font-size: 0.95rem;
  font-family: inherit;
  min-height: 48px; /* Accessible 44px+ tap target */
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--focus-ring);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
}

input.is-invalid,
textarea.is-invalid {
  border-color: var(--error-color);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

/* -------------------------------------------------- Interactive Pills */
.checkbox-pill-grid,
.radio-pill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 6px;
}

.pill-checkbox,
.pill-radio {
  display: flex;
  align-items: center;
  background: #0b1728;
  border: 1px solid #294466;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  min-height: 48px;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.15s ease;
  user-select: none;
}

.pill-checkbox input,
.pill-radio input {
  margin-right: 8px;
  accent-color: #1d68bd;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.pill-checkbox:has(input:checked),
.pill-radio:has(input:checked) {
  border-color: #38bdf8;
  background: rgba(29, 104, 189, 0.15);
  color: #ffffff;
}

/* Exclusivity Cards */
.radio-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 8px;
}

@media (min-width: 640px) {
  .radio-card-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.radio-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #0b1728;
  border: 1px solid #294466;
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.radio-card input {
  margin-top: 3px;
  accent-color: #1d68bd;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.radio-card-body strong {
  display: block;
  font-size: 0.95rem;
  color: #f1f5f9;
  margin-bottom: 4px;
}

.radio-card-body p {
  font-size: 0.82rem;
  color: #94a3b8;
  line-height: 1.4;
  margin: 0;
}

.radio-card:has(input:checked) {
  border-color: #38bdf8;
  background: rgba(29, 104, 189, 0.18);
}

/* Compliance Box */
.compliance-box {
  background: rgba(229, 106, 23, 0.08);
  border: 1px solid rgba(229, 106, 23, 0.3);
  border-radius: 10px;
  padding: 16px;
  margin-top: 8px;
}

.compliance-checkbox {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  color: #e2e8f0;
  font-size: 0.86rem;
  line-height: 1.5;
  cursor: pointer;
  align-items: flex-start;
}

.compliance-checkbox input {
  margin-top: 3px;
}

/* -------------------------------------------------- Live Letter Preview */
.split-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 900px) {
  .split-layout {
    grid-template-columns: 1fr 1fr;
  }
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #e2e8f0;
}

.preview-badge {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
}

.paper-sheet {
  background: #ffffff;
  color: #1e293b;
  border-radius: 8px;
  padding: 36px 32px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.88rem;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  min-height: 480px;
}

.letter-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.letter-biz-name {
  font-family: 'Inter', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f1f33;
}

.letter-sub-info {
  font-size: 0.75rem;
  color: #64748b;
  font-family: 'Inter', sans-serif;
  margin-top: 2px;
}

.letter-contact-block {
  text-align: right;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  color: #475569;
}

.letter-phone-num {
  font-weight: 700;
  color: #0f1f33;
  font-size: 0.88rem;
}

.letter-rule {
  border: none;
  border-top: 2px solid #0f1f33;
  margin: 12px 0 20px;
}

.letter-date {
  font-size: 0.82rem;
  color: #64748b;
  margin-bottom: 16px;
}

.letter-addressee {
  margin-bottom: 20px;
  line-height: 1.4;
  color: #334155;
}

.letter-subject {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.92rem;
  color: #0f1f33;
  margin-bottom: 16px;
}

.letter-body {
  color: #1e293b;
  flex: 1;
}

.letter-body p {
  margin-bottom: 14px;
}

.letter-signoff {
  margin-top: 24px;
  line-height: 1.35;
  color: #0f1f33;
}

.letter-footer {
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid #cbd5e1;
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  color: #64748b;
  line-height: 1.4;
}

/* -------------------------------------------------- Sticky Bottom Action Bar */
.onboard-action-bar {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 31, 51, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--card-border);
  padding: 14px 16px;
  z-index: 100;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.3);
}

.action-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 900px;
  margin: 0 auto;
}

.action-status-msg {
  font-size: 0.82rem;
  color: #94a3b8;
  flex: 1;
  text-align: center;
}

.btn-prev {
  min-width: 100px;
}

.btn-next {
  min-width: 180px;
  font-weight: 700;
}

/* -------------------------------------------------- Loading Spinner */
.loader-wrap {
  text-align: center;
  padding: 40px 16px;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 20px;
}

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

/* -------------------------------------------------- Confirmation Screen */
.confirmation-card {
  text-align: center;
  padding: 48px 24px;
}

.confirm-icon-wrap {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.lead-value {
  font-size: 1.15rem;
  color: #e2e8f0;
  margin-bottom: 28px;
}

.confirm-summary-box {
  background: #0b1728;
  border: 1px solid #223854;
  border-radius: 12px;
  padding: 24px 20px;
  max-width: 580px;
  margin: 0 auto 32px;
  text-align: left;
}

.confirm-summary-box h3 {
  font-size: 1rem;
  color: #38bdf8;
  margin-bottom: 14px;
}

.confirm-steps {
  padding-left: 20px;
  margin: 0;
  color: #cbd5e1;
  font-size: 0.9rem;
  line-height: 1.7;
}

.confirm-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
  margin: 0 auto 24px;
}

@media (min-width: 540px) {
  .confirm-actions {
    flex-direction: row;
    justify-content: center;
  }
}

.confirm-support {
  font-size: 0.85rem;
  color: #64748b;
}

.confirm-support a {
  color: #38bdf8;
  text-decoration: underline;
}

@media (prefers-reduced-motion: reduce) {
  .progress-fill,
  .spinner,
  input,
  button {
    transition: none !important;
    animation: none !important;
  }
}

