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

body {
  font-family: "Poppins", sans-serif;
  background: #fff;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2d3748;
}

@property --ring-progress {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

.app-shell {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 1440px;
  padding: 0 25px;
  margin-top: 110px;
}

.app-shell .logo {
  position: absolute;
  top: 10px;
}

.sidebar {
  width: 460px;
  height: max-content;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  position: sticky;
  top: 30px;
}

.step-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  position: relative;
}

.step {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  position: relative;
  z-index: 2;
  margin-bottom: 32px;
}

.step::after {
  content: "";
  position: absolute;
  left: 20px;
  top: calc(40px + var(--connector-gap, 10px));
  width: 2px;
  height: var(--connector-h, 0px);
  /* background: var(--connector-color, #ac503f); */
  z-index: 0;
  border-radius: 1px;
}

.step::after {
  background: #00000057 !important;
}

.step.active#s1::after {
  background: #c78d6b !important;
}

.step.active#s2::after {
  background: #68b1af !important;
}

.step.active#s3::after {
  background: #fc8a8a !important;
}

.step.active#s4::after {
  background: #f4d27c !important;
}

.step .step-num {
  border-color: #f7f3ef !important;
  color: rgba(0, 0, 0, 40%) !important;
}

.step.active#s1 .step-num {
  border-color: #c78d6b !important;
  color: #c78d6b !important;
}

.step.active#s2 .step-num {
  border-color: #68b1af !important;
  color: #68b1af !important;
}

.step.active#s3 .step-num {
  border-color: #fc8a8a !important;
  color: #fc8a8a !important;
}

.step.active#s4 .step-num {
  border-color: #f4d27c !important;
  color: #f4d27c !important;
}

.step.active {
  opacity: 1;
}

.step-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.step-num {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid #d1d5db;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  color: #9ca3af;
  transition: all 0.3s ease;
  background-color: #ffffff;
  flex-shrink: 0;
  position: relative;
}

/* Circular progress (arc) around the number */
.step-num::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: conic-gradient(
    from -90deg,
    var(--ring-color, #f7f3ef) calc(var(--ring-progress, 0) * 1turn),
    transparent 0
  );
  -webkit-mask: radial-gradient(
    farthest-side,
    transparent calc(100% - 2px),
    #000 calc(100% - 2px)
  );
  mask: radial-gradient(
    farthest-side,
    transparent calc(100% - 2px),
    #000 calc(100% - 2px)
  );
  pointer-events: none;
  transition: --ring-progress 260ms ease;
}

#s1.active .step-num::before {
  background: conic-gradient(
    from -90deg,
    var(--ring-color, #c78d6b) calc(var(--ring-progress, 0) * 1turn),
    transparent 0
  );
}

#s2.active .step-num::before {
  background: conic-gradient(
    from -90deg,
    var(--ring-color, #68b1af) calc(var(--ring-progress, 0) * 1turn),
    transparent 0
  );
}

#s3.active .step-num::before {
  background: conic-gradient(
    from -90deg,
    var(--ring-color, #fc8a8a) calc(var(--ring-progress, 0) * 1turn),
    transparent 0
  );
}

#s4.active .step-num::before {
  background: conic-gradient(
    from -90deg,
    var(--ring-color, #f4d27c) calc(var(--ring-progress, 0) * 1turn),
    transparent 0
  );
}

.step.active .step-num {
  border-color: #ac503f;
  color: #ac503f;
}

/* .step.completed .step-num {
  border-color: #ac503f;
  color: #ac503f;
} */

.step-txt {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 0;
}

.step-details {
  margin-top: 20px;
  display: none;
  padding-left: 0;
}

.step.active .step-details {
  display: block;
}

.step-details h2 {
  font-family: "big-caslon-fb", serif;
  font-weight: 300;
  font-size: 30px;
  line-height: 36px;
  color: #456dbd;
  margin-top: 0;
}

.step-details p {
  font-family: "Poppins", sans-serif;
  font-style: normal;
  font-weight: 400;
  font-size: 16px;
  line-height: 26px;
  color: #456dbd;
  opacity: 0.7;
  margin-top: 10px;
}

.step-txt span {
  font-style: normal;
  font-weight: 500;
  font-size: 11px;
  line-height: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(0, 0, 0, 0.4);
  transition: color 0.3s ease;
}

.step-txt p {
  font-style: normal;
  font-weight: 500;
  font-size: 15px;
  line-height: 22px;
  color: rgba(0, 0, 0, 0.7);
  transition: color 0.3s ease;
}

/** COLORS **/
#s1.active .step-txt span {
  color: #c78d6b;
  opacity: 0.5;
}

#s1.active .step-txt p {
  color: #c78d6b;
}

#s2.active .step-txt span {
  color: #68b1af;
  opacity: 0.5;
}

#s2.active .step-txt p {
  color: #68b1af;
}

#s3.active .step-txt span {
  color: #fc8a8a;
  opacity: 0.5;
}

#s3.active .step-txt p {
  color: #fc8a8a;
}

#s4.active .step-txt span {
  color: #f4d27c;
  opacity: 0.5;
}

#s4.active .step-txt p {
  color: #f4d27c;
}

/* MAIN AREA */
.main {
  width: 912px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.header {
  position: fixed;
  top: 30px;
  display: flex;
  align-self: flex-end;
  gap: 10px;
  align-items: center;
  background: transparent;
  border-bottom: none;
  z-index: 5;
}

.btn-prev {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #374151;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  font-family: "Poppins", sans-serif;
  transition: all 0.2s ease;
}

main:has([id*="block-step1"]) .btn-prev {
  background-color: #ecd4c6;
}

main:has([id*="block-step2"]) .btn-prev {
  background-color: #a8d2d1;
}

main:has([id*="block-step3"]) .btn-prev {
  background-color: #fc8a8a;
}

main:has([id*="block-step4"]) .btn-prev {
  background-color: #f4d27c;
}

/* main:has([id*="block-step3"]) .card {
	text-transform: lowercase;
}

main:has([id*="block-step3"]) .card *::first-letter {
	text-transform: uppercase !important;
} */

.btn-suivant,
.btn-prev {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 15px;
  align-items: center;
  padding: 12px 20px;
  background: #dae2f2;
  border-radius: 54px;
  font-family: "Inter", sans-serif;
  font-style: normal;
  font-weight: 400;
  font-size: 16px;
  line-height: 25px;
  text-align: right;
  color: #2b2e34;
  outline: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  will-change: transform;
  transform-origin: center;
}

.btn-suivant:hover:not(:disabled),
.btn-prev:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-suivant:active:not(:disabled),
.btn-prev:active:not(:disabled) {
  transform: translateY(0);
}

.btn-prev:disabled,
.btn-suivant:disabled {
  cursor: not-allowed;
}

.btn-prev {
  background-color: #f7f4f3;
  color: #2b2e34;
}

.content {
  width: 912px;
  padding: 0;
  scroll-behavior: smooth;
  margin-top: 40px;
  position: relative;
  z-index: 2;
}

.content::before {
  content: "";
  position: absolute;
  top: -100px;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(172, 80, 63, 0.15);
  opacity: 0.5;
  filter: blur(97px);
  z-index: -1;
  pointer-events: none;
}

.content:has([id^="block-step1"])::before {
  background: rgba(199, 141, 107, 0.15);
}

.content:has([id^="block-step2"])::before {
  background: rgba(168, 210, 209, 0.35);
}

.content:has([id^="block-step3"])::before {
  background: rgba(252, 138, 138, 0.15);
}

.content:has([id^="block-step4"])::before {
  background: rgba(246, 185, 32, 0.15);
}

.question-frame-container {
  min-height: 500px;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  margin-top: 40px;
}

/* Question Title - Serif Font */
.q-title {
  font-size: 25px;
  font-weight: 400;
  color: #1f2937;
  margin-bottom: 16px;
  line-height: 1.3;
}

/* Question Description */
.q-description {
  font-size: 15px;
  color: #6b7280;
  line-height: 1.6;
  margin-bottom: 40px;
  max-width: 800px;
}

/* Question Text */
.q-text {
  font-style: normal;
  font-weight: 300;
  font-size: 22px;
  line-height: 26px;
  color: #2b2e34;
  margin-bottom: 27px;
}

/* Cards Grid - 3 columns for answer cards */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(256px, 1fr));
  gap: 20px;
  margin-top: 24px;
  justify-items: center;
}

/* Explicit column layouts per question */
.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(395px, 1fr));
}

.grid-cols-3 {
  grid-template-columns: repeat(3, minmax(256px, 1fr));
}

.grid-cols-4 {
  grid-template-columns: repeat(4, minmax(187px, 1fr));
}

/* Special: 5 answers -> 3 on first row, 2 on second row (centered) */
.grid-married-regime {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.grid-married-regime .card {
  grid-column: span 2;
}

.grid-married-regime .card:nth-child(4),
.grid-married-regime .card:nth-child(5) {
  grid-column: span 3;
}

/* Per-node overrides */
#block-step1_residence .grid {
  grid-template-columns: repeat(4, 187px);
  justify-content: center;
}

/* Answer Cards */
.card {
  width: 100%;
  height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: "Poppins", sans-serif;
  font-style: normal;
  font-weight: 300;
  font-size: 18px;
  line-height: 25px;
  text-align: center;
  color: #000000;
  background: rgba(69, 109, 189, 0.1);
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0 20px;
  position: relative;
  will-change: transform, opacity;
  transform-origin: center;
  border: 1px solid transparent;
}

.card:after {
  content: "";
  width: 26px;
  height: 26px;
  background-image: url("data:image/svg+xml,%3Csvg width='22' height='22' viewBox='0 0 22 22' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='1' y='1' width='20' height='20' rx='10' fill='white'/%3E%3Crect x='1' y='1' width='20' height='20' rx='10' stroke='%2300000062' stroke-width='2'/%3E%3Cpath d='M15.7998 8L9.7998 14L6.7998 11' stroke='%2300000062' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A");
  background-repeat: no-repeat;
  background-size: cover;
  position: absolute;
  top: -10px;
  right: -10px;
  opacity: 0;
  transition: 0.5s;
}

/* .card:hover {
  border-color: #cbd5e1;
  background: rgba(69, 109, 189, 0.2);
  border: 1px solid #00000062;
  color: #000000;
} */

.card.selected,
.card:hover {
  border: 1px solid #00000062;
  color: #000000;
}

[id^="block-step1"] .card.selected,
[id^="block-step1"] .card:hover {
  border: 1px solid rgba(199, 141, 107, 1);
  color: #000000;
}
[id^="block-step2"] .card.selected,
[id^="block-step2"] .card:hover {
  border: 1px solid rgba(168, 210, 209, 1);
  color: #000000;
}
[id^="block-step3"] .card.selected,
[id^="block-step3"] .card:hover {
  border: 1px solid rgba(252, 138, 138, 1);
  color: #000000;
}

[id^="block-step4"] .card.selected,
[id^="block-step4"] .card:hover {
  border: 1px solid rgba(244, 210, 124, 1);
  color: #000000;
}

[id^="block-step1"] .card:after {
  background-image: url('data:image/svg+xml,%3Csvg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg"%3E%3Crect x="1" y="1" width="20" height="20" rx="10" fill="white"/%3E%3Crect x="1" y="1" width="20" height="20" rx="10" stroke="%2300000062" stroke-width="2"/%3E%3Cpath d="M15.7998 8L9.7998 14L6.7998 11" stroke="%23C78D6B" stroke-linecap="round" stroke-linejoin="round"/%3E%3C/svg%3E%0A');
}

[id^="block-step2"] .card:after {
  background-image: url('data:image/svg+xml,%3Csvg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg"%3E%3Crect x="1" y="1" width="20" height="20" rx="10" fill="white"/%3E%3Crect x="1" y="1" width="20" height="20" rx="10" stroke="%2300000062" stroke-width="2"/%3E%3Cpath d="M15.7998 8L9.7998 14L6.7998 11" stroke="%23A8D2D1" stroke-linecap="round" stroke-linejoin="round"/%3E%3C/svg%3E%0A');
}

[id^="block-step3"] .card:after {
  background-image: url('data:image/svg+xml,%3Csvg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg"%3E%3Crect x="1" y="1" width="20" height="20" rx="10" fill="white"/%3E%3Crect x="1" y="1" width="20" height="20" rx="10" stroke="%2300000062" stroke-width="2"/%3E%3Cpath d="M15.7998 8L9.7998 14L6.7998 11" stroke="%23FC8A8A" stroke-linecap="round" stroke-linejoin="round"/%3E%3C/svg%3E%0A');
}

[id^="block-step4"] .card:after {
  background-image: url('data:image/svg+xml,%3Csvg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg"%3E%3Crect x="1" y="1" width="20" height="20" rx="10" fill="white"/%3E%3Crect x="1" y="1" width="20" height="20" rx="10" stroke="%2300000062" stroke-width="2"/%3E%3Cpath d="M15.7998 8L9.7998 14L6.7998 11" stroke="%23F4D27C" stroke-linecap="round" stroke-linejoin="round"/%3E%3C/svg%3E%0A');
}

.card.selected::after {
  opacity: 1;
}

/* Block Styles */
.block-summary {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 8px 24px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  animation: fadeIn 0.4s ease;
}

.summary-q {
  font-size: 15px;
  font-weight: 500;
  color: #1f2937;
  padding-right: 20px;
}

.summary-a {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  padding: 10px 20px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 5px;
  font-style: normal;
  font-weight: 500;
  font-size: 16px;
  line-height: 22px;
  color: #3b7af8;
}

.question-group-wrapper {
  min-height: 70vh;
  background-color: #fff;
  border-radius: 20px;
  padding: 52px;
  position: relative;
  transition: 0.5s;
  margin-bottom: 40px;
  will-change: transform, opacity;
}

.block-active {
  position: relative;
  transition: 0.5s;
}

[id^="block-step1"] .card {
  background-color: rgba(199, 141, 107, 8%);
}

[id^="block-step2"] .card {
  background-color: rgba(168, 210, 209, 16%);
}

[id^="block-step3"] .card {
  background-color: rgba(252, 138, 138, 16%);
}

[id^="block-step4"] .card {
  background-color: rgba(244, 210, 124, 16%);
}

#block-step3_conception_mode .card {
  height: 206px;
  padding: 0 100px;
}

.block-active:not(:last-child) {
  margin-bottom: 40px;
}

/* Question Header Styles */
.question-header {
  margin-bottom: 24px;
}

.question-header-title {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 500;
  font-size: 18px;
  line-height: 30px;
  color: #456dbd;
  margin-bottom: 10px;
}

.question-header-description {
  font-style: normal;
  font-weight: 400;
  font-size: 16px;
  line-height: 26px;
  color: #2b2e34;
  opacity: 0.7;
}

/* Summaries Container */
.summaries-container {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* First Summary Wrapper */
/* .first-summary-wrapper {
  margin-bottom: 20px;
} */

/* Summaries Wrapper (inside question-group-wrapper) */
.summaries-wrapper {
  margin-bottom: 30px;
}

.block-future {
  margin-bottom: 30px;
  margin-top: 20px;
  opacity: 0.4;
  pointer-events: none;
  filter: grayscale(1);
  transition: opacity 0.3s;
}

/* --- REPORT --- */
.report-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.r-card {
  padding: 25px;
  border-radius: 16px;
  color: white;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.r-card::after {
  content: "";
  position: absolute;
  bottom: -30px;
  left: 0;
  width: 100%;
  height: 100px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transform: scaleX(1.5);
}

.bg-low {
  background: #be6e58;
}

.bg-mod {
  background: #f97316;
}

.bg-high {
  background: #ef4444;
}

.r-tag {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.8;
  margin-bottom: 10px;
}

.r-val {
  font-family: "Playfair Display", serif;
  font-size: 28px;
  line-height: 1.1;
}

.r-btn {
  background: rgba(255, 255, 255, 0.2);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12px;
  width: fit-content;
  border: none;
  color: white;
  cursor: pointer;
}

/* Animations */
@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Responsive */
@media (max-width: 1000px) {
  .first-summary-wrapper,
  .summaries-wrapper {
    display: none !important;
  }
  .header {
    position: relative;
    display: flex;
    align-self: flex-start;
  }

  .card {
    min-height: 75px;
    height: 120px;
  }

  .step-details {
    margin-top: 10px;
  }

  .app-shell {
    width: 100%;
    height: initial;
    flex-direction: column;
    padding: 0 15px;
    border-radius: 0;
    overflow: hidden;
  }

  .sidebar {
    width: 100%;
    height: auto;
    padding: 20px;
    flex-direction: row;
    border-bottom: 1px solid #e5e7eb;
    border-right: none;
    position: initial;
    overflow: inherit;
    padding: 0;
  }

  .step-list {
    width: max-content;
    flex-direction: row;
    gap: 30px;
    padding: 0 10px;
    overflow-x: scroll;
  }

  .q-text {
    font-size: 16px;
    line-height: 23px;
    margin-bottom: 0;
  }

  .block-active:not(:last-child) {
    margin-bottom: 20px;
  }

  .question-frame-container,
  .question-group-wrapper {
    min-height: auto;
  }

  body {
    align-items: flex-start;
  }

  .bilan-block .bilan-item h3 {
    font-size: 28px;
  }

  .step-list::before {
    width: 100%;
    height: 2px;
    top: 20px;
    left: 0;
    bottom: auto;
  }

  .step-list::after {
    width: 0;
    height: 2px;
    top: 20px;
    left: 0;
    animation: fillProgressHorizontal 1.2s ease-out 0.3s forwards;
  }

  .step {
    width: 100%;
    padding-top: 5px;
  }

  .question-frame-container {
    margin-top: 15px;
  }

  .main,
  .content {
    width: 100%;
  }

  /* .step-details {
    display: none !important;
  } */

  .step-txt {
    width: max-content;
  }

  @keyframes fillProgressHorizontal {
    from {
      width: 0;
    }
    to {
      width: 80px;
    }
  }

  .question-group-wrapper {
    padding: 30px 20px;
  }

  .card {
    font-size: 15px;
    line-height: 22px;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  #block-step1_residence .grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-cols-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-cols-3 > :last-child {
    grid-column: 1 / -1;
  }

  .grid-cols-4,
  .grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-7 {
    grid-template-columns: repeat(2, 1fr);
  }

  .report-grid {
    grid-template-columns: 1fr;
  }

  .content {
    padding: 0;
  }

  .step {
    display: none;
  }

  .step.active {
    display: flex;
  }
}
