/* =====================================================================
   DreamSmart Behavioral Solutions - TrustFlow Teams™ Executive Suite
   Apple Design System (Clarity, Deference, Depth, Radical Restraint)
   ===================================================================== */

:root {
  --ds-blue: #17609E;
  --ds-blue-hover: #124d7e;
  --ds-blue-subtle: rgba(23, 96, 158, 0.08);
  --ds-blue-border: rgba(23, 96, 158, 0.2);

  --ds-orange: #F26622;
  --ds-orange-hover: #d9561b;
  --ds-orange-subtle: rgba(242, 102, 34, 0.08);
  --ds-orange-border: rgba(242, 102, 34, 0.25);

  --ds-green: #99B63B;
  --ds-green-light: #a8c44a;
  --ds-green-dark: #7a922f;
  --ds-green-subtle: rgba(153, 182, 59, 0.12);
  --ds-green-border: rgba(153, 182, 59, 0.3);

  --ds-yellow: #FF9500;
  --ds-yellow-subtle: rgba(255, 149, 0, 0.1);
  --ds-red: #FF3B30;
  --ds-red-subtle: rgba(255, 59, 48, 0.1);

  --ds-dark: #1a2633;
  --ds-dark-surface: #1a2633;
  --ds-dark-card: rgba(255, 255, 255, 0.06);

  --ds-ink: #2D3E50;
  --ds-ink-secondary: #5a6c7d;
  --ds-ink-tertiary: #7F8C8D;

  --ds-bg: #F8F9FA;
  --ds-bg-warm: #F5F3EF;
  --ds-bg-white: #FFFFFF;
  --ds-hairline: rgba(45, 62, 80, 0.1);
  --ds-hairline-subtle: rgba(45, 62, 80, 0.05);
  --ds-hairline-dark: rgba(255, 255, 255, 0.14);

  --ds-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --ds-shadow-card: 0 2px 4px rgba(0, 0, 0, 0.02), 0 12px 32px rgba(0, 0, 0, 0.04);
  --ds-shadow-float: 0 8px 30px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.02);

  --ds-radius-sm: 8px;
  --ds-radius-md: 14px;
  --ds-radius-lg: 20px;
  --ds-radius-xl: 28px;
  --ds-radius-pill: 980px;

  --ds-font-display: 'Playfair Display', Georgia, serif;
  --ds-font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  font-family: var(--ds-font);
  color: var(--ds-ink);
  background-color: var(--ds-bg);
  overflow-x: hidden;
  width: 100%;
}

body {
  margin: 0;
  padding: 80px 0 0 0;
  font-family: var(--ds-font);
  color: var(--ds-ink);
  background-color: var(--ds-bg);
  line-height: 1.5;
  font-size: 16px;
  letter-spacing: -0.011em;
  overflow-x: hidden;
  width: 100%;
}

input, button, select, textarea {
  font-family: inherit;
}

/* ---------------------------------------------------------------------
   Apple Translucent Topbar
   --------------------------------------------------------------------- */
.ds-exec-topbar {
  position: sticky;
  top: 0;
  z-index: 999;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--ds-hairline);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.ds-exec-topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.ds-exec-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ds-ink);
  transition: opacity 0.15s ease;
}

.ds-exec-brand:hover {
  opacity: 0.85;
}

.ds-exec-brand img {
  height: 36px;
  width: auto;
  display: block;
}

.ds-exec-brand-text span {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ds-orange);
}

.ds-exec-brand-text strong {
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ds-ink);
}

.ds-exec-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ds-exec-nav a {
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--ds-ink-secondary);
  padding: 6px 12px;
  border-radius: var(--ds-radius-pill);
  transition: color 0.15s ease, background-color 0.15s ease;
}

.ds-exec-nav a:hover {
  color: var(--ds-ink);
  background: rgba(0, 0, 0, 0.04);
}

.ds-exec-nav a.active {
  color: var(--ds-blue);
  background: var(--ds-blue-subtle);
  font-weight: 600;
}

/* ---------------------------------------------------------------------
   Tactile Apple Buttons
   --------------------------------------------------------------------- */
.primary-button,
.ds-btn-orange {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--ds-orange);
  color: #FFFFFF !important;
  text-decoration: none !important;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 10px 20px;
  border-radius: var(--ds-radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 2px 8px rgba(242, 102, 34, 0.28);
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s ease, box-shadow 0.15s ease;
}

.primary-button:hover,
.ds-btn-orange:hover {
  background: var(--ds-orange-hover);
  box-shadow: 0 4px 14px rgba(242, 102, 34, 0.35);
}

.primary-button:active,
.ds-btn-orange:active {
  transform: scale(0.97);
}

.secondary-button,
.ds-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.05);
  color: var(--ds-ink) !important;
  text-decoration: none !important;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 10px 20px;
  border-radius: var(--ds-radius-pill);
  border: 1px solid var(--ds-hairline);
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s ease;
}

.secondary-button:hover,
.ds-btn-secondary:hover {
  background: rgba(0, 0, 0, 0.08);
}

.secondary-button:active,
.ds-btn-secondary:active {
  transform: scale(0.97);
}

.text-button {
  background: none;
  border: none;
  color: var(--ds-blue);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px;
  text-decoration: underline;
  transition: color 0.15s ease;
}
.text-button:hover {
  color: var(--ds-blue-hover);
}

/* ---------------------------------------------------------------------
   Clean Pills & Eyebrows
   --------------------------------------------------------------------- */
.ds-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: var(--ds-radius-pill);
  border: 1px solid transparent;
}

.ds-pill-orange {
  background: var(--ds-orange-subtle);
  border-color: var(--ds-orange-border);
  color: var(--ds-orange);
}

.ds-pill-blue {
  background: var(--ds-blue-subtle);
  border-color: var(--ds-blue-border);
  color: var(--ds-blue);
}

.ds-pill-neutral {
  background: rgba(0, 0, 0, 0.05);
  border-color: var(--ds-hairline);
  color: var(--ds-ink-secondary);
}

.ds-pill-green {
  background: var(--ds-green-subtle);
  border-color: var(--ds-green-border);
  color: var(--ds-green);
  font-weight: 700;
}

.ds-pill-dark {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
}

/* ---------------------------------------------------------------------
   Headings & Display Typography (Playfair Display + Inter)
   --------------------------------------------------------------------- */
h1, h2, .display, .apple-hero-headline, .pulse-hero h1, .friction-hero h1, .tariff-hero h1, .convo-hero h1, .hub-section-head h2 {
  font-family: var(--ds-font-display);
  font-weight: 700;
  letter-spacing: -0.025em;
}

/* ---------------------------------------------------------------------
   Hero Section Layout (Restraint & Whitespace)
   --------------------------------------------------------------------- */
.apple-hero-dark,
.pulse-hero,
.friction-hero,
.tariff-hero,
.convo-hero {
  background: radial-gradient(1200px 600px at 85% 0%, rgba(23, 96, 158, 0.45), transparent 60%), #1a2633;
  color: #FFFFFF;
  padding: clamp(64px, 8vw, 96px) 24px clamp(48px, 6vw, 72px);
  position: relative;
  overflow: hidden;
}

.apple-hero-dark::before,
.pulse-hero::before,
.friction-hero::before,
.tariff-hero::before,
.convo-hero::before {
  content: '';
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: min(900px, 100vw);
  height: 450px;
  background: radial-gradient(circle, rgba(23, 96, 158, 0.28) 0%, rgba(153, 182, 59, 0.08) 50%, transparent 75%);
  pointer-events: none;
  filter: blur(60px);
}

.apple-hero-container {
  max-width: 960px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 1;
}

.apple-hero-headline {
  font-size: clamp(2rem, 5vw, 4.2rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.08;
  margin: 16px 0 20px;
  color: #FFFFFF;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
  -webkit-hyphens: auto;
}

@media (max-width: 600px) {
  .apple-hero-dark {
    padding: 48px 16px 36px;
  }
  .apple-hero-pills {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
  .apple-hero-headline {
    font-size: 1.6rem;
    line-height: 1.18;
    letter-spacing: -0.025em;
  }
  .apple-hero-lede {
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 24px;
  }
  .apple-hero-cta-row {
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }
  .apple-hero-cta-row a,
  .apple-hero-cta-row button {
    width: 100%;
  }
}

.apple-hero-headline span {
  background: linear-gradient(135deg, #FFFFFF 30%, #8db8df 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.apple-hero-lede {
  font-size: clamp(17px, 2.2vw, 21px);
  line-height: 1.45;
  letter-spacing: -0.015em;
  color: rgba(255, 255, 255, 0.82);
  max-width: 68ch;
  margin: 0 auto 28px;
}

.apple-hero-pills {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.apple-hero-cta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* ---------------------------------------------------------------------
   Elevated Apple Tool Container
   --------------------------------------------------------------------- */
.apple-card-container {
  max-width: 860px;
  margin: -40px auto 64px;
  background: var(--ds-bg-white);
  border-radius: var(--ds-radius-xl);
  padding: clamp(28px, 5vw, 48px);
  border: 1px solid var(--ds-hairline);
  box-shadow: var(--ds-shadow-float);
  position: relative;
  z-index: 2;
}

/* ---------------------------------------------------------------------
   Progress Indicator & Stepper
   --------------------------------------------------------------------- */
.apple-progress-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.apple-progress-track {
  flex: 1;
  height: 6px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: var(--ds-radius-pill);
  overflow: hidden;
}

.apple-progress-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--ds-blue) 0%, var(--ds-orange) 100%);
  border-radius: var(--ds-radius-pill);
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.apple-progress-label {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ds-ink-secondary);
}

/* ---------------------------------------------------------------------
   Apple Bento Card Grid
   --------------------------------------------------------------------- */
.apple-bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.apple-bento-card {
  background: var(--ds-bg-white);
  border: 1px solid var(--ds-hairline);
  border-radius: var(--ds-radius-lg);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--ds-shadow-card);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}

.apple-bento-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03), 0 20px 48px rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.12);
}

.apple-bento-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.apple-bento-card h3 {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 10px;
  color: var(--ds-ink);
}

.apple-bento-card p {
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ds-ink-secondary);
  margin: 0 0 20px;
}

/* ---------------------------------------------------------------------
   Segmented Tactile Rating Controls (1 to 5 + N/A)
   --------------------------------------------------------------------- */
.apple-rating-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin: 20px 0;
}

.apple-rating-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 14px 8px;
  background: var(--ds-bg);
  border: 1.5px solid var(--ds-hairline);
  border-radius: var(--ds-radius-md);
  cursor: pointer;
  user-select: none;
  transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.apple-rating-option:hover {
  background: #EBECEF;
  border-color: rgba(0, 0, 0, 0.14);
}

.apple-rating-option:active {
  transform: scale(0.96);
}

.apple-rating-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.apple-rating-num {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--ds-ink);
  margin-bottom: 4px;
}

.apple-rating-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ds-ink-secondary);
  line-height: 1.25;
}

.apple-rating-option.selected,
.apple-rating-option:has(input:checked) {
  background: #FFFFFF;
  border-color: var(--ds-blue);
  box-shadow: 0 2px 10px rgba(23, 96, 158, 0.15);
}

.apple-rating-option.selected .apple-rating-num,
.apple-rating-option:has(input:checked) .apple-rating-num {
  color: var(--ds-blue);
}

.apple-rating-option.selected .apple-rating-label,
.apple-rating-option:has(input:checked) .apple-rating-label {
  color: var(--ds-blue);
  font-weight: 700;
}

/* ---------------------------------------------------------------------
   Results Dashboard (Apple Health / Financial Style)
   --------------------------------------------------------------------- */
.apple-results-hero {
  text-align: center;
  padding: 24px 0 36px;
  border-bottom: 1px solid var(--ds-hairline);
  margin-bottom: 32px;
}

.apple-score-display {
  font-size: clamp(3rem, 7vw, 5.2rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.035em;
  line-height: 1;
  color: var(--ds-ink);
  margin: 12px 0 8px;
}

.apple-signal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--ds-hairline-subtle);
}

.apple-signal-label {
  flex: 0 0 220px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ds-ink);
}

.apple-signal-track {
  flex: 1;
  height: 8px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: var(--ds-radius-pill);
  overflow: hidden;
}

.apple-signal-bar {
  display: block;
  height: 100%;
  border-radius: var(--ds-radius-pill);
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.apple-signal-val {
  flex: 0 0 60px;
  text-align: right;
  font-size: 14.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ds-ink);
}

/* ---------------------------------------------------------------------
   Debrief CTA Card
   --------------------------------------------------------------------- */
.apple-debrief-card {
  background: linear-gradient(135deg, #0d1624 0%, #17283c 100%);
  border-radius: var(--ds-radius-lg);
  padding: clamp(24px, 4vw, 36px);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 36px;
  box-shadow: 0 8px 32px rgba(10, 17, 26, 0.16);
}

.apple-debrief-card h3 {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  color: #FFFFFF;
}

.apple-debrief-card p {
  font-size: 14.5px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
  max-width: 62ch;
}

/* ---------------------------------------------------------------------
   Apple Footer
   --------------------------------------------------------------------- */
.apple-footer {
  background: #FFFFFF;
  border-top: 1px solid var(--ds-hairline);
  padding: 40px 24px;
  color: var(--ds-ink-secondary);
  font-size: 13px;
  margin-top: 80px;
}

.apple-footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.apple-footer a {
  color: var(--ds-ink);
  text-decoration: none;
  transition: color 0.15s ease;
}

.apple-footer a:hover {
  color: var(--ds-blue);
  text-decoration: underline;
}

/* ---------------------------------------------------------------------
   Accessibility & Reduced Motion
   --------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 768px) {
  .ds-exec-topbar-inner {
    padding: 10px 16px;
    flex-wrap: nowrap;
  }
  .ds-exec-brand {
    gap: 8px;
    min-width: 0;
  }
  .ds-exec-brand img {
    height: 30px;
  }
  .ds-exec-brand-text {
    min-width: 0;
  }
  .ds-exec-brand-text span {
    font-size: 9.5px;
  }
  .ds-exec-brand-text strong {
    font-size: 12.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
  }
  .ds-exec-nav {
    display: none;
  }
  .apple-card-container {
    padding: 24px 16px;
    margin-top: -24px;
    border-radius: var(--ds-radius-lg);
  }
  .apple-signal-row {
    flex-wrap: wrap;
    gap: 8px;
  }
  .apple-signal-label {
    flex: 1 1 100%;
  }
  .apple-signal-track {
    flex: 1;
  }
  .apple-debrief-card {
    padding: 24px 20px;
  }
}
