/* Risk Profile Calculator – card-based multi-step form */

/* Ensure box-sizing for calculator layout */
.section-risk,
.section-risk * {
  box-sizing: border-box;
}

.section-risk {
  background: linear-gradient(
    135deg,
    #f8f6f2 0%,
    #e8dfdc 40%,
    #ede4d6 70%,
    #ffffff 100%
  );
  padding-top: 60px;
  padding-bottom: 120px;
}

/* Avoid double top spacing: section already has padding */
.section-risk .section-heading{
  padding-top: 0;
}
.risk-calc-main {
  padding: 24px 0 48px;
}

.risk-calc-container {
  width: 100%;
  max-width: 100%;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
  align-items: start;
}

/* Prevent grid children from overflowing */
.risk-calc-progress,
.risk-calc-content {
  min-width: 0;
}

/* Progress (left) */
.risk-calc-progress {
  position: sticky;
  top: 24px;
}

.progress-inner {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius, 18px);
  padding: 20px 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
}

.progress-title {
  margin: 0 0 16px;
  font-size: 17px;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.progress-steps {
  list-style: none;
  margin: 0;
  padding: 0;
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 16px;
  color: var(--c-text-2, #7a7a7a);
  transition: color 0.2s ease;
}

.progress-step:last-child {
  border-bottom: 0;
}

.progress-step-n {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.5);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.progress-step.is-active .progress-step-n {
  background: rgba(201, 162, 39, 0.2);
  color: #9a7b20;
  border: 2px solid #c9a227;
}

/* Completed steps: green circle + checkmark */
.progress-step.is-done .progress-step-n {
  background: #2e7d32;
  color: transparent;
  border: 2px solid #2e7d32;
  font-size: 0;
  line-height: 0;
  position: relative;
}

.progress-step.is-done .progress-step-n::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.progress-step.is-done {
  color: rgba(46, 125, 50, 0.85);
}

.progress-step.is-active {
  color: rgba(0, 0, 0, 0.85);
  font-weight: 600;
}

.progress-step-label {
  line-height: 1.2;
}

/* Content card */
.risk-calc-content {
  position: relative;
  min-height: 320px;
}

.step-panel.hidden,
.step-panel[hidden] {
  display: none !important;
}

.risk-calc-card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius, 18px);
  padding: 36px 32px;  /* more breathing space */
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.08);
  animation: riskFadeIn 0.35s ease;
  width: 100%;
}

@keyframes riskFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.step-heading {
  margin: 0 0 8px;
  font-size: 30px;   /* was 24px */
  font-weight: 700;
  color: rgba(0, 0, 0, 0.85);
}

.step-desc {
  margin: 0 0 24px;
  font-size: 17px;
  color: var(--c-text, #6b6b6b);
  line-height: 1.6;
}

/* Form fields */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.72);
}

.form-label .required {
  color: #c0392b;
}

.form-input {
  width: 100%;
  max-width: 360px;
  padding: 12px 14px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  color: rgba(0, 0, 0, 0.85);
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: #c9a227;
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.2);
}

.form-input.is-error {
  border-color: #c0392b;
}

.form-error {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: #c0392b;
}

.form-error-block {
  margin-bottom: 12px;
}

/* Option cards (single & multi) */
.option-cards {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}

.option-cards-single {
  grid-template-columns: 1fr;
}

.option-cards-multi {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.option-card {
  position: relative;
  cursor: pointer;
  margin: 0;
}

.option-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option-card-inner {
  display: block;
  padding: 16px 18px;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.option-card:hover .option-card-inner {
  border-color: rgba(201, 162, 39, 0.4);
  background: rgba(255, 255, 197, 0.15);
}

.option-card input:checked + .option-card-inner,
.option-card input:focus-visible + .option-card-inner {
  border-color: #c9a227;
  background: rgba(255, 255, 197, 0.35);
  box-shadow: 0 4px 20px rgba(201, 162, 39, 0.25);
}

.option-card-multi input:checked + .option-card-inner::after {
  content: "✓";
  position: absolute;
  top: 10px;
  right: 12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #c9a227;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.option-card-inner {
  position: relative;
}

.option-card-title {
  display: block;
  font-weight: 700;
  font-size: 18px;
  color: rgba(0, 0, 0, 0.85);
}

.option-card-desc {
  display: block;
  margin-top: 4px;
  font-size: 15px;
  color: var(--c-text, #6b6b6b);
  line-height: 1.35;
}

/* Step actions */
.step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.btn-risk {
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn-risk:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-risk:not(:disabled):active {
  transform: translateY(1px);
}

.btn-risk.btn-primary {
  background: rgba(0, 0, 0, 0.88);
  color: #fff;
  border: 2px solid transparent;
}

.btn-risk.btn-primary:not(:disabled):hover {
  background: rgba(0, 0, 0, 0.95);
}

.btn-risk.btn-ghost {
  background: rgba(255, 255, 255, 0.9);
  color: rgba(0, 0, 0, 0.7);
  border: 2px solid rgba(0, 0, 0, 0.12);
}

.btn-risk.btn-ghost:hover {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.2);
}

/* Summary */
.summary-block {
  margin-bottom: 20px;
  background: #ffffff;
    border-radius: 12px;
    padding: 20px 24px;
    border: 1px solid #eee;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    margin-top: 20px;
}

.summary-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.summary-row {
  
  grid-template-columns: 140px 1fr;
  
  display: flex;
 
  padding: 10px 0;
  border-bottom: 1px solid #f1f1f1;
  justify-content: flex-start; /* change from space-between */
  gap: 40px;
}

.summary-row:last-child {
  border-bottom: 0;
}

.summary-row dt {
  margin: 0;
  font-weight: 600;
  font-size: 14px;
  color: #444;
  min-width: 180px;
    
}

.summary-row dd {
  margin: 0;
  font-size: 15px;
  margin: 0;
  color: #222;
  text-align: left;
}
#step-summary {
    max-width: 700px;
    margin: 0 auto;
    text-align: left;
	animation: fadeIn 0.4s ease-in-out;
}
#step-summary .step-heading {
    text-align: center;
    margin-bottom: 10px;
}

#step-summary .step-desc {
    text-align: center;
    margin-bottom: 20px;
    color: #666;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}




/* Overlay / spinner */
.risk-calc-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.9);
  border-radius: var(--radius, 18px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 15px;
  color: var(--c-text, #6b6b6b);
  z-index: 10;
}

.risk-calc-overlay[hidden] {
  display: none !important;
}

.risk-calc-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-top-color: #c9a227;
  border-radius: 50%;
  animation: riskSpin 0.8s linear infinite;
}

@keyframes riskSpin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive – tablet and below (switch to stacked layout) */
@media (max-width: 900px) {
  .risk-calc-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .risk-calc-progress {
    position: static;
    width: 100%;
  }

  .progress-inner {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 14px 12px;
    -webkit-overflow-scrolling: touch;
  }

  .progress-title {
    margin: 0;
    flex-shrink: 0;
  }

  .progress-steps {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    flex-shrink: 0;
    padding-bottom: 4px;
  }

  .progress-step {
    flex-direction: column;
    padding: 8px 4px;
    border: none;
    min-width: 64px;
    text-align: center;
    flex-shrink: 0;
  }

  .progress-step-label {
    font-size: 11px;
  }
}

@media (max-width: 768px) {
  .section-risk {
    padding-top: 60px;
    padding-bottom: 60px;
  }

  .section-risk .form-title {
   
    margin-bottom: 32px;
  }

  .section-risk .container {
    width: 100%;
    max-width: 100%;
    padding-left: 24px;
    padding-right: 24px;
  }

  .risk-calc-container {
    width: 100%;
  }

  .risk-calc-card {
    padding: 24px 18px;
  }

  .risk-calc-content {
    min-height: auto;
  }

  .step-heading {
    font-size: 22px;
  }

  .step-desc {
    font-size: 15px;
  }

  .option-cards-multi {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
  }

  .option-card-inner {
    padding: 14px 12px;
  }

  .option-card-title {
    font-size: 16px;
  }

  .summary-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .step-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-risk {
    width: 100%;
  }
}

/* Small phones */
@media (max-width: 480px) {
  .section-risk {
    padding-top: 60px;
    padding-bottom: 48px;
  }

  .section-risk .form-title {
    
    margin-bottom: 24px;
  }

  .section-risk .container {
    padding-left: 20px;
    padding-right: 20px;
  }

  .risk-calc-card {
    padding: 20px 14px;
  }

  .step-heading {
    font-size: 20px;
  }

  .form-input {
    max-width: 100%;
  }

  .option-cards-multi {
    grid-template-columns: 1fr;
  }

  .option-cards-single {
    grid-template-columns: 1fr;
  }

  .progress-step {
    min-width: 56px;
  }

  .progress-step-label {
    font-size: 10px;
  }
}