/* Questionnaire. Carried over from the original app's questionnaire.css and mobile-fixes.css. */

:root {
  --logo-holder-dimensions: 6rem;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Roboto, system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
  background-color: #f5f2f2;
  position: relative;
}

/* The questions sit in <main>, laid out like the body used to lay them out. */
main {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.back-arrow {
  width: var(--logo-holder-dimensions);
  height: var(--logo-holder-dimensions);
  position: absolute;
  top: 0;
  left: 0;
  font-size: 2rem;
  cursor: pointer;
  color: #000000;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 200;
  box-sizing: border-box;
}

.back-arrow:hover {
  transform: translateX(-5px);
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  color: #000000;
}

.question-holder {
  width: 100%;
  max-width: 600px;
  margin-bottom: 1rem;
  text-align: center;
  padding: 0 2rem;
  display: none;
}

.goal-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.goal-option {
  width: 100%;
  background-color: #fff5cc;
  padding: 1.5rem;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid #000000;
  text-align: center;
  font-size: 1.25rem;
  color: #000000;
}

.goal-option.selected {
  background-color: #ffcb00;
  border-width: 3px;
}

.goal-option:active {
  transform: translateY(0);
}

.next-button-holder {
  text-align: center;
}

.next-button {
  width: fit-content;
  padding: 1.2rem 3.4rem;
  margin-top: 2rem;
  background-color: #ffcb00;
  border: 2px solid #000000;
  border-radius: 12px;
  font-size: 1.25rem;
  cursor: pointer;
  color: #000000;
  transition: all 0.3s ease;
}

.next-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.next-button:active {
  transform: translateY(0);
}

.next-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.footer {
  display: none;
}

input.goal-option {
  cursor: auto;
  height: 50px;
  line-height: 50px;
  padding: 0 1.5rem;
  text-align: left;
  vertical-align: middle;
}

textarea.goal-option {
  padding: 1rem 1.5rem;
  text-align: left;
  min-height: 120px;
  resize: vertical;
}

/* #2, #4, #61 */
/* .question-holder:nth-child(62) */
.question-holder:nth-child(4),
.question-holder:nth-child(6),
.question-holder:nth-child(63) {
  text-align: left;
  font-size: 1.5rem;
}

/* #5 */
/* Removing this old styling for screen 5 images since we've replaced it with better rules below */
/* .question-holder:nth-child(7) img {
  width: 100px;
  height: 100px;
} */

.logo-holder {
  width: 100%;
  height: var(--logo-holder-dimensions);
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 3rem;
  box-sizing: border-box;
}

.logo-holder img {
  width: 110px;
  height: auto;
  display: block;
}

.toggle-container {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1rem;
  gap: 1rem;
}

.toggle-button {
  position: relative;
  width: 60px;
  height: 30px;
  background-color: #ffcb00;
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid #000000;
}

.toggle-button::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  background-color: #ffffff;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.toggle-button.active {
  background-color: #ffcb00;
}

.toggle-button.active::before {
  transform: translateX(30px);
}

.toggle-label {
  font-size: 1rem;
  color: #000000;
  font-weight: bold;
}

.toggle-label:last-child {
  color: rgb(136, 136, 136);
}

.file-upload-container {
  position: relative;
  width: 100%;
  min-height: 150px;
  padding: 1.5rem;
  border: 2px dashed #000000;
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background-color: #fff5cc;
}

.file-upload-container:hover {
  background-color: #ffe680;
}

.file-upload-container input[type="file"] {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 10;
}

.file-list {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background-color: #f5f5f5;
  border-radius: 5px;
  border-left: 3px solid #ffcb00;
  text-align: left;
}

.file-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.file-remove {
  background: none;
  border: none;
  color: #d93025;
  font-size: 20px;
  cursor: pointer;
  padding: 0 5px;
}

.file-item span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.danger {
  color: red;
}

.circle-loader-container {
  width: 200px;
  height: 200px;
  position: relative;
  margin: 2rem auto;
}

.circle-loader {
  width: 100%;
  height: 100%;
  border: 10px solid #ffcb00;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
}

.circle-loader::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 10px solid #ffffff;
  border-radius: 50%;
  box-sizing: border-box;
}

.circle-loader-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background: #ffcb00;
  transition: height 0.1s linear;
}

.circle-loader-percentage {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  font-weight: bold;
  color: #000000;
  z-index: 1;
}

/* #60 */
/* .question-holder:nth-child(62) .next-button {
  display: none;
} */
  

.progress-holder {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 0.6rem;
  background-color: #f0f0f0;
  z-index: 100;
}

.progress-bar {
  height: 100%;
  background-color: #ffcb00;
  width: 0%;
  transition: width 0.3s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.submission-success {
  color: green; 
  font-weight: bold; 
  text-align: center; 
  padding: 20px; 
  display: none;
}

.submission-error {
  color: #e74c3c; 
  font-weight: bold; 
  text-align: center; 
  padding: 20px; 
  margin-bottom: 20px;
  display: none;
  border: 1px solid #e74c3c;
  border-radius: 8px;
  background-color: #fff5cc;
}

.error-recovery-options {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  margin-top: 25px;
}

.error-recovery-options .recovery-button {
  width: fit-content;
  padding: 0.8rem 2rem;
  background-color: #ffcb00;
  border: 2px solid #000000;
  border-radius: 12px;
  font-size: 1.1rem;
  cursor: pointer;
  color: #000000;
  transition: all 0.3s ease;
}

.error-recovery-options .recovery-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.error-recovery-options .recovery-button.secondary {
  background-color: #e0e0e0;
  border-color: #888888;
}

.error-recovery-options .recovery-button.secondary:hover {
  background-color: #d0d0d0;
}

.support-message {
  margin-top: 20px;
  font-size: 0.9rem;
  color: #555;
}

.validation-message {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #ff6b6b;
  color: white;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.validation-message.visible {
  display: block;
  opacity: 1;
}

/* Special styling for Screen 5 (pet selection) */
div[id="5"] {
  max-width: 100%;
}

/* Desktop and tablet layout (horizontal row) */
div[id="5"] .goal-container {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 1rem;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  overflow-x: auto;
  padding-bottom: 10px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

/* Hide scrollbar for Chrome/Safari/Opera */
div[id="5"] .goal-container::-webkit-scrollbar {
  height: 4px;
}

div[id="5"] .goal-container::-webkit-scrollbar-thumb {
  background: #ffcb00;
  border-radius: 4px;
}

div[id="5"] .goal-option {
  flex: 0 0 auto;
  width: 148px;
  min-width: 148px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;
  padding-bottom: 0.6rem;
  min-height: 170px;
  margin-bottom: 10px;
  border-radius: 0;
  position: relative;
  z-index: 1;
  border: 2px solid #000000;
  box-sizing: border-box;
}

div[id="5"] img {
  width: 144px;
  height: 144px;
  margin-bottom: 0.2rem;
  object-fit: contain;
}

div[id="5"] .goal-option p {
  margin-top: 0.1rem;
  font-weight: bold;
  font-size: 1.2rem;
}

/* Add specific hover styles for pet selection */
div[id="5"] .goal-option:hover {
  border: 2px solid #000000;
  position: relative;
  z-index: 1;
  background-color: #ffe580;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin-top: -2px;
  margin-bottom: 12px;
}

/* Add specific selected styles for pet selection */
div[id="5"] .goal-option.selected {
  border: 3px solid #000000;
  position: relative;
  z-index: 1;
}

/* Medium screens (tablets) */
@media (min-width: 481px) and (max-width: 767px) {
  div[id="5"] .goal-option {
    width: 136px;
    min-width: 136px;
  }
  
  div[id="5"] img {
    width: 132px;
    height: 132px;
  }
  
  div[id="5"] .goal-container {
    max-width: 450px;
  }
}

/* Tablet-specific layout */
@media (min-width: 768px) {
  div[id="5"] .goal-container {
    max-width: 500px;
  }
}

/* Hover effects for desktop */
@media (min-width: 481px) {
  .goal-option:hover {
    background-color: #ffe580;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 2px solid #000000;
    position: relative;
    z-index: 1;
  }

  .back-arrow {
    left: 2rem;
  }
}

/* Basic mobile styles - specific responsive overrides moved to mobile-fixes.css */
@media (max-width: 480px) {
  h1 {
    font-size: 1.8rem;
  }

  .goal-option {
    font-size: 1rem;
    padding: 1.2rem;
  }

  body {
    padding: 1rem;
  }

  .back-arrow {
    left: 0rem;
  }
}

/* CSS for weight images on screens 17 and 18 (IDs 21 and 22) */
div[id="21"] .goal-container,
div[id="22"] .goal-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 15px;
  justify-content: center;
  max-width: 650px;
  margin: 0 auto;
}

div[id="21"] .goal-option,
div[id="22"] .goal-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5px;
  border-radius: 0;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
}

div[id="21"] .goal-option img,
div[id="22"] .goal-option img {
  width: 100%;
  height: auto;
  border-radius: 0;
  margin-bottom: 0.5rem;
}

div[id="21"] .goal-option p,
div[id="22"] .goal-option p {
  margin-top: 5px;
  margin-bottom: 0;
  font-size: 1.1rem;
  font-weight: bold;
  text-align: center;
}

/* Hover effects for the pet body condition options */
div[id="21"] .goal-option:hover,
div[id="22"] .goal-option:hover {
  background-color: #ffe580;
  transform: translateY(-2px);
}

div[id="21"] .goal-option.selected,
div[id="22"] .goal-option.selected {
  border-width: 3px;
  padding: 3px;
}

/* Media query for mobile devices */
@media (max-width: 767px) {
  div[id="21"] .goal-container,
  div[id="22"] .goal-container {
    grid-template-columns: 1fr;
    max-width: 300px;
  }
  
  div[id="21"] .goal-option,
  div[id="22"] .goal-option {
    margin-bottom: 10px;
  }
}

/* Media query for larger desktop screens */
@media (min-width: 1200px) {
  div[id="21"] .goal-container,
  div[id="22"] .goal-container {
    max-width: 700px;
  }
  
  div[id="21"] .goal-option,
  div[id="22"] .goal-option {
    max-width: 330px;
  }
}

/* Enlarged text styling for weight solution message */
.weight-solution-text {
  font-size: 1.3rem;
  line-height: 1.4;
  margin: 1.5rem 0;
  text-align: center;
}

.weight-solution-text strong {
  font-size: 1.8rem;
  display: block;
  margin-bottom: 1rem;
}

@media (max-width: 480px) {
  .weight-solution-text {
    font-size: 1.2rem;
  }
  
  .weight-solution-text strong {
    font-size: 1.5rem;
  }
}

/* Weight input specific styling (step 23) */
div[id="23"] input.goal-option {
  height: 50px;
  line-height: 50px;
  font-size: 1.25rem;
  text-align: center;
  width: 150px;
  margin: 0 auto;
}

/* Contact info specific styling (step 39) */
div[id="39"] input.goal-option {
  margin-bottom: 1.5rem;
  width: 100%;
  max-width: 400px;
}

div[id="39"] h1 {
  margin-top: 1.5rem;
}

/* Breed input specific styling (step 6) */
div[id="6"] input.goal-option {
  width: 100%;
  max-width: 400px;
  text-align: center;
}

/* Date input specific styling (steps 11 and 12) */
div[id="11"] input.goal-option,
div[id="12"] input.goal-option {
  text-align: center;
  width: 100%;
  max-width: 200px;
  margin: 0 auto;
}

/* Safari/iOS specific fixes */
@supports (-webkit-touch-callout: none) {
  input.goal-option {
    line-height: normal;
    padding-top: 14px;
    padding-bottom: 14px;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .progress-holder {
    height: 0.4rem;
  }
  
  .logo-holder {
    margin-top: 1rem;
    margin-bottom: 2rem;
  }
  
  .back-arrow {
    font-size: 2.5rem;
    z-index: 300;
    width: 4rem;
    height: 4rem;
    font-weight: bold;
  }
}

@media (max-width: 480px) {
  .progress-holder {
    height: 0.3rem;
  }
  
  .logo-holder {
    margin-top: 0.8rem;
    margin-bottom: 1.5rem;
  }
  
  .back-arrow {
    font-size: 2.2rem;
    z-index: 300;
    width: 3.5rem;
    height: 3.5rem;
    font-weight: bold;
  }
}

/* MOBILE FIXES STYLESHEET 
   Load this after the main stylesheet to override desktop styles */

/* Mobile-specific styles that take precedence */
@media only screen and (max-width: 480px) {
  /* Global mobile styles */
  body {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 1rem !important;
    overflow-x: hidden !important;
  }

  h1 {
    font-size: 1.8rem !important;
    text-align: center !important;
  }

  .question-holder {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 1rem !important;
  }

  .back-arrow {
    left: 0rem !important;
  }
  
  /* Input field fixes for mobile */
  input.goal-option {
    height: 50px !important;
    line-height: 50px !important;
    padding: 0 1rem !important;
    font-size: 16px !important; /* Prevents zoom on iOS */
    width: 100% !important;
  }

  textarea.goal-option {
    padding: 1rem !important;
    font-size: 16px !important; /* Prevents zoom on iOS */
    width: 100% !important;
  }
  
  /* Weight input specific styling (step 23) for mobile */
  div[id="23"] input.goal-option {
    width: 120px !important;
    text-align: center !important;
  }
  
  /* Contact form specific styling (step 39) for mobile */
  div[id="39"] input.goal-option {
    max-width: 100% !important;
    margin-bottom: 1rem !important;
  }
  
  /* SPECIES SELECTION - Screen 5 - VERTICAL STACKING */
  div[id="5"] {
    width: 100% !important;
    max-width: 100% !important;
  }

  div[id="5"] .goal-container {
    /* Force vertical layout */
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    max-width: 176px !important; /* Sized to fit the 172px button + margins */
    margin: 0 auto !important;
    padding: 0 !important;
    overflow: visible !important;
    overflow-x: visible !important;
  }

  div[id="5"] .goal-option {
    /* Make buttons match desktop but vertical orientation */
    flex: 0 0 auto !important;
    width: 172px !important;
    min-width: 172px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    padding-bottom: 0.6rem !important;
    min-height: 190px !important;
    margin: 0 auto 10px auto !important;
    border-radius: 0 !important;
    position: relative !important;
    z-index: 1 !important;
    border: 2px solid #000000 !important;
    box-sizing: border-box !important;
  }

  div[id="5"] .goal-option img {
    /* Match desktop image styling exactly */
    width: 168px !important;
    height: 168px !important;
    margin-bottom: 0.2rem !important;
    object-fit: contain !important;
  }

  div[id="5"] .goal-option p {
    /* Match desktop text styling exactly */
    margin-top: 0.1rem !important;
    font-weight: bold !important;
    font-size: 1.2rem !important;
    text-align: center !important;
  }

  /* CAT BODY CONDITION - Screen 21 - VERTICAL STACKING */
  div[id="21"] {
    width: 100% !important;
    max-width: 100% !important;
  }

  div[id="21"] .goal-container {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-gap: 15px !important;
    width: 100% !important;
    max-width: 300px !important;
    margin: 0 auto !important;
    padding: 0 !important;
  }

  div[id="21"] .goal-option {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    max-width: 300px !important;
    margin: 0 auto 10px auto !important;
    padding: 5px !important;
  }

  div[id="21"] .goal-option img {
    width: 100% !important;
    height: auto !important;
    margin: 0 0 5px 0 !important;
    padding: 0 !important;
  }

  div[id="21"] .goal-option p {
    text-align: center !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* DOG BODY CONDITION - Screen 22 - VERTICAL STACKING */
  div[id="22"] {
    width: 100% !important;
    max-width: 100% !important;
  }

  div[id="22"] .goal-container {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-gap: 15px !important;
    width: 100% !important;
    max-width: 300px !important;
    margin: 0 auto !important;
    padding: 0 !important;
  }

  div[id="22"] .goal-option {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    max-width: 300px !important;
    margin: 0 auto 10px auto !important;
    padding: 5px !important;
  }

  div[id="22"] .goal-option img {
    width: 100% !important;
    height: auto !important;
    margin: 0 0 5px 0 !important;
    padding: 0 !important;
  }

  div[id="22"] .goal-option p {
    text-align: center !important;
    margin: 0 !important;
    padding: 0 !important;
  }
}

/* Consent banner (shared markup with the marketing pages) */
.consent { position: fixed; right: 16px; bottom: 16px; z-index: 400; width: min(380px, calc(100% - 32px)); background: #fff; border: 2px solid #000; border-radius: 16px; padding: 20px; box-shadow: 0 8px 30px rgba(0, 0, 0, .18); font-size: 15px; text-align: left; }
.consent p { margin-bottom: 10px; }
.consent a { color: #08394a; }
.consent-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.consent .btn { background: #ffcb00; color: #000; border: 2px solid #000; border-radius: 10px; padding: 10px; font-size: 16px; font-weight: 700; cursor: pointer; }
.consent .btn-ghost { background: #fff; }
