/* VerbalIt /try micro-funnel styles — v1 */
/* Brand tokens: ember #E8722A, charcoal #2A2A2A, tint #FFF3EB */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ember: #E8722A;
  --ember-dark: #C95E1E;
  --charcoal: #2A2A2A;
  --tint: #FFF3EB;
  --tint-dark: #FFE5CC;
  --grey: #6B7280;
  --light: #F5F5F5;
  --white: #FFFFFF;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
}

body {
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--charcoal);
  background: #FAFAFA;
  min-height: 100vh;
}

/* ─── Header ────────────────────────────────────────────────────── */
.try-header {
  background: var(--white);
  border-bottom: 1px solid #E5E7EB;
  padding: 14px 20px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.try-header .wrap {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.try-brand {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--charcoal);
  letter-spacing: -0.03em;
  text-decoration: none;
}

.try-brand .dot { color: var(--ember); }

.try-badge {
  font-size: 12px;
  color: var(--grey);
  background: var(--light);
  padding: 4px 10px;
  border-radius: 20px;
}

/* ─── Main content wrapper ──────────────────────────────────────── */
.try-main {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px 80px;
}

/* ─── States (JS toggles display) ──────────────────────────────── */
.try-state { display: none; }
.try-state.active { display: block; }

/* ─── Trade badge ───────────────────────────────────────────────── */
.trade-badge {
  display: inline-block;
  background: var(--tint);
  color: var(--ember);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

/* ─── Headline ──────────────────────────────────────────────────── */
.try-headline {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: clamp(22px, 5vw, 32px);
  font-weight: 800;
  color: var(--charcoal);
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 8px;
}

.try-subhead {
  font-size: 15px;
  color: var(--grey);
  margin-bottom: 24px;
}

/* ─── Script card ───────────────────────────────────────────────── */
.trade-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.trade-chip {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--grey);
  background: var(--white);
  border: 1.5px solid var(--tint-dark);
  border-radius: 22px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.15s;
}

.trade-chip:hover { border-color: var(--ember); color: var(--ember-dark); }

.trade-chip.active {
  background: var(--ember);
  border-color: var(--ember);
  color: #fff;
}

.script-card {
  background: var(--tint);
  border: 1.5px solid var(--tint-dark);
  border-left: 4px solid var(--ember);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 24px;
  position: relative;
}

.script-card-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ember);
  margin-bottom: 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--tint-dark);
}

.script-text {
  font-size: 16px;
  line-height: 1.65;
  color: #33302E;
  font-weight: 400;
  letter-spacing: 0;
  margin-top: 12px;
  max-width: 60ch;
  overflow-wrap: break-word;
  word-break: normal;
}

@media (min-width: 600px) {
  .script-text { font-size: 17px; }
}

/* Fixed job facts (address / phone / price): distinct but calm - not shouty */
.script-text strong {
  font-weight: 600;
  color: var(--charcoal);
}

/* The bits the reader personalises - these are the ones that should pop */
.script-placeholder {
  display: inline-block;
  background: #fff;
  color: var(--ember-dark);
  border: 1.5px solid var(--ember);
  border-radius: 6px;
  padding: 1px 8px;
  font-size: 0.9em;
  font-weight: 600;
  font-style: normal;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(232,114,42,0.12);
}

/* ─── Mic button ────────────────────────────────────────────────── */
.mic-wrap {
  text-align: center;
  margin-bottom: 16px;
}

.mic-btn {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--ember);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(232,114,42,0.35);
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  position: relative;
}

.mic-btn:hover { background: var(--ember-dark); transform: scale(1.03); }
.mic-btn:active { transform: scale(0.97); }
.mic-btn.recording {
  background: #E53935;
  box-shadow: 0 0 0 8px rgba(229,57,53,0.2), 0 4px 20px rgba(229,57,53,0.3);
  animation: pulse-ring 1.2s ease infinite;
}

@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(229,57,53,0.4), 0 4px 20px rgba(229,57,53,0.3); }
  70%  { box-shadow: 0 0 0 16px rgba(229,57,53,0), 0 4px 20px rgba(229,57,53,0.3); }
  100% { box-shadow: 0 0 0 0 rgba(229,57,53,0), 0 4px 20px rgba(229,57,53,0.3); }
}

.mic-icon {
  width: 36px;
  height: 36px;
  fill: #fff;
}

.mic-label {
  font-size: 13px;
  color: var(--grey);
  margin-top: 10px;
}

/* Try-again counter */
.try-counter {
  font-size: 12px;
  color: var(--grey);
  text-align: center;
  margin-top: 6px;
}

/* ─── Divider / or ──────────────────────────────────────────────── */
.or-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--grey);
  font-size: 13px;
}
.or-divider::before, .or-divider::after {
  content: '';
  flex: 1;
  border-top: 1px solid #E5E7EB;
}

/* ─── Text fallback ─────────────────────────────────────────────── */
.type-fallback {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #D1D5DB;
  border-radius: var(--radius);
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
  min-height: 100px;
  transition: border-color 0.15s;
  outline: none;
}
.type-fallback:focus { border-color: var(--ember); }

.submit-text-btn {
  margin-top: 10px;
  width: 100%;
}

/* ─── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: 50px;
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-weight: 700;
  font-size: 15px;
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, opacity 0.15s;
  text-decoration: none;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--ember);
  color: #fff;
  width: 100%;
}
.btn-primary:hover:not(:disabled) { background: var(--ember-dark); }

.btn-ghost {
  background: transparent;
  color: var(--charcoal);
  border: 1.5px solid #D1D5DB;
  width: 100%;
}
.btn-ghost:hover:not(:disabled) { border-color: var(--charcoal); }

/* ─── Spinner / Processing ──────────────────────────────────────── */
.spinner-wrap {
  text-align: center;
  padding: 60px 20px;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--tint-dark);
  border-top-color: var(--ember);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 20px;
}

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

.spinner-text {
  font-size: 16px;
  color: var(--grey);
  margin-bottom: 8px;
}

.spinner-sub {
  font-size: 13px;
  color: #9CA3AF;
}

/* ─── Review card ────────────────────────────────────────────────── */
.review-section {
  background: var(--white);
  border: 1px solid #E5E7EB;
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}

.review-section-head {
  background: var(--light);
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--grey);
  border-bottom: 1px solid #E5E7EB;
}

/* PDF preview (the real branded quote) */
.pdf-loading {
  padding: 22px 16px;
  text-align: center;
  color: var(--grey);
  font-size: 14px;
}
.pdf-iframe {
  width: 100%;
  height: 460px;
  border: none;
  display: block;
  background: #f4f4f4;
}
.pdf-open-btn {
  display: block;
  margin: 14px 16px 16px;
  text-align: center;
  text-decoration: none;
}

.review-field {
  padding: 12px 16px;
  border-bottom: 1px solid #F3F4F6;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

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

.review-field-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--grey);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.review-field-value {
  font-size: 15px;
  color: var(--charcoal);
}

/* Editable review fields */
.review-field-edit {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 16px;
  border-bottom: 1px solid #F3F4F6;
}
.review-field-edit:last-child { border-bottom: none; }

.review-input {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  color: var(--charcoal);
  border: 1.5px solid var(--tint-dark);
  border-radius: 8px;
  padding: 9px 12px;
  background: var(--white);
  width: 100%;
  transition: border-color 0.15s;
}
.review-input:focus {
  outline: none;
  border-color: var(--ember);
}
.review-textarea {
  margin: 10px 16px 4px;
  width: calc(100% - 32px);
  resize: vertical;
  line-height: 1.5;
}

/* Items list */
.items-list {
  padding: 12px 16px;
}

.item-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #F3F4F6;
  font-size: 14px;
}

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

.item-desc { flex: 1; color: var(--charcoal); }

.item-price {
  font-weight: 600;
  color: var(--charcoal);
  white-space: nowrap;
}

.items-total {
  padding: 8px 16px 12px;
  border-top: 1.5px solid #E5E7EB;
  background: var(--light);
}
.total-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 14px;
  color: var(--grey);
}
.total-row.total-grand {
  font-weight: 800;
  font-size: 17px;
  color: var(--charcoal);
  border-top: 1px solid #E5E7EB;
  margin-top: 4px;
  padding-top: 8px;
}

/* Review action row */
.review-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 24px;
}

/* ─── Confirm modal overlay ──────────────────────────────────────── */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.confirm-overlay[hidden] { display: none; }

.confirm-sheet {
  background: var(--white);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 24px 20px 32px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}

.confirm-title {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.confirm-email {
  font-size: 15px;
  color: var(--grey);
  margin-bottom: 20px;
}

.confirm-email strong { color: var(--charcoal); }

.confirm-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ─── Done state ─────────────────────────────────────────────────── */
.done-wrap {
  text-align: center;
  padding: 40px 20px;
}

.done-icon {
  width: 72px;
  height: 72px;
  background: var(--tint);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.done-icon svg {
  width: 36px;
  height: 36px;
  stroke: var(--ember);
}

.done-title {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: var(--charcoal);
  margin-bottom: 8px;
}

.done-sub {
  font-size: 16px;
  color: var(--grey);
  margin-bottom: 12px;
  line-height: 1.6;
}

.done-stub {
  background: var(--tint);
  border: 1px dashed var(--ember);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 13px;
  color: var(--ember-dark);
  margin: 20px 0 24px;
  text-align: left;
}

/* ─── Error notice ────────────────────────────────────────────────── */
.error-notice {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 14px;
  color: #B91C1C;
  margin-top: 12px;
  display: none;
}

.error-notice.visible { display: block; }

/* ─── Footer ─────────────────────────────────────────────────────── */
.try-footer {
  text-align: center;
  padding: 20px;
  font-size: 12px;
  color: #9CA3AF;
}

.try-footer a { color: var(--grey); }
