/* ============================================
   MakeMyDay Landing Page
   Typography: Newsreader (display) + Instrument Sans (body) + Outfit (logo)
   Colors: Warm neutrals + #e07850 terracotta accent
   ============================================ */

/* --- Design Tokens --- */
:root {
  /* Warm neutral palette — tinted, never pure gray or pure black */
  --color-bg:        oklch(0.985 0.005 60);
  --color-surface:   oklch(0.965 0.008 60);
  --color-text:      oklch(0.22 0.015 55);
  --color-text-mid:  oklch(0.45 0.012 55);
  --color-text-soft: oklch(0.52 0.010 55);
  --color-border:    oklch(0.88 0.008 60);

  /* Accent — #e07850 terracotta, warm and human */
  --color-accent:       #e07850;                /* brand color — decorative, bubbles */
  --color-accent-bold:  oklch(0.50 0.155 42);   /* darkened for AA contrast on white text (buttons) */
  --color-accent-hover: oklch(0.44 0.155 42);   /* button hover */
  --color-accent-light: oklch(0.95 0.035 50);   /* MMD bubble bg — very light peach tint */

  /* SMS bubble colors */
  --color-bubble-user: oklch(0.94 0.006 60);
  --color-bubble-mmd:  var(--color-accent-light);

  /* Pro tier — purple accent */
  --color-pro:       oklch(0.52 0.15 300);
  --color-pro-light: oklch(0.93 0.04 300);

  /* Semantic colors */
  --color-white:   #ffffff;
  --color-error:   oklch(0.55 0.20 25);
  --color-success: oklch(0.45 0.16 155);

  /* Typography */
  --font-logo:    'Outfit', system-ui, -apple-system, sans-serif;
  --font-display: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-body:    'Instrument Sans', system-ui, -apple-system, sans-serif;

  /* Fluid type scale */
  --text-xs:   clamp(0.75rem, 0.7rem + 0.25vw, 0.8125rem);
  --text-sm:   clamp(0.8125rem, 0.75rem + 0.3vw, 0.9375rem);
  --text-base: clamp(0.9375rem, 0.875rem + 0.3vw, 1.0625rem);
  --text-lg:   clamp(1.125rem, 1rem + 0.5vw, 1.25rem);
  --text-xl:   clamp(1.5rem, 1.2rem + 1.5vw, 2.25rem);
  --text-2xl:  clamp(2rem, 1.5rem + 2.5vw, 3.25rem);

  /* Spacing */
  --space-xs:  0.5rem;
  --space-sm:  0.75rem;
  --space-md:  1rem;
  --space-lg:  1.5rem;
  --space-xl:  2.5rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;

  /* Layout */
  --container-max: 1080px;
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  18px;
  --radius-xl:  24px;
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
}

img {
  max-width: 100%;
  display: block;
}

/* SVG icon colors — single source of truth for brand fills */
.icon-bubble {
  fill: var(--color-accent);
}

.icon-check {
  stroke: var(--color-white);
}

/* --- Utilities --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-lg);
}

/* --- Logo --- */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  margin-bottom: var(--space-xl);
}

.logo:focus-visible,
.footer-logo:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

.logo-icon {
  flex-shrink: 0;
}

.logo-wordmark {
  font-family: var(--font-logo);
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: -0.01em;
  line-height: 1;
}

/* --- Hero Section --- */
.hero {
  padding-block: var(--space-2xl) var(--space-2xl);
  min-height: min(100svh, 900px);
  display: flex;
  align-items: center;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: center;
}

.headline {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--color-text);
  margin-bottom: var(--space-md);
}

.subline {
  font-size: var(--text-lg);
  color: var(--color-text-mid);
  line-height: 1.55;
  max-width: 52ch;
  margin-bottom: var(--space-xl);
}

/* --- Signup Form --- */
.signup-form {
  max-width: 440px;
}

.form-row {
  display: flex;
  gap: var(--space-sm);
}

.input-wrapper {
  flex: 1;
}

.input-wrapper input[type="tel"] {
  width: 100%;
  padding: 0.875rem 1rem;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-white);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  outline: 2px solid transparent;
  outline-offset: 2px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, outline-color 0.15s ease;
}

.input-wrapper input[type="tel"]::placeholder {
  color: var(--color-text-soft);
}

.input-wrapper input[type="tel"]:focus-visible {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px oklch(0.65 0.145 45 / 0.18);
  outline-color: var(--color-accent);
}

.input-wrapper input[type="tel"].is-invalid {
  border-color: var(--color-error);
  box-shadow: 0 0 0 3px oklch(0.55 0.20 25 / 0.1);
}

.btn-primary {
  padding: 0.875rem 1.75rem;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-white);
  background-color: var(--color-accent-bold);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.btn-primary:hover {
  background-color: var(--color-accent-hover);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

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

.form-feedback {
  min-height: 1.5rem;
  margin-top: var(--space-xs);
  font-size: var(--text-sm);
  line-height: 1.4;
}

.form-feedback.is-error {
  color: var(--color-error);
}

.form-feedback.is-success {
  color: var(--color-success);
}

.consent {
  margin-top: var(--space-sm);
  font-size: var(--text-xs);
  color: var(--color-text-soft);
  line-height: 1.5;
}

/* --- Phone Frame / SMS Mockup --- */
.phone-frame {
  background: var(--color-white);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-lg) var(--space-md);
  box-shadow:
    0 1px 3px oklch(0.22 0.015 55 / 0.04),
    0 8px 24px oklch(0.22 0.015 55 / 0.06);
  max-width: 380px;
  margin-left: auto;
}

.sms-thread {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.sms-time {
  text-align: center;
  font-size: var(--text-xs);
  color: var(--color-text-soft);
  padding-block: var(--space-xs);
}

.sms-bubble {
  max-width: 82%;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  line-height: 1.45;
}

.sms-bubble p {
  margin: 0;
}

.sms-user {
  align-self: flex-end;
  background-color: var(--color-bubble-user);
  color: var(--color-text);
  border-bottom-right-radius: var(--radius-sm);
}

.sms-mmd {
  align-self: flex-start;
  background-color: var(--color-bubble-mmd);
  color: var(--color-text);
  border-bottom-left-radius: var(--radius-sm);
}

/* SMS entrance animation */
#hero-thread [data-delay] {
  opacity: 0;
  transform: translateY(8px);
}

#hero-thread.is-animated [data-delay] {
  animation: sms-enter 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

#hero-thread [data-delay="0"] { animation-delay: 0.15s; }
#hero-thread [data-delay="1"] { animation-delay: 0.35s; }
#hero-thread [data-delay="2"] { animation-delay: 0.55s; }
#hero-thread [data-delay="3"] { animation-delay: 0.85s; }
#hero-thread [data-delay="4"] { animation-delay: 1.05s; }
#hero-thread [data-delay="5"] { animation-delay: 1.3s; }
#hero-thread [data-delay="6"] { animation-delay: 1.5s; }

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

@media (prefers-reduced-motion: reduce) {
  #hero-thread [data-delay] {
    opacity: 1;
    transform: none;
    animation: none;
  }
}

/* --- How it Works --- */
.how-it-works {
  padding-block: var(--space-3xl);
  background-color: var(--color-surface);
}

.section-heading {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 500;
  text-align: center;
  margin-bottom: var(--space-2xl);
  color: var(--color-text);
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

.step {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.step-label {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-mid);
  letter-spacing: 0.01em;
}

.sms-thread-compact {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
}

.sms-thread-compact .sms-bubble {
  max-width: 92%;
}

/* --- Step Description (How It Works — Step 1 text-only) --- */
.step-description {
  font-size: var(--text-sm);
  color: var(--color-text-mid);
  line-height: 1.55;
}

/* --- Conversation Showcase --- */
.showcase {
  padding-block: var(--space-3xl);
  background-color: var(--color-bg);
}

.showcase-tier {
  margin-bottom: var(--space-2xl);
}

.showcase-tier:last-child {
  margin-bottom: 0;
}

.tier-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 100px;
  margin-bottom: var(--space-lg);
}

.tier-free {
  background-color: var(--color-accent-light);
  color: var(--color-accent-bold);
}

.tier-pro {
  background-color: var(--color-pro-light);
  color: var(--color-pro);
}

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.showcase-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: 0 1px 3px oklch(0.22 0.015 55 / 0.04);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.showcase-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-md);
  border-bottom: 1px solid var(--color-border);
}

.showcase-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--color-accent);
  color: var(--color-white);
  font-family: var(--font-logo);
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.showcase-card-meta {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.showcase-card-name {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.2;
}

.showcase-card-title {
  font-size: var(--text-xs);
  color: var(--color-text-soft);
  line-height: 1.2;
}

.showcase-thread {
  padding: var(--space-md);
  flex: 1;
}

.sms-time-break {
  text-align: center;
  font-size: var(--text-xs);
  color: var(--color-text-soft);
  padding-block: var(--space-sm);
  margin-top: var(--space-sm);
  border-top: 1px dashed var(--color-border);
}

.sms-list {
  list-style: none;
  padding: 0;
  margin: 0.375rem 0;
}

.sms-list li {
  position: relative;
  padding-left: 0.875rem;
  font-size: var(--text-sm);
  line-height: 1.5;
}

.sms-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: var(--color-text-mid);
}

/* --- Bottom CTA --- */
.bottom-cta {
  padding-block: var(--space-3xl);
}

.bottom-cta-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bottom-cta-text {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
  font-style: italic;
  color: var(--color-text);
  max-width: 48ch;
  margin-bottom: var(--space-xl);
  line-height: 1.35;
}

.bottom-cta .signup-form {
  max-width: 440px;
  width: 100%;
}

.bottom-cta .consent {
  text-align: center;
}

/* --- Footer --- */
.footer {
  padding-block: var(--space-xl);
  border-top: 1px solid var(--color-border);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
}

.footer-logo-icon {
  flex-shrink: 0;
}

.footer-wordmark {
  font-family: var(--font-logo);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: -0.01em;
  line-height: 1;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.footer-links a {
  font-size: var(--text-xs);
  color: var(--color-text-soft);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--color-text-mid);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-note {
  font-size: var(--text-xs);
  color: var(--color-text-soft);
}

.consent a {
  color: var(--color-text-mid);
  text-underline-offset: 2px;
}

.consent a:hover {
  color: var(--color-text);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .hero {
    padding-block: var(--space-xl) var(--space-xl);
    min-height: auto;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .hero-text {
    order: 1;
  }

  .hero-visual {
    order: 2;
  }

  .phone-frame {
    margin-left: 0;
    max-width: 100%;
  }

  .signup-form {
    max-width: 100%;
  }

  .form-row {
    flex-direction: column;
    gap: var(--space-md);
  }

  .btn-primary {
    width: 100%;
    text-align: center;
  }

  .steps-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    max-width: 380px;
    margin-inline: auto;
  }

  .how-it-works {
    padding-block: var(--space-2xl);
  }

  .showcase {
    padding-block: var(--space-2xl);
  }

  .showcase-grid {
    grid-template-columns: 1fr;
    max-width: 380px;
    margin-inline: auto;
  }

  .bottom-cta {
    padding-block: var(--space-2xl);
  }

  .footer-inner {
    flex-direction: column;
    gap: var(--space-sm);
    text-align: center;
  }
}

@media (max-width: 480px) {
  .container {
    padding-inline: var(--space-md);
  }

  .phone-frame {
    padding: var(--space-md) var(--space-sm);
  }

  .showcase-card-header {
    padding: var(--space-sm) var(--space-sm);
  }

  .showcase-thread {
    padding: var(--space-sm);
  }
}
