/* Wisely TikTok Landing Page */

:root {
  --background: #ffffff;
  --foreground: #171717;
  --font-roboto: "Roboto", ui-sans-serif, system-ui, sans-serif;
  --font-bricolage: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --color-primary: #ff5722;
  --color-primary-hover: #e64a19;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --color-gray-400: #9ca3af;
  --color-gray-500: #6b7280;
  --color-gray-600: #4b5563;
  --color-gray-700: #374151;
  --color-gray-800: #1f2937;
  --color-gray-900: #111827;
  --color-white: #ffffff;
  --max-width: 28rem;
  --hero-max-height: min(42vh, 16rem);
  --font-size-heading: 1.75rem;
  --line-height-heading: 2.125rem;
  --font-size-body: 1.125rem;
  --line-height-body: 1.875rem;
  --font-size-cta: 1.125rem;
  --font-size-instructions: 1.4375rem;
  --line-height-instructions: 2.0625rem;
}

@media (min-width: 25rem) {
  :root {
    --font-size-heading: 1.875rem;
    --line-height-heading: 2.25rem;
    --font-size-body: 1.25rem;
    --line-height-body: 2rem;
    --font-size-cta: 1.25rem;
    --font-size-instructions: 1.5625rem;
    --line-height-instructions: 2.1875rem;
  }
}

@media (min-width: 48rem) {
  :root {
    --font-size-heading: 2rem;
    --line-height-heading: 2.375rem;
    --font-size-body: 1.25rem;
    --line-height-body: 2rem;
    --font-size-cta: 1.25rem;
    --font-size-instructions: 1.625rem;
    --line-height-instructions: 2.25rem;
    --hero-max-height: min(24rem, 55vh);
  }
}

@media (min-width: 64rem) {
  :root {
    --font-size-heading: 2.25rem;
    --line-height-heading: 2.625rem;
    --font-size-body: 1.375rem;
    --line-height-body: 2.125rem;
    --font-size-cta: 1.375rem;
    --font-size-instructions: 1.75rem;
    --line-height-instructions: 2.5rem;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body:has(#step-viewport) {
  height: 100%;
  overflow: hidden;
}

body {
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-roboto);
  line-height: 1.5;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input {
  font: inherit;
}

.hidden {
  display: none !important;
}

/* Layout */

.step-viewport {
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--color-white);
  height: 100vh;
  height: 100dvh;
}

.step-track {
  display: flex;
  width: 200%;
  min-height: 100%;
  transition: transform 0.3s ease-in-out;
}

.step-pane {
  width: 50%;
  flex-shrink: 0;
  min-height: 100%;
}

.step-screen {
  background: var(--color-white);
  display: flex;
  flex-direction: column;
  max-width: var(--max-width);
  margin: 0 auto;
}



.step-fold {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#step-2 .step-fold,
#step-3 .step-fold,
#step4-other .step-fold {
  padding-top: calc(3rem + env(safe-area-inset-top, 0px));
}

.step-variant {
  display: block;
}

.step-hero {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.step-hero:not(.step-hero--arrow):not(.step-hero--cover) {
  flex: 0 1 auto;
  max-height: var(--hero-max-height);
}

.step-hero--cover {
  flex: 0 1 auto;
  max-height: none;
  justify-content: flex-start;
}

.step-hero--cover .step-hero-img {
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  object-position: top center;
}

@media (max-width: 47.9375rem) {
  .step-hero--cover {
    width: 100vw;
    max-width: 100vw;
    margin-inline: calc(50% - 50vw);
  }
}

@media (min-width: 48rem) {
  .step-hero--cover {
    width: auto;
    max-width: none;
    margin-inline: 0;
  }
}

.step-hero:not(.step-hero--arrow):not(.step-hero--cover) .step-hero-img:not(.step-hero-img--logo) {
  max-height: var(--hero-max-height);
}

.step-hero--arrow {
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  padding: calc(0.75rem + env(safe-area-inset-top, 0px)) 1.25rem 0;
}

.step-hero--arrow .step-hero-img--arrow {
  align-self: flex-end;
  width: clamp(6rem, 28vw, 8.75rem);
  height: auto;
}

.step-instructions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  margin-top: 0.5rem;
  text-align: center;
}

.step-bottom--icon {
  margin-top: auto;
  gap: 0;
  padding-top: 1.5rem;
}

.step-hero-img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.step-hero-img--logo {
  width: clamp(5rem, 22vw, 7.5rem);
  height: auto;
}

.step-bottom {
  flex-shrink: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.5rem;
  padding: 1rem 1.5rem calc(2.5rem + env(safe-area-inset-bottom, 0px));
}

.step-logo img {
  width: clamp(4rem, 18vw, 6.25rem);
  height: auto;
  margin: 0 auto;
}

/* Typography */

.font-headline {
  font-family: var(--font-bricolage);
}

.font-body {
  font-family: var(--font-roboto);
}

.section-heading {
  text-align: center;
}

.section-heading :is(h1, h2) {
  font-family: var(--font-bricolage);
  font-weight: 700;
  font-size: var(--font-size-heading);
  line-height: var(--line-height-heading);
  color: var(--color-gray-900);
  margin-bottom: 0.5rem;
}

.section-heading p {
  font-family: var(--font-roboto);
  font-weight: 400;
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
  letter-spacing: 0.1px;
  color: var(--color-gray-600);
}

.section-heading--compact {
  margin-bottom: 0;
}

.instructions-title {
  font-family: var(--font-roboto);
  font-weight: 700;
  font-size: var(--font-size-instructions);
  line-height: var(--line-height-instructions);
  color: var(--color-gray-900);
  margin-bottom: 0;
}

.instructions-note {
  font-family: var(--font-roboto);
  font-weight: 400;
  font-size: 14px;
  line-height: 20px;
  color: var(--color-gray-500);
  margin-bottom: 0;
}

/* Spacing utilities */

.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-4 { margin-top: 1rem; }

/* Buttons */

.cta-btn {
  width: 100%;
  font-family: var(--font-bricolage);
  font-weight: 700;
  font-size: var(--font-size-cta);
  padding: 1rem 2rem;
  border-radius: 0.75rem;
  transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

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

.cta-btn--primary {
  background-color: var(--color-primary);
  color: var(--color-white);
}

.cta-btn--primary:hover:not(:disabled) {
  background-color: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(255, 87, 34, 0.25);
}

.cta-btn--primary:active:not(:disabled) {
  transform: translateY(0);
}

.cta-btn--secondary {
  background-color: var(--color-gray-400);
  color: var(--color-white);
}

.cta-btn--secondary:hover:not(:disabled) {
  background-color: var(--color-gray-500);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(156, 163, 175, 0.25);
}

.cta-btn--secondary:active:not(:disabled) {
  transform: translateY(0);
}

/* Email input */

.email-field {
  width: 100%;
}

.email-input {
  width: 100%;
  background-color: var(--color-gray-100);
  border: 1px solid var(--color-gray-200);
  border-radius: 0.5rem;
  padding: 1rem;
  color: var(--color-gray-700);
  font-family: var(--font-roboto);
  font-size: 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.email-input:focus {
  outline: none;
  background-color: var(--color-white);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(255, 87, 34, 0.15);
}

.email-input[aria-invalid="true"] {
  border-color: #ef4444;
}

/* Footer */

.site-footer {
  flex-shrink: 0;
  padding: 1.5rem 1.5rem calc(2rem + env(safe-area-inset-bottom, 0px));
}

.site-footer__copyright {
  text-align: center;
  margin-bottom: 1rem;
}

.site-footer__copyright p {
  color: var(--color-gray-400);
  font-size: 0.875rem;
}

.site-footer__links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
}

.site-footer__links a {
  color: var(--color-gray-400);
  font-size: 0.875rem;
}

.site-footer__links a:hover {
  color: var(--color-gray-600);
}

.site-footer__divider {
  color: var(--color-gray-400);
}

/* Legal pages */

.legal-page {
  min-height: 100vh;
  background: var(--color-white);
  display: flex;
  flex-direction: column;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

@media (min-width: 48rem) {
  .legal-page {
    max-width: 32rem;
  }
}

@media (min-width: 64rem) {
  .legal-page {
    max-width: 36rem;
  }
}

.legal-page main {
  flex: 1;
}

.legal-page h1.page-title {
  font-family: var(--font-bricolage);
  font-weight: 700;
  font-size: 28px;
  line-height: 34px;
  color: var(--color-gray-900);
  margin-bottom: 1rem;
}

.legal-page section h2 {
  font-family: var(--font-bricolage);
  font-weight: 700;
  font-size: 1.25rem;
  margin: 1.5rem 0 0.75rem;
  color: var(--color-gray-900);
}

.legal-page section h3 {
  font-weight: 600;
  font-size: 1rem;
  margin: 1rem 0 0.5rem;
  color: var(--color-gray-800);
}

.legal-page section p {
  margin-bottom: 0.75rem;
  color: var(--color-gray-700);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.legal-page section ul {
  margin: 0.5rem 0 0.75rem 1.25rem;
  color: var(--color-gray-700);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.legal-page section li {
  margin-bottom: 0.25rem;
}

.legal-page section table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0;
  font-size: 0.875rem;
}

.legal-page section th,
.legal-page section td {
  border: 1px solid var(--color-gray-200);
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.legal-page section th {
  background: var(--color-gray-100);
  font-weight: 600;
}

.legal-page section a {
  color: var(--color-primary);
  text-decoration: underline;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--color-gray-600);
  font-family: var(--font-roboto);
}

.back-btn:hover {
  color: var(--color-gray-800);
}

.back-btn:active {
  color: var(--color-gray-900);
}

.app-store-icon {
  display: flex;
  justify-content: center;
}

.app-store-icon img {
  display: block;
  width: clamp(9rem, 40vw, 12.5rem);
  height: auto;
}

.step-bottom .cta-btn {
  margin-top: 0.25rem;
}

@media (max-height: 40rem) {
  .section-heading :is(h1, h2) {
    font-size: 1.5rem;
    line-height: 1.875rem;
  }

  .section-heading p {
    font-size: 1rem;
    line-height: 1.5rem;
  }

  .instructions-title {
    font-size: 1.25rem;
    line-height: 1.75rem;
  }

  .step-bottom {
    gap: 1rem;
    padding-top: 0.75rem;
    padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
  }
}

/* ==========================================================================
   Desktop styles (min-width: 768px / 48rem)
   Placed at the bottom to ensure correct specificity overrides
   ========================================================================== */

@media (min-width: 48rem) {
  .step-viewport {
    background-color: #f8fafc;
    background-image:
      radial-gradient(at 0% 0%, rgba(255, 87, 34, 0.04) 0px, transparent 50%),
      radial-gradient(at 50% 0%, rgba(255, 87, 34, 0.02) 0px, transparent 50%),
      radial-gradient(at 100% 0%, rgba(139, 92, 246, 0.04) 0px, transparent 50%);
  }

  .step-pane {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .step-screen {
    max-width: 54rem;
    width: 100%;
    background: var(--color-white);
    border-radius: 1.5rem;
    box-shadow:
      0 10px 15px -3px rgba(0, 0, 0, 0.02),
      0 24px 50px -12px rgba(0, 0, 0, 0.08),
      0 0 50px 0 rgba(0, 0, 0, 0.01);
    border: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
    margin: 0 auto;
  }

  .step-fold {
    flex-direction: row;
    align-items: stretch;
    height: auto;
    min-height: 520px;
    overflow: visible;
    gap: 0;
    padding: 0;
  }

  .step-fold .step-hero {
    flex: 0 0 45%;
    max-width: 45%;
    max-height: none !important;
    width: auto;
    padding: 3rem 2.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 1.5rem 0 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }

  .step-fold .step-hero--cover {
    padding: 0;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
  }

  .step-fold .step-hero--cover .step-hero-img {
    max-height: none;
    width: 100%;
    height: auto;
    object-fit: contain;
  }

  .step-fold .step-hero-img {
    max-height: 280px;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .step-fold .step-hero:hover .step-hero-img {
    transform: scale(1.04);
  }

  .step-fold .step-bottom {
    flex: 1;
    min-width: 0;
    align-items: flex-start;
    justify-content: center;
    text-align: left;
    padding: 3.5rem 3rem;
  }

  .step-fold .section-heading,
  .step-fold .instructions-title {
    text-align: left;
  }

  .step-fold .step-logo img {
    margin: 0;
  }

  .step-fold .cta-btn {
    max-width: 22rem;
  }

  .step-fold .email-field {
    max-width: 22rem;
  }

  .step-fold .app-store-icon {
    justify-content: flex-start;
  }

  #step-2 .step-fold,
  #step-3 .step-fold,
  #step4-other .step-fold {
    padding-top: 0;
  }

  /* TikTok instructions step override (remains centered column) */
  #step4-tiktok .step-fold {
    flex-direction: column;
    align-items: stretch;
    height: auto;
    min-height: 0;
    padding: 2rem 1.5rem;
  }

  #step4-tiktok .step-hero--arrow {
    flex: 1 1 auto;
    max-width: 100%;
    background: none;
    padding: 0;
  }

  .site-footer {
    border-top: 1px solid #f1f5f9;
    background-color: #fafbfc;
    padding: 1.25rem 3rem;
    margin: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .site-footer__copyright {
    text-align: left;
    margin-bottom: 0;
  }
}

@media (min-width: 64rem) {
  .step-screen {
    max-width: 56rem;
  }
}
