@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=SF+Pro+Display:wght@400;500;600;700;800;900&display=swap');

:root {
  /* iOS 26 Liquid Glass Sky Theme */
  /* --bg-color removed; body now uses sky gradient directly */
  --glass-bg: rgba(255, 255, 255, 0.65);
  --glass-border: rgba(255, 255, 255, 0.85);
  --glass-highlight: rgba(255, 255, 255, 0.95);
  
  /* Primary Colors - Premium iOS Sky Blue & Clean Jade */
  --color-primary: #007aff; /* Apple Blue */
  --color-primary-glow: rgba(0, 122, 255, 0.25);
  --color-accent: #34c759; /* Apple Green */
  --color-accent-glow: rgba(52, 199, 89, 0.25);
  --text-main: #1c1c1e;
  --text-secondary: #48484a;
  --text-muted: #8e8e93;
  
  --card-radius: 36px;
  --transition-speed: 0.65s;
  --transition-timing: cubic-bezier(0.16, 1, 0.3, 1); /* Apple-like natural deceleration */
}

/* Base Body Styling */
body {
  background: radial-gradient(circle at 50% -20%, #e0f4ff 0%, #c8e8fa 30%, #a8d8f8 65%, #8bc8f0 100%);
  color: var(--text-main);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Plus Jakarta Sans", sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  position: relative;
}

/* Glassy Horizon Arc Overlay */
body::before {
  content: '';
  position: absolute;
  top: 55%;
  left: -20%;
  width: 140%;
  height: 80%;
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 70%);
  border-top: 2px solid rgba(255, 255, 255, 0.45);
  transform: rotate(-4deg);
  pointer-events: none;
  z-index: 1;
}

/* Floating CSS Cloud Backdrop Layer */
.sky-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 100px;
  filter: blur(16px);
  animation: floatCloud 45s linear infinite;
  opacity: 0.85;
}

.cloud::before, .cloud::after {
  content: '';
  position: absolute;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 50%;
}

.cloud-1 {
  width: 250px;
  height: 70px;
  top: 15%;
  left: -300px;
  animation-duration: 50s;
}
.cloud-1::before {
  width: 100px;
  height: 100px;
  top: -50px;
  left: 40px;
}
.cloud-1::after {
  width: 130px;
  height: 130px;
  top: -75px;
  left: 90px;
}

.cloud-2 {
  width: 180px;
  height: 50px;
  bottom: 20%;
  left: -200px;
  animation-duration: 35s;
  animation-delay: 15s;
}
.cloud-2::before {
  width: 70px;
  height: 70px;
  top: -35px;
  left: 30px;
}
.cloud-2::after {
  width: 90px;
  height: 90px;
  top: -50px;
  left: 70px;
}

.cloud-3 {
  width: 320px;
  height: 90px;
  top: 45%;
  left: -400px;
  animation-duration: 65s;
  animation-delay: 5s;
  opacity: 0.65;
}
.cloud-3::before {
  width: 130px;
  height: 130px;
  top: -65px;
  left: 50px;
}
.cloud-3::after {
  width: 160px;
  height: 160px;
  top: -95px;
  left: 120px;
}

@keyframes floatCloud {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(100vw + 400px)); }
}

/* Card Wrapper Entrance Animation */
@keyframes wrapperEntrance {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(30px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* iOS 26 Liquid Glass Card Container */
.typeform-wrapper {
  position: relative;
  width: 100%;
  max-width: 590px;
  height: 560px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(60px) saturate(240%) brightness(1.05);
  -webkit-backdrop-filter: blur(60px) saturate(240%) brightness(1.05);
  border: 1.5px solid rgba(255, 255, 255, 0.92);
  border-radius: var(--card-radius);
  box-shadow: 
    0 40px 90px rgba(0, 0, 0, 0.08),
    0 8px 24px rgba(0, 0, 0, 0.04),
    inset 0 2px 0 rgba(255, 255, 255, 0.98),
    inset 0 -1px 3px rgba(0, 0, 0, 0.03);
  z-index: 2;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: wrapperEntrance 0.85s var(--transition-timing) both;
}

/* Glossy highlight reflection sweep — stronger, more premium */
.typeform-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 55%;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.65) 0%,
    rgba(255, 255, 255, 0.15) 40%,
    rgba(255, 255, 255, 0) 100%
  );
  pointer-events: none;
  border-top-left-radius: var(--card-radius);
  border-top-right-radius: var(--card-radius);
  z-index: 1;
}

/* Custom Header with Progress Bar */
.tf-header {
  padding: 24px 40px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}

.tf-step-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tf-progress-track {
  width: 130px;
  height: 6px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  border: 0.5px solid rgba(255, 255, 255, 0.5);
}

.tf-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-primary) 0%, #5ac8fa 100%);
  border-radius: 10px;
  box-shadow: 0 0 6px rgba(0, 122, 255, 0.4);
  transition: width var(--transition-speed) var(--transition-timing);
}

/* Viewport slider */
.tf-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.tf-slider {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transition: transform var(--transition-speed) var(--transition-timing);
}

/* iOS Card Slides */
.tf-card {
  height: 100%;
  width: 100%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2.5rem;
  box-sizing: border-box;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 122, 255, 0.15) transparent;
}

.tf-card::-webkit-scrollbar {
  width: 4px;
}
.tf-card::-webkit-scrollbar-thumb {
  background: rgba(0, 122, 255, 0.15);
  border-radius: 4px;
}

/* Staggered load animation */
.tf-card > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.65s var(--transition-timing);
}

.tf-card.active > * {
  opacity: 1;
  transform: translateY(0);
}

/* Delay configurations */
.tf-card.active > .tf-question-title { transition-delay: 0.08s; }
.tf-card.active > .tf-desc { transition-delay: 0.16s; }
.tf-card.active > .tf-input-container { transition-delay: 0.24s; }
.tf-card.active > .welcome-btn-row { transition-delay: 0.24s; }
.tf-card.active > .fa-logo-glossy { transition-delay: 0.08s; }
.tf-card.active > div { transition-delay: 0.24s; }

/* Conversational Headings */
.tf-question-title {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 12px;
  margin-bottom: 16px;
}

.tf-emoji-icon {
  font-size: 1.8rem;
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.06));
}

h2.tf-heading {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0;
}

h2.tf-heading strong {
  color: var(--color-primary);
  font-weight: 800;
}

.tf-desc {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 28px;
  padding-left: 0;
  max-width: 460px;
  align-self: center;
  text-align: center;
}

/* Liquid Glass Input Fields */
.tf-input-container {
  padding-left: 0;
  width: 100%;
  max-width: 420px;
  align-self: center;
  position: relative;
}

.tf-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-bottom: 2px solid rgba(0, 122, 255, 0.2);
  font-family: inherit;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-main);
  outline: none;
  padding: 12px 16px;
  border-radius: 16px;
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 2px 8px rgba(0, 0, 0, 0.02),
    0 4px 12px rgba(0, 0, 0, 0.02);
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.tf-input::placeholder {
  color: rgba(0, 0, 0, 0.2);
}

.tf-input:focus {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(255, 255, 255, 0.9);
  border-bottom-color: var(--color-primary);
  box-shadow: 
    0 6px 24px rgba(0, 122, 255, 0.08), 
    0 0 0 4px rgba(0, 122, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 1);
}

textarea.tf-input {
  font-size: 1.25rem;
  line-height: 1.5;
  height: 90px;
  resize: none;
}

/* Error indicator */
.tf-error {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #ff3b30; /* iOS Red */
  margin-top: 8px;
  padding-left: 16px;
  animation: slideDown 0.2s var(--transition-timing);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Footer Navigation Controls */
.tf-navigation-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid rgba(255, 255, 255, 0.85);
  z-index: 10;
  transition: opacity 0.3s ease;
}

.tf-nav-hints {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Liquid OK/Submit Button (Glossy water drop effect) */
.btn-ok {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0) 50.1%, rgba(255, 255, 255, 0.05) 100%), var(--color-accent);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50px;
  padding: 12px 30px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 
    0 4px 15px rgba(52, 199, 89, 0.3), 
    inset 0 1px 1px rgba(255, 255, 255, 0.6),
    inset 0 -1px 2px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  outline: none;
}

.btn-ok:hover {
  transform: translateY(-1px);
  box-shadow: 
    0 6px 18px rgba(52, 199, 89, 0.4), 
    inset 0 1px 1px rgba(255, 255, 255, 0.8),
    inset 0 -1px 2px rgba(0, 0, 0, 0.1);
}

.btn-ok:active {
  transform: translateY(1px);
}

.tf-enter-hint {
  font-size: 0.75rem;
  color: var(--color-primary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.tf-enter-hint kbd {
  background: rgba(255, 255, 255, 0.75);
  border: 0.5px solid rgba(0, 0, 0, 0.1);
  padding: 2px 6px;
  border-radius: 5px;
  font-family: monospace;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

/* Navigation arrows */
.tf-arrow-controls {
  display: flex;
  border: 1.5px solid rgba(255, 255, 255, 0.95);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.45);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.btn-nav-arrow {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 12px 16px;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, opacity 0.2s ease;
  outline: none;
}

.btn-nav-arrow:hover {
  background-color: rgba(255, 255, 255, 0.6);
}

.btn-nav-arrow:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.btn-nav-arrow:first-child {
  border-right: 1px solid rgba(255, 255, 255, 0.8);
}

/* Welcome Button (Step 0) */
.welcome-btn-row {
  margin-top: 10px;
  padding-left: 0;
  display: flex;
  justify-content: center;
  width: 100%;
}

.btn-glossy-primary {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0) 50.1%, rgba(255, 255, 255, 0.05) 100%), var(--color-primary);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50px;
  padding: 16px 36px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 
    0 6px 22px rgba(0, 122, 255, 0.3), 
    inset 0 1px 1px rgba(255, 255, 255, 0.6),
    inset 0 -1px 2px rgba(0, 0, 0, 0.1);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease;
  outline: none;
}

.btn-glossy-primary:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 10px 24px rgba(0, 122, 255, 0.35), 
    inset 0 1px 1px rgba(255, 255, 255, 0.8),
    inset 0 -1px 2px rgba(0, 0, 0, 0.1);
}

.btn-glossy-primary:active {
  transform: translateY(1px);
}

/* Success Card details */
.tf-success-card {
  text-align: center;
  align-items: center;
  justify-content: center;
}

.fa-logo-glossy {
  width: 76px;
  height: 76px;
  background: radial-gradient(circle at 35% 35%, #34c759 0%, #28cd41 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    0 8px 24px rgba(52, 199, 89, 0.35), 
    inset 0 2px 4px rgba(255, 255, 255, 0.7), 
    0 0 0 8px rgba(52, 199, 89, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.4);
  margin-bottom: 24px;
  animation: pulseEco 2.5s infinite;
}

.fa-check-mark {
  color: white;
  font-size: 2.5rem;
  font-weight: 800;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.1));
}

@keyframes pulseEco {
  0% { box-shadow: 0 8px 24px rgba(52, 199, 89, 0.35), inset 0 2px 4px rgba(255, 255, 255, 0.7), 0 0 0 0 rgba(52, 199, 89, 0.18); }
  70% { box-shadow: 0 8px 24px rgba(52, 199, 89, 0.35), inset 0 2px 4px rgba(255, 255, 255, 0.7), 0 0 0 16px rgba(52, 199, 89, 0); }
  100% { box-shadow: 0 8px 24px rgba(52, 199, 89, 0.35), inset 0 2px 4px rgba(255, 255, 255, 0.7), 0 0 0 0 rgba(52, 199, 89, 0); }
}

.tf-spinner {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
  display: none;
}

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

/* Confetti layout */
#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 100;
}

/* TapPixel Badge Watermark */
.tf-badge {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  font-size: 0.72rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  z-index: 20;
  transition: background 0.2s ease;
  cursor: default;
  white-space: nowrap;
  user-select: none;
}

.tf-badge:hover {
  background: rgba(255, 255, 255, 0.85);
  transform: translateX(-50%);
}

.tf-badge span {
  font-weight: 500;
  opacity: 0.7;
}

.tf-badge strong {
  font-weight: 700;
  color: var(--text-main);
}

/* Responsive constraints - World-Class Mobile View */
@media (max-width: 640px) {
  body {
    padding: 0;
    align-items: flex-start;
  }

  @keyframes wrapperEntranceMobile {
    from {
      opacity: 0;
      transform: translateY(40px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .typeform-wrapper {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: 100%;
    border-radius: 0;
    border: none;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    animation: wrapperEntranceMobile 0.8s var(--transition-timing) both;
  }

  .typeform-wrapper::after {
    border-radius: 0;
  }

  .tf-header {
    padding: 1.25rem 1.25rem 0.5rem;
  }

  .tf-card {
    padding: 1.5rem 1.25rem;
    padding-top: 2rem;
    padding-bottom: 5rem; /* space for fixed footer */
    justify-content: flex-start;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tf-question-title {
    margin-bottom: 0.75rem;
    gap: 8px;
  }

  .tf-emoji-icon {
    font-size: 1.45rem;
  }

  h2.tf-heading {
    font-size: 1.35rem;
    line-height: 1.3;
  }

  .tf-desc {
    font-size: 1rem;
    padding-left: 0;
    margin-bottom: 1.25rem;
    line-height: 1.55;
  }

  .tf-input-container {
    padding-left: 0;
    margin-top: 1rem !important;
  }

  .tf-input {
    font-size: 1.25rem;
    padding: 10px 12px;
    border-radius: 12px;
  }

  textarea.tf-input {
    font-size: 1.1rem;
    height: 75px;
  }

  .tf-error {
    padding-left: 0;
    font-size: 0.8rem;
  }

  .welcome-btn-row {
    padding-left: 0;
    margin-top: 1rem;
  }

  .btn-glossy-primary {
    padding: 12px 28px;
    font-size: 0.95rem;
    width: 100%;
    justify-content: center;
  }

  .tf-navigation-box {
    padding: 12px 20px 24px;
    background: rgba(255, 255, 255, 0.45);
  }

  .tf-enter-hint {
    display: none;
  }

  .fa-logo-glossy {
    width: 60px;
    height: 60px;
    margin-bottom: 16px;
  }

  .fa-check-mark {
    font-size: 2rem;
  }

  .tf-badge {
    bottom: 8px;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    box-shadow: none;
    padding: 0;
  }

  .tf-badge:hover {
    background: transparent;
    transform: translateX(-50%) translateY(0);
  }
}
