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

html {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-base);
  background-color: #fff;
  height: 100%;
  overflow: hidden;
  position: fixed;
  width: 100%;
}

.container {
  max-width: 750px;
  margin: 0 auto;
  background-color: #fff;
  height: 100vh;
  height: 100dvh; /* Use dynamic viewport height for mobile */
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

@media (max-width: 768px) {
  .container {
    width: 100%;
    margin: 0 10px;
    width: calc(100% - 20px);
  }
}

.header {
  height: 80px;
  width: 100%;
  background-color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo {
  width: 250px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo img {
  width: 250px;
  height: auto;
  max-height: 50px;
  object-fit: contain;
}

@media (max-width: 1024px) and (min-width: 769px) {
  .logo img {
    width: 200px;
  }
}

@media (max-width: 768px) {
  .header {
    height: 60px;
  }

  .logo img {
    width: 180px;
  }
}

/* Postal validation loader */
#postal-validation-loader {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
}

#postal-validation-loader::after {
  content: "";
  display: block;
  width: 40px;
  height: 40px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid var(--color-cta-primary);
  border-radius: 50%;
  animation: postal-loader-spin 1s linear infinite;
}

@keyframes postal-loader-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.worktype-section {
  height: 20px;
  width: 100%;
  margin-top: 80px;
  background-color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 999;
  flex-shrink: 0;
}

.worktype-container {
  width: 90%;
  max-width: 750px;
  margin: 0 auto;
}

.worktype-text {
  font-size: 16px;
  line-height: 1.1em;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-align: left;
}

@media (max-width: 768px) {
  .worktype-section {
    margin-top: 70px;
  }
}

.progress-section {
  height: 40px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 100px;
  left: 0;
  z-index: 999;
  background-color: #fff;
  flex-shrink: 0;
}

.progress-container {
  width: 90%;
  max-width: 800px;
}

.progress-bar {
  height: 15px;
  background-color: var(--color-border-light);
  border-radius: 7.5px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background-color: var(--color-form-primary);
  width: 0%;
  transition: width 0.3s ease;
}

@media (max-width: 768px) {
  .progress-section {
    height: 38px;
    top: 90px;
  }
}

.main-content {
  padding: 40px 20px 60px;
  margin-top: 140px;
  height: calc(100vh - 140px);
  height: calc(100dvh - 140px); /* Use dynamic viewport height */
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

/* Hide scrollbar but keep functionality */
.main-content::-webkit-scrollbar {
  width: 0px;
  background: transparent;
}

.main-content {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

@media (max-width: 768px) {
  .main-content {
    padding: 15px 15px 60px;
    margin-top: 128px;
    height: calc(100vh - 128px);
    height: calc(100dvh - 128px); /* Use dynamic viewport height */
  }
}

.question-section {
  font-size: 25px;
  line-height: 1.1em;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 40px;
  text-align: center;
}

@media (max-width: 768px) {
  .question-section {
    margin-bottom: 20px;
  }
}

.answer-section {
  margin-bottom: 30px;
}

@media (max-width: 768px) {
  .answer-section {
    margin-bottom: 15px;
  }
}

.step-intro {
  font-size: 18px;
  line-height: 20px;
  text-align: left;
  color: var(--color-text-primary);
  max-width: 450px;
  margin: 0 auto;
  margin-bottom: 30px;
}

.step-intro span.green {
  color: var(--color-success);
  font-weight: bold;
}

@media (max-width: 768px) {
  .step-intro {
    max-width: 100%;
  }
}

.contact-footer {
  font-size: 14px;
  line-height: 18px;
  text-align: left;
  color: var(--color-text-secondary);
  margin: 35px auto 0px auto;
}

.navigation {
  width: 100%;
  max-width: 450px;
  margin: 0 auto;
  background-color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 0;
  transition: all 0.3s ease;
}

@media (max-width: 768px) {
  .navigation {
    padding: 0;
    max-width: 100%;
  }
}

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

.nav-button {
  width: 100%;
  padding: 22px 0px;
  border: none;
  border-radius: 50px;
  background-color: var(--color-form-primary);
  color: #fff;
  cursor: pointer;
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
}

.nav-button:hover {
  background-color: var(--color-form-primary-hover);
}

/* Arrow icon for navigation button */
.nav-button::after {
  content: "";
  width: 35px;
  height: 35px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M24.6,16l-5.5-6.6l-2.4,2l3.3,3.9H7v3.2h13l-3.3,3.9l2.4,2l5.5-6.6C25.1,17.4,25.1,16.6,24.6,16z' fill='white'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  flex-shrink: 0;
}

/* Checkmark icon for final submission button */
.nav-button[data-final="true"]::after {
  width: 40px;
  height: 40px;
}

.nav-button[data-final="true"] {
  font-size: 26px;
}

/* Previous text styling */
.prev-text {
  color: var(--color-text-tertiary);
  font-size: 13px;
  cursor: pointer;
  transition: color 0.3s ease;
  user-select: none;
  margin-top: 20px;
}

.prev-text:hover {
  color: var(--color-text-secondary);
}

.prev-text.hidden {
  display: none !important;
}

.navigation-last-step {
  color: var(--color-text-secondary);
  font-size: 15px;
}

.step {
  display: none;
  opacity: 0;
}

.step.active {
  display: block;
  opacity: 1;
}

.step.slide-out-down {
  animation: slideOutDown 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.step.slide-in-from-top {
  animation: slideInFromTop 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes slideOutDown {
  0% {
    opacity: 1;
    transform: translateY(0);
  }

  100% {
    opacity: 0;
    transform: translateY(100px);
  }
}

@keyframes slideInFromTop {
  0% {
    opacity: 0;
    transform: translateY(-100px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Radio button styles */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 450px;
  margin: 0 auto;
}

.radio-option {
  position: relative;
  padding: 17px 20px;
  border: 2px solid var(--color-border-light);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 18px;
  background-color: #fff;
  display: flex;
  align-items: center;
  gap: 5px;
  user-select: none;
}

.radio-option:hover {
  border-color: var(--color-form-primary);
  background-color: var(--color-form-primary);
  color: var(--color-form-radio-txt-hover);
}

.radio-option.selected {
  border-color: var(--color-form-primary);
  background-color: var(--color-form-primary);
  color: var(--color-form-radio-txt-hover);
}

.radio-option.blink {
  animation: quickBlink 0.3s ease-in-out;
}

@keyframes quickBlink {
  0% {
    background-color: var(--color-form-primary);
    transform: scale(1);
  }

  50% {
    background-color: var(--color-form-primary-hover);
    transform: scale(1.02);
  }

  100% {
    background-color: var(--color-form-primary);
    transform: scale(1);
  }
}

.genre-group .radio-option.blink {
  animation: quickBlinkNoScale 0.3s ease-in-out;
}

@keyframes quickBlinkNoScale {
  0% {
    background-color: var(--color-form-primary);
  }

  50% {
    background-color: var(--color-form-primary-hover);
  }

  100% {
    background-color: var(--color-form-primary);
  }
}

.radio-option input[type="radio"] {
  width: 20px;
  height: 20px;
  margin-right: 5px;
  accent-color: var(--color-form-primary);
  cursor: pointer;
  flex-shrink: 0;
  outline: none;
}

/* Floating Label Input Styles */
.input-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.floating-input {
  position: relative;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .floating-input {
    max-width: 100%;
  }
}

.floating-input input {
  width: 100%;
  padding: 17px 20px;
  font-size: 18px;
  color: var(--color-text-primary);
  border: 2px solid var(--color-border-light);
  background-color: #fff;
  outline: none;
  transition: border-color 0.3s ease;
}

.floating-input label {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: var(--color-text-tertiary);
  background-color: #fff;
  padding: 0 5px;
  pointer-events: none;
  transition: all 0.3s ease;
}

.floating-input input:focus + label,
.floating-input input.has-content + label {
  top: 0;
  left: 15px;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
}

.floating-textarea {
  max-width: 460px;
}

@media (max-width: 768px) {
  .floating-textarea {
    max-width: 100%;
  }
}

.floating-textarea textarea {
  font-family: var(--font-base);
  width: 100%;
  height: 85px;
  padding: 15px;
  font-size: 16px;
  color: var(--color-text-primary);
  border: 2px solid var(--color-border-light);
  background-color: #fff;
  outline: none;
  transition: border-color 0.3s ease;
  resize: none;
  text-align: left;
}

.floating-textarea textarea::placeholder {
  color: var(--color-text-tertiary);
}

.character-counter {
  margin: 0px 0px 5px 5px;
  font-size: 14px;
  color: var(--color-text-tertiary);
  transition: opacity 0.3s ease;
}

.character-counter.hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-message {
  text-align: center;
  padding: 50px 20px;
  color: var(--color-text-secondary);
  font-size: 18px;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

/* Civilité radio buttons - horizontal layout */
.genre-group {
  flex-direction: row;
  justify-content: center;
  gap: 15px;
  margin-bottom: 10px;
}

.genre-group .radio-option {
  flex: 1;
  max-width: 142.5px;
  justify-content: center;
}

.genre-group .radio-option input[type="radio"] {
  margin-top: -2px;
  position: relative;
}

/* Disable selected styling for genre group only */
.genre-group .radio-option.selected {
  border-color: var(--color-border-light);
  background-color: #fff;
  color: inherit;
}

@media (max-width: 768px) {
  .genre-group {
    gap: 10px;
  }

  .genre-group .radio-option {
    font-size: 17px;
    padding: 17px 10px;
    max-width: none;
  }
}

/* CP FOOTER TO UPDATE */

/* Footer grid stays 3 / 2 / 1 columns */
.cp-footer {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
  margin-top: 50px;
  padding-bottom: 30px;
}

.item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 16px;
  text-align: center;
  background: #fff;
}

.item img {
  width: 55px;
  height: 55px;
  margin: 0 0 10px 0;
  flex-shrink: 0;
  border-radius: 5px;
}

.item .text h3 {
  margin: 10px 0 8px 0;
  font-size: 1.2em;
}

.item .text p {
  margin: 0;
  font-size: 0.95em;
  color: var(--color-text-primary);
}

/* Tablet: 2 columns */
@media (max-width: 768px) {
  .cp-footer {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile: 1 column */
@media (max-width: 480px) {
  .cp-footer {
    grid-template-columns: 1fr;
  }
}

.validation-icon {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  z-index: 10;
}

.error-message {
  font-size: 15px;
  color: var(--color-error);
  text-align: center;
  animation: fadeIn 0.1s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.validation-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.valid input,
.valid textarea,
.floating-textarea.valid textarea,
.floating-textarea.valid textarea:focus {
  border: 3px solid var(--color-success) !important;
  background-color: var(--color-success-bg) !important;
}

.invalid input,
.invalid textarea {
  border: 2px solid var(--color-error) !important;
}

/* ==========================================================================
   PULSE ANIMATION
   ========================================================================== */

.pulse {
  animation: cta 4s infinite;
}

@-webkit-keyframes cta {
  0% {
    -webkit-box-shadow: 0 0 0 0 var(--color-form-primary-pulse);
  }
  70% {
    -webkit-box-shadow: 0 0 0 10px rgba(0, 0, 0, 0);
  }
  100% {
    -webkit-box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
  }
}

@keyframes cta {
  0% {
    -moz-box-shadow: 0 0 0 0 var(--color-form-primary-pulse);
    box-shadow: 0 0 0 0 var(--color-form-primary-pulse);
  }
  70% {
    -moz-box-shadow: 0 0 0 10px rgba(0, 0, 0, 0);
    box-shadow: 0 0 0 10px rgba(0, 0, 0, 0);
  }
  100% {
    -moz-box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
    box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
  }
}

/* Apply pulse to final button */
.nav-button[data-final="true"] {
  animation: cta 4s infinite;
}

.loading-skeleton {
  padding: 20px;
  animation: pulse 1.5s ease-in-out infinite;
  max-width: 800px; /* Match your main content container */
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.skeleton-question {
  height: 30px;
  background: #e0e0e0;
  border-radius: 2px;
  width: 70%;
  max-width: 400px; /* Match your question text width */
  margin: 0 auto 30px;
}

.skeleton-options {
  max-width: 450px; /* Match your radio-group width */
  margin: 0 auto; /* Center the options like radio-group */
}

.skeleton-option {
  height: 60px;
  background: #e0e0e0;
  border-radius: 5px;
  margin-bottom: 15px;
  width: 100%; /* Full width within the options container */
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}
