/* ============================================
   Oak Innovation — ClarifyGo Quote App
   ============================================ */

:root {
  --orange: #f69416;
  --orange-light: #fef3e2;
  --orange-hover: #e08510;
  --white: #ffffff;
  --charcoal: #3d3d3d;
  --gray-50: #f9fafb;
  --gray-100: #f0f2f5;
  --gray-200: #e2e5ea;
  --gray-300: #c8cdd5;
  --gray-400: #9b9a9b;
  --gray-500: #6b7585;
  --gray-600: #4a5568;
  --gray-700: #2d3748;
  --gray-800: #1a202c;
  --green: #22c55e;
  --green-light: #dcfce7;
  --red: #ef4444;
  --header-h: 64px;
  --footer-h: 80px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.1), 0 8px 32px rgba(0,0,0,0.06);
}

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

html {
  height: 100%;
  overflow: hidden;
}

body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--gray-700);
  background: var(--white);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ============ APP SHELL ============ */

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  height: -webkit-fill-available;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

/* Header */
.header {
  flex: 0 0 var(--header-h);
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
}

.header__logo {
  height: 32px;
  width: auto;
}

.header__step {
  font-size: 13px;
  color: var(--gray-400);
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Content area */
.content {
  flex: 1 1 0%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  min-height: 0;
  background: var(--gray-50);
}

.content__inner {
  max-width: 680px;
  margin: 0 auto;
  padding: 32px 20px 40px;
  min-height: 100%;
}

/* Footer */
.footer {
  flex: 0 0 var(--footer-h);
  height: var(--footer-h);
  background: var(--orange);
  display: flex;
  align-items: center;
  padding: 0 20px;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.footer__inner {
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Progress bar */
.progress {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  background: var(--white);
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--white);
  color: var(--orange);
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.btn--primary:hover:not(:disabled) {
  background: var(--gray-50);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn--primary:active:not(:disabled) {
  background: var(--gray-100);
}

.btn--secondary {
  background: transparent;
  color: rgba(255,255,255,0.8);
  padding: 12px 16px;
  transition: background 0.15s ease;
}

.btn--secondary:hover:not(:disabled) {
  color: var(--white);
  background: rgba(255,255,255,0.15);
}

.btn--large {
  padding: 16px 40px;
  font-size: 17px;
  border-radius: var(--radius);
  background: var(--orange);
  color: var(--white);
}

.btn--large:hover:not(:disabled) {
  background: var(--orange-hover);
  box-shadow: 0 4px 16px rgba(246,148,22,0.4);
}

.btn--large:active:not(:disabled) {
  background: var(--orange-hover);
}

.btn--full {
  width: 100%;
}

/* ============ STEP TRANSITIONS ============ */

.step {
  display: none;
  animation: fadeSlideIn 0.35s ease forwards;
}

.step.active {
  display: block;
}

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

/* ============ STEP COMMON ============ */

.step__title {
  font-size: 26px;
  font-weight: 700;
  color: var(--charcoal);
  margin-bottom: 8px;
  line-height: 1.2;
}

.step__subtitle {
  font-size: 15px;
  color: var(--gray-400);
  margin-bottom: 28px;
  line-height: 1.5;
}

/* ============ STEP 1: WELCOME ============ */

.welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: calc(100dvh - var(--header-h) - var(--footer-h) - 64px);
}

.welcome__logo {
  width: 180px;
  margin-bottom: 32px;
}

.welcome__title {
  font-size: 32px;
  font-weight: 700;
  color: var(--charcoal);
  margin-bottom: 12px;
  line-height: 1.2;
}

.welcome__text {
  font-size: 16px;
  color: var(--gray-500);
  max-width: 440px;
  margin-bottom: 8px;
  line-height: 1.6;
}

.welcome__time {
  font-size: 13px;
  color: var(--gray-400);
  margin-bottom: 36px;
}

/* ============ STEP 2: INDUSTRY SELECTION ============ */

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

.card-grid--3 {
  grid-template-columns: 1fr;
}

.type-card {
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 16px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.type-card:hover {
  border-color: var(--orange);
  box-shadow: var(--shadow);
}

.type-card.selected {
  border-color: var(--orange);
  background: var(--orange-light);
}

.type-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--orange-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.type-card.selected .type-card__icon {
  background: var(--orange);
}

.type-card__content {
  flex: 1;
}

.type-card__title {
  font-size: 17px;
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 2px;
}

.type-card__desc {
  font-size: 13px;
  color: var(--gray-400);
}

/* ============ STEP 3: COMPANY DETAILS ============ */

.form-group {
  margin-bottom: 24px;
}

.form-group__label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 8px;
}

.form-group__hint {
  font-weight: 400;
  color: var(--gray-400);
  font-size: 13px;
}

/* Select dropdown */
.form-select {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-family: inherit;
  color: var(--gray-700);
  background: var(--white);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239b9a9b' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.form-select:focus {
  outline: none;
  border-color: var(--orange);
}

.form-select.error {
  border-color: var(--red);
}

/* Option pills for single select */
.option-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.option-pill {
  padding: 10px 18px;
  border: 2px solid var(--gray-200);
  border-radius: 40px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  background: var(--white);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: border-color 0.15s ease;
}

.option-pill:hover {
  border-color: var(--orange);
  color: var(--charcoal);
}

.option-pill.selected {
  border-color: var(--orange);
  background: var(--orange);
  color: var(--white);
}

/* Checkbox pills for multi-select */
.check-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.check-pill {
  padding: 10px 18px;
  border: 2px solid var(--gray-200);
  border-radius: 40px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  background: var(--white);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: border-color 0.15s ease;
}

.check-pill:hover {
  border-color: var(--orange);
}

.check-pill.selected {
  border-color: var(--orange);
  background: var(--orange-light);
  color: var(--charcoal);
}

/* ============ STEP 4: LOADING ============ */

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100dvh - var(--header-h) - var(--footer-h) - 64px);
  text-align: center;
}

.loading__spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--gray-200);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 24px;
}

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

.loading__text {
  font-size: 18px;
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 8px;
}

.loading__subtext {
  font-size: 14px;
  color: var(--gray-400);
}

/* ============ STEP 4: PLAN CARDS ============ */

.plan-card {
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}

.plan-card:hover {
  box-shadow: var(--shadow);
}

.plan-card.selected {
  border-color: var(--orange);
  background: var(--orange-light);
}

.plan-card.recommended {
  border-color: var(--orange);
}

.plan-card__badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--white);
  background: var(--orange);
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 12px;
}

.plan-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 8px;
}

.plan-card__name {
  font-size: 20px;
  font-weight: 700;
  color: var(--charcoal);
}

.plan-card__price {
  text-align: right;
  flex-shrink: 0;
}

.plan-card__price-amount {
  font-size: 24px;
  font-weight: 700;
  color: var(--orange);
}

.plan-card__price-unit {
  font-size: 13px;
  color: var(--gray-400);
  font-weight: 500;
}

.plan-card__reason {
  font-size: 14px;
  color: var(--gray-600);
  line-height: 1.55;
  margin-bottom: 16px;
}

.plan-card__features {
  list-style: none;
  padding: 0;
}

.plan-card__features li {
  font-size: 13px;
  color: var(--gray-600);
  padding: 4px 0;
  padding-left: 22px;
  position: relative;
}

.plan-card__features li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2322c55e'%3E%3Cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-size: contain;
}

.plan-card__compliance {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.compliance-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  background: var(--gray-100);
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

/* Add-ons divider */
.addons-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 0 16px;
  font-size: 14px;
  color: var(--gray-400);
  font-weight: 600;
}

.addons-divider::before,
.addons-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

/* Add-on cards */
.addon-card {
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.addon-card:hover {
  box-shadow: var(--shadow);
}

.addon-card.selected {
  border-color: var(--orange);
  background: var(--orange-light);
}

.addon-card.not-recommended {
  opacity: 0.6;
  border-style: dashed;
}

.addon-card.not-recommended.selected {
  opacity: 1;
  border-style: solid;
}

.addon-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.addon-card__name {
  font-size: 15px;
  font-weight: 600;
  color: var(--charcoal);
}

.addon-card__toggle {
  width: 44px;
  height: 26px;
  border-radius: 13px;
  background: var(--gray-300);
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.15s ease;
}

.addon-card__toggle::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: var(--white);
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform 0.15s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.addon-card.selected .addon-card__toggle {
  background: var(--orange);
}

.addon-card.selected .addon-card__toggle::after {
  transform: translateX(18px);
}

.addon-card__reason {
  font-size: 13px;
  color: var(--gray-500);
  line-height: 1.5;
  margin-bottom: 6px;
}

.addon-card__price {
  font-size: 13px;
  font-weight: 600;
  color: var(--orange);
}

.recommended-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--green);
  background: var(--green-light);
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 8px;
}

/* ============ STEP 5: QUOTE SUMMARY ============ */

.quote-summary {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.quote-summary__header {
  background: var(--charcoal);
  color: var(--white);
  padding: 24px;
  text-align: center;
}

.quote-summary__header h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}

.quote-summary__header p {
  font-size: 14px;
  opacity: 0.85;
}

.quote-section-label {
  padding: 12px 24px 4px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-400);
}

.quote-item {
  padding: 14px 24px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

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

.quote-item__info {
  flex: 1;
}

.quote-item__name {
  font-size: 15px;
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 2px;
}

.quote-item__desc {
  font-size: 13px;
  color: var(--gray-400);
  line-height: 1.5;
}

.quote-item__price {
  font-size: 15px;
  font-weight: 700;
  color: var(--orange);
  white-space: nowrap;
}

.quote-divider {
  height: 1px;
  background: var(--gray-200);
  margin: 0 24px;
}

.quote-subtotal {
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quote-subtotal__label {
  font-size: 14px;
  color: var(--gray-500);
}

.quote-subtotal__amount {
  font-size: 15px;
  font-weight: 600;
  color: var(--charcoal);
}

.quote-total {
  padding: 20px 24px;
  background: var(--gray-50);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 2px solid var(--gray-200);
}

.quote-total__label {
  font-size: 16px;
  font-weight: 600;
  color: var(--charcoal);
}

.quote-total__amount {
  font-size: 24px;
  font-weight: 700;
  color: var(--orange);
}

.quote-total__unit {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-400);
}

.quote-annual {
  padding: 14px 24px;
  text-align: center;
  font-size: 14px;
  color: var(--gray-500);
  background: var(--gray-50);
}

.quote-annual strong {
  color: var(--green);
}

.quote-note {
  text-align: center;
  font-size: 13px;
  color: var(--gray-400);
  margin-top: 16px;
  font-style: italic;
}

/* ============ STEP 6: DEMO / CALENDLY ============ */

.demo-step {
  text-align: center;
}

.demo-step .step__title,
.demo-step .step__subtitle {
  text-align: center;
}

.demo-step .step__subtitle {
  margin-bottom: 16px;
}

.demo-recap {
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-around;
  gap: 16px;
  text-align: center;
}

.demo-recap__item {
  flex: 1;
}

.demo-recap__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-400);
  font-weight: 600;
  margin-bottom: 4px;
}

.demo-recap__value {
  font-size: 16px;
  font-weight: 700;
  color: var(--charcoal);
}

.demo-recap__value--orange {
  color: var(--orange);
}

.calendly-wrapper {
  border-radius: var(--radius);
  overflow: visible;
  background: var(--white);
  box-shadow: var(--shadow);
}

/* ============ ERROR STATE ============ */

.error-msg {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  color: var(--red);
  margin-bottom: 16px;
  display: none;
}

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

/* ============ RESPONSIVE ============ */

@media (min-width: 640px) {
  .content__inner {
    padding: 48px 32px 56px;
  }

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

  .type-card {
    flex-direction: column;
    text-align: center;
    padding: 28px 20px;
  }

  .step__title {
    font-size: 30px;
  }

  .welcome__title {
    font-size: 38px;
  }

  .welcome__logo {
    width: 220px;
  }

  .plan-card {
    padding: 28px;
  }
}

@media (min-width: 768px) {
  :root {
    --header-h: 72px;
  }

  .header {
    padding: 0 32px;
  }

  .header__logo {
    height: 38px;
  }

  .footer {
    padding: 0 32px;
  }
}

/* ============ UTILITY ============ */

.hidden { display: none !important; }
