:root {
  --primary-teal: #006666;
  --dark-teal: #014D4E;
  --accent-orange: #CC5500;
  --bg-color: #F7F7F7;
  --card-bg: #ffffff;
  --text-color: #333333;
  --light-gray: #e0e0e0;
  --font-family-sans: "Outfit", sans-serif;
  --font-family-serif: "Georgia", serif;
}

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

body {
  font-family: var(--font-family-sans);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
header {
  background-color: white;
  padding: 1.35rem 2rem;
  position: relative;
  border-bottom: none;
}

.header-container {
  max-width: 1160px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--dark-teal);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-family: Georgia, 'Times New Roman', Times, serif;
  text-decoration: none;
}

.logo img {
  height: 50px;
  width: auto;
}

.desktop-nav a {
  text-decoration: none;
  color: #555;
  margin-left: 2.4rem;
  font-size: 1.2rem;
  font-weight: 600;
  transition: color 0.2s;
  font-family: 'AR One Sans', sans-serif;
}

.desktop-nav a.active {
  color: var(--accent-orange);
}

.desktop-nav a:hover {
  color: var(--accent-orange);
}

.mobile-menu-toggle {
  display: none !important;
}

.mobile-menu {
  display: none !important;
}

/* Utility Classes */
.hidden {
  display: none !important;
}

.desktop-only {
  display: block;
}

.mobile-only {
  display: none;
}

@media (max-width: 600px) {
  header {
    padding: 0.3rem 1rem !important;
  }

  .header-container {
    justify-content: space-between !important;
    width: 100%;
  }

  .logo {
    gap: 0;
  }

  .logo img {
    height: 45px !important;
    margin: 0 !important;
  }

  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: block !important;
  }

  .mobile-nav {
    display: flex !important;
    gap: 0.8rem !important;
    align-items: center;
  }

  .mobile-nav a {
    text-decoration: none;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    color: #555;
  }

  .mobile-nav a.active {
    color: var(--accent-orange);
  }

  .mobile-nav a:hover {
    color: var(--accent-orange);
  }
}



/* Main Content */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem 1rem;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

@media (max-width: 600px) {
  main {
    padding: 0.5rem 0.5rem;
  }
}

.page-title {
  font-family: var(--font-family-serif);
  color: var(--dark-teal);
  font-size: 1.8rem;
  margin-bottom: 1rem;
  text-align: center;
}

#results-section .page-title {
  font-size: 2.2rem;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.progress-container {
  width: 100%;
  max-width: 800px;
  display: flex;
  gap: 6px;
  margin-bottom: 2rem;
}

.progress-segment {
  flex: 1;
  height: 4px;
  background-color: #eee;
  border-radius: 2px;
  transition: background-color 0.3s ease;
}

.progress-segment.active {
  background-color: #D97A3A;
}

/* Question Cards */
.card-container {
  background-color: var(--card-bg);
  width: 100%;
  max-width: 900px;
  padding: 3rem;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
  text-align: center;
  margin-bottom: 2rem;
}

h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 2rem;
  line-height: 1.3;
  text-align: left;
}

h2.personalization-title {
  text-align: center;
}

.personalization-subtitle {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 2rem;
  line-height: 1.3;
  text-align: center;
  color: var(--text-color);
}

@media (max-width: 600px) {
  .personalization-subtitle {
    font-size: 0.95rem !important;
    margin-bottom: 1.5rem !important;
  }
}

.optional-text {
  font-size: 0.85rem;
  font-weight: 400;
  opacity: 0.8;
  margin-left: 4px;
}

.question-card-icon {
  width: 80px;
  height: auto;
  margin: 0 auto 1.5rem auto;
  display: block;
}

/* Answer Choices */
#answer-area {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  width: 100%;
}

.choice-btn {
  background-color: white;
  border: 1px solid var(--light-gray);
  border-radius: 10px;
  padding: 1.2rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-color);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  display: flex;
  align-items: center;
}

.choice-btn:hover {
  border-color: var(--primary-teal);
  background-color: #f0f7f7;
}

.choice-btn.selected {
  border: 2px solid var(--primary-teal);
  background-color: #e6f0f0;
  font-weight: 600;
}

/* Navigation Buttons */
.navigation-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

.navigation-buttons.personalization-nav {
  flex-direction: column-reverse;
  align-items: center;
  gap: 1.5rem;
}

.navigation-buttons.personalization-nav #back-btn {
  margin: 0 auto;
  font-size: 0.9rem;
}

.btn-primary {
  background-color: var(--primary-teal);
  color: white;
  padding: 0.7rem 2rem;
  border-radius: 6px;
  border: none;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  min-width: 140px;
  text-transform: uppercase;
}

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

.btn-text {
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.6rem 1.2rem;
  transition: opacity 0.2s;
}

.btn-text.back-charcoal {
  color: #888;
  font-weight: 500;
}

.btn-text.back-light {
  color: #bbb;
  font-weight: 400;
}

.btn-text.back-darkened {
  color: #919191;
  font-weight: 500;
}

.btn-text.back-faint {
  color: #ddd;
  font-weight: 400;
}

/* Results Section */
#results-section {
  width: 100%;
  max-width: 800px;
  text-align: center;
  margin-top: 0;
}

@media (min-width: 601px) {
  #results-content-container {
    padding: 0.5rem 3rem 3rem 3rem;
    margin-top: 0;
  }
}

.badge-capsule {
  display: inline-block;
  background-color: #CC5500 !important;
  color: white !important;
  padding: 0.8rem 2.5rem !important;
  border-radius: 50px !important;
  font-weight: 700 !important;
  font-size: 1rem !important;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 1rem;
  margin-bottom: 2rem !important;
}

.result-hero-icon {
  width: 140px;
  height: auto;
  margin: 0 auto 1.5rem auto;
  display: block;
  object-fit: contain;
}

.insight-text {
  font-size: 1.15rem;
  line-height: 1.8;
  margin-bottom: 1.2rem;
  color: #333;
  text-align: center;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.insight-text-first {
  display: block;
  margin-bottom: 1rem;
}

.sleep-quote {
  font-size: 1.15rem;
  font-family: serif;
  font-style: italic;
  color: #CC5500 !important;
  margin: 1.2rem 0 2rem 0 !important;
  line-height: 1.5;
}

/* Results Actions Refinement */
.results-action-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  margin-top: 3rem;
  width: 100%;
}

.share-main-btn {
  padding: 0.8rem 3rem;
  font-size: 1.05rem;
  border-radius: 8px;
}

.results-sub-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

.retake-link {
  color: #888;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.retake-link:hover {
  color: var(--primary-teal);
  text-decoration: underline;
}

.skip-link {
  display: block;
  margin: 1.5rem auto 0 auto;
  color: #888;
  text-decoration: none;
  font-size: 0.9rem;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  width: fit-content;
}

.skip-link:hover {
  color: var(--primary-teal);
}

/* Ad Container Rule 12 */
.ad-container {
  width: 100%;
  height: 90px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 24px 0;
  overflow: hidden;
}

/* Share Modal */
.modal {
  display: flex;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  justify-content: center;
  align-items: center;
}

.modal.hidden {
  display: none !important;
}

.modal-content {
  background-color: white;
  padding: 2.5rem 2rem;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  text-align: center;
  position: relative;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.close-modal {
  position: absolute;
  top: 10px;
  right: 20px;
  color: #aaa;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close-modal:hover {
  color: black;
}

.social-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}

.social-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  border-radius: 8px;
  text-decoration: none;
  color: #333;
  transition: all 0.2s ease;
  border: 1px solid #eee;
}

.social-icon:hover {
  background-color: #f9f9f9;
  transform: translateY(-2px);
}

.social-icon i,
.social-img-icon {
  font-size: 1.8rem;
  width: 1.8rem;
  height: 1.8rem;
  margin-bottom: 0.5rem;
  object-fit: contain;
}

.social-icon span {
  font-size: 0.8rem;
  font-weight: 500;
}

/* Social Network Colors */
.social-icon.facebook i {
  color: #1877F2;
}

.social-icon.threads i {
  color: #000000;
}

.social-icon.reddit i {
  color: #FF4500;
}

.social-icon.linkedin i {
  color: #0A66C2;
}

.social-icon.twitter i {
  color: #000000;
}

.social-icon.bluesky i {
  color: #0085FF;
}

.social-icon:hover {
  opacity: 0.8;
  transform: translateY(-2px);
  transition: all 0.2s ease;
}

/* Footer */
footer {
  background-color: var(--primary-teal);
  padding: 1rem 2rem;
  text-align: center;
  font-size: 0.9rem;
  color: white;
  margin-top: auto;
}

footer p {
  color: white;
  margin: 0;
  opacity: 0.9;
}

/* Mobile Responsive */
@media (max-width: 600px) {
  .card-container {
    padding: 1rem 1.2rem;
    border-radius: 12px;
    box-shadow: none;
    margin-bottom: 1rem;
  }

  #intro-page {
    padding: 2.5rem 1.2rem;
  }

  #answer-area {
    grid-template-columns: 1fr;
    gap: 0.6rem !important;
  }

  .page-title {
    font-size: 1.3rem !important;
    margin: 1rem 0 1rem 0;
  }

  .progress-container {
    width: 70%;
    margin: 5px auto 1.5rem auto;
    gap: 4px;
    max-width: 250px;
  }

  h2 {
    font-size: 0.95rem !important;
    margin-bottom: 1rem !important;
  }

  .question-card-icon {
    width: 60px !important;
    margin-bottom: 0.4rem !important;
    margin-top: 0 !important;
  }

  .navigation-buttons {
    margin-top: 1rem;
  }

  .choice-btn {
    padding: 0.6rem 1rem !important;
    font-size: 0.85rem !important;
  }

  .text-input {
    font-size: 0.95rem;
    padding: 0.8rem;
  }


  .desktop-nav {
    display: none;
  }

  .results-sub-links {
    flex-direction: column;
    gap: 1rem;
    align-items: center;
  }
}

.hidden {
  display: none !important;
}

.spinner-small {
  width: 30px;
  height: 30px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid var(--primary-teal);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem auto;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Personalization Step Icons */
.step-icon-img {
  width: 60px;
  height: 60px;
  margin-bottom: 1rem;
}

/* Lifestyle Badge */
.lifestyle-badge {
  display: inline-block;
  background-color: #f0f7f7;
  color: var(--primary-teal);
  padding: 0.4rem 1rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1.5rem;
  border: 1px solid #e0eaea;
}

#age-input {
  max-width: 120px;
}

#intro-page .navigation-buttons {
  margin-top: 0.5rem;
}

.text-input-container {
  width: 100%;
  margin: 0 auto 0.5rem auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.text-input {
  width: 100%;
  max-width: 400px;
  padding: 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  border: 2px solid var(--light-gray);
  border-radius: 8px;
  outline: none;
  text-align: center;
}

.text-input:focus {
  border-color: var(--primary-teal);
}

.text-input::placeholder {
  font-size: 1.1rem;
  font-weight: 400;
  color: #aaa;
}

/* Hide spin buttons for Chrome, Safari, Edge, Opera */
.text-input::-webkit-outer-spin-button,
.text-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}

/* Hide spin buttons for Firefox */
.text-input[type=number] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* Results Page Redesign */
.result-header {
  text-align: center;
  margin-bottom: 0.5rem;
}

.result-age-display {
  font-size: 6rem;
  font-weight: 800;
  color: #d17842;
  /* Orange-ish from mockup */
  line-height: 1;
  margin: 2.5rem 0;
  text-align: center;
}

.result-category-badge {
  display: inline-block;
  background-color: #1a716c;
  /* Deep Teal */
  color: white;
  padding: 0.8rem 2rem;
  border-radius: 50px;
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 2.5rem;
  box-shadow: 0 4px 10px rgba(26, 113, 108, 0.2);
}

/* Slider Barometer */
.slider-container {
  width: 100%;
  max-width: 500px;
  margin: 0 auto 3.5rem auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  justify-content: center;
}

.slider-label {
  font-size: 0.95rem;
  color: #666;
  font-weight: 500;
}

.slider-track {
  width: 250px;
  height: 4px;
  background: linear-gradient(to right, #98c7c4, #e0eaea, #f0d0bd);
  border-radius: 2px;
  position: relative;
}

.slider-dot {
  width: 16px;
  height: 16px;
  background-color: #d17842;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  /* JS will control this */
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 4px rgba(209, 120, 66, 0.2);
}

/* Insight Card */
.insight-card {
  background: white;
  border-radius: 12px;
  padding: 3rem;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  margin-bottom: 2.5rem;
  border: 1px solid #f2f2f2;
}

.insight-barometer {
  font-size: 1.6rem;
  font-weight: normal;
  color: #000;
  margin-bottom: 1.5rem;
  line-height: 1.3;
}

.insight-text {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #555;
  margin-bottom: 2rem;
}

.insight-close {
  font-size: 1.25rem;
  font-weight: 700;
  color: #d17842;
  margin-top: 2rem;
}

/* Result Actions */
.result-actions {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.btn-secondary-outline {
  background: white !important;
  color: #1a716c !important;
  border: 2px solid #1a716c !important;
}

.btn-secondary-outline:hover {
  background: #f0f7f7 !important;
}

/* General Layout Adjustments */
.results-page-wrapper {
  max-width: 700px;
  margin: -1rem auto 0;
  padding: 0 1rem;
}

@media (max-width: 600px) {
  .result-age-display {
    font-size: 4.5rem;
  }

  .insight-card {
    padding: 1.5rem;
  }

  .result-actions {
    flex-direction: column;
    width: 100%;
  }
}

/* Error Message */
.error-msg {
  color: #d32f2f;
  font-size: 0.9rem;
  font-weight: 500;
  margin-top: 0.5rem;
  height: 1.2rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.error-msg.visible {
  opacity: 1;
}

/* Vibration Animation */
@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-5px);
  }

  50% {
    transform: translateX(5px);
  }

  75% {
    transform: translateX(-5px);
  }
}

.shake {
  animation: shake 0.3s ease-in-out;
}

.subtitle {
  font-size: 0.95rem;
  color: #555;
  text-align: center;
  font-family: var(--font-family-sans);
  display: block;
  line-height: 1.5;
}

@media (max-width: 600px) {
  .desktop-only {
    display: none !important;
  }
}

@media (min-width: 601px) {
  .mobile-only {
    display: none !important;
  }
}

/* Question Icon Styling */
.question-card-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem auto;
  display: block;
  object-fit: contain;
}

@media (min-width: 601px) {
  .question-card-icon {
    width: 100px;
    height: 100px;
  }
}

/* Updated Badge Capsule per Screenshot */
/* Badge Styles consolidated above */

/* Result Hero Icon */
.result-hero-icon {
  width: 140px;
  height: auto;
  margin: 0 auto 1.5rem auto;
  display: block;
  object-fit: contain;
}

/* Insight Paragraph Styling */
.insight-text {
  font-size: 1.15rem;
  line-height: 1.8;
  color: #333;
  margin-bottom: 1.2rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.insight-text strong {
  font-weight: 700;
}

/* Quote Text Styling (Close Paragraph) */
.sleep-quote {
  font-size: 1.4rem;
  font-family: serif;
  font-style: italic;
  color: #CC5500 !important;
  margin: 1.2rem 0 2rem 0 !important;
  line-height: 1.5;
}

/* Results Actions Styling */
.results-btn-group {
  display: flex;
  gap: 1.2rem;
  justify-content: center;
  align-items: center;
  width: 100%;
}

@media (max-width: 600px) {
  .results-btn-group {
    flex-direction: column-reverse;
  }

  #results-section .page-title {
    font-size: 1.6rem !important;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.2;
  }

  .insight-text {
    line-height: 1.5 !important;
  }

  .results-sub-links {
    flex-direction: row !important;
    /* Force same row */
    gap: 1.5rem;
  }

  .badge-capsule {
    margin-top: 0.5rem !important;
  }

  .btn-text {
    font-size: 0.85rem !important;
  }
}

.btn-outline {
  background: white;
  border: 1.5px solid #0d5c63;
  color: #0d5c63;
  padding: 0.9rem 2rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  font-size: 1rem;
  cursor: pointer;
  flex: 1;
  max-width: 250px;
  text-align: center;
}

.btn-solid {
  background: #0d5c63;
  border: 1.5px solid #0d5c63;
  color: white;
  padding: 0.9rem 2rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  font-size: 1rem;
  cursor: pointer;
  flex: 1;
  max-width: 280px;
  text-align: center;
}

.retake-link {
  color: #888;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
}

.retake-link:hover {
  text-decoration: underline;
}