/**********************************************
 * DESIGN SYSTEM — COLORS, FONTS, SPACING
 **********************************************/
:root {
  --brand-blue: #2563eb;
  --brand-blue-light: #dbeafe;
  --brand-blue-dark: #1e3a8a;

  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-600: #4b5563;
  --gray-700: #374151;

  --green: #10b981;
  --transition: 0.25s ease;

  --radius: 14px;
  --shadow: 0 4px 18px rgba(17, 24, 39, 0.06);
}

.spacer { 
  height: 30px; 
  width: 100%; 
}

/**********************************************
 * GLOBAL — MOBILE FIRST
 **********************************************/
body {
  background: var(--gray-50);
}

.assessment-page {
  display: block;
  width: 100%;
  padding: 14px;
  margin: 0 auto;
  box-sizing: border-box;
}

.card {
  background: #fff;
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

/**********************************************
 * SIDEBAR — MOBILE FIRST
 **********************************************/
.assessment-sidebar {
  width: 100%;
  background: #fff;
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-bottom: 20px;
}

/* BRAND */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sidebar-brand h3 {
  font-size: 20px;
  margin: 0;
  font-weight: 600;
  color: var(--gray-700);
  text-align: left;
}

/* PROGRESS BLOCK */
.sidebar-progress-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-progress-label {
  font-size: 14px;
  color: var(--gray-600);
  font-weight: 500;
}

.sidebar-progress-outer {
  width: 100%;
  height: 12px;
  background: var(--gray-200);
  border-radius: 8px;
  overflow: hidden;
}

.sidebar-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--brand-blue);
  transition: width 0.3s ease;
}

.sidebar-step-counter {
  font-size: 14px;
  color: var(--gray-700);
  font-weight: 500;
}

/* STEPS */
.sidebar-steps {
  max-height: 260px;
  overflow-y: auto;
  padding-right: 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background: var(--gray-100);
  border-radius: 12px;
  border: 1px solid var(--gray-200);
  cursor: pointer;
  transition: var(--transition);
}

.step-item:hover {
  background: var(--brand-blue-light);
  border-color: var(--brand-blue);
}

.step-marker {
  min-width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--gray-300);
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 600;
  color: var(--gray-700);
  transition: var(--transition);
}

.step-label {
  flex: 1;
  font-size: 15px;
  line-height: 1.4;
  color: var(--gray-700);
}

.step-item.active {
  background: var(--brand-blue-light);
  border-color: var(--brand-blue);
}

.step-item.active .step-marker {
  background: var(--brand-blue);
  color: #fff;
}

.step-item.active .step-label {
  font-weight: 600;
  color: var(--brand-blue-dark);
}

/* FOOTER */
.sidebar-footer {
  border-top: 1px solid var(--gray-200);
  padding-top: 12px;
  color: var(--gray-600);
}

/**********************************************
 * MAIN CONTENT
 **********************************************/
.assessment-main {
  width: 100%;
  max-width: 100%;
}

/**********************************************
 * FORM GRID
 **********************************************/
.form-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group label {
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 6px;
  display: block;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
}

/**********************************************
 * QUESTION AREA
 **********************************************/
.question-title-wrapper {
  max-height: 150px;
  overflow-y: auto;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 260px;
  overflow-y: auto;
  position: relative; /* for scroll hint */
  padding-bottom: 8px;
}

/* OPTION DESIGN */
.option-card {
  padding: 14px;
  border: 1px solid var(--gray-300);
  border-radius: 12px;
  background: #fff;
  display: flex;
  gap: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.option-card:hover {
  border-color: var(--brand-blue);
  background: var(--gray-100);
}

.option-card.selected {
  background: var(--brand-blue);
  border-color: var(--brand-blue-dark);
  color: #fff;
}

/**********************************************
 * BOTTOM NAVIGATION
 **********************************************/
.nav-buttons {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.right-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/**********************************************
 * BUTTONS
 **********************************************/
.btn-primary,
.btn-secondary,
.btn-submit {
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  width: 100%;
}

.btn-primary {
  background: var(--brand-blue);
  color: #fff;
}

.btn-secondary {
  background: var(--gray-200);
  color: var(--gray-700);
}

.btn-submit {
  background: var(--green);
  color: #fff;
}

/**********************************************
 * DESKTOP LAYOUT
 **********************************************/
@media (min-width: 960px) {
  .assessment-page {
    display: flex;
    gap: 32px;
    max-width: 1300px;
    padding: 24px;
  }

  .assessment-sidebar {
    position: sticky;
    top: 120px;
    width: 300px;
    max-height: calc(100vh - 150px);
    overflow: hidden;
  }

  .sidebar-steps {
    flex: 1;
    overflow-y: auto;
  }

  .assessment-main {
    width: calc(100% - 340px);
    max-width: 850px;
  }

  .card {
    padding: 28px;
    min-height: 480px;
  }

  .options {
    max-height: none;
    overflow-y: visible;
    padding-bottom: 20px;
  }

  .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
  }

  .nav-buttons {
    flex-direction: row;
    justify-content: space-between;
  }

  .right-controls {
    flex-direction: row;
  }

  .btn-primary,
  .btn-secondary,
  .btn-submit {
    width: auto;
  }
}

/**********************************************
 * MOBILE OPTIMIZATION
 **********************************************/
@media (max-width: 959px) {
  .sidebar-steps {
    display: none !important;
  }

  .assessment-sidebar {
    gap: 16px;
  }

  /* Scroll hint gradient & down arrow */
  .options::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,1));
    animation: scrollHintPulse 1.8s ease-in-out infinite alternate;
  }

  .options::before {
    content: '▼';
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 18px;
    color: rgba(55,65,81,0.7);
    pointer-events: none;
    animation: arrowBounce 1.5s ease-in-out infinite;
  }

  @keyframes scrollHintPulse {
    0% { background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0.6)); }
    50% { background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0.8)); }
    100% { background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,1)); }
  }

  @keyframes arrowBounce {
    0% { transform: translate(-50%,0); opacity: 0.5; }
    50% { transform: translate(-50%,4px); opacity: 1; }
    100% { transform: translate(-50%,0); opacity: 0.5; }
  }
}
