/* Component Styles */

.components {
  .cta {
    .overline {
      color: #DEF3FF;
    }
  }
}

/* Card styles */
.blog-card {
  transition: transform 0.2s ease-in-out;
}

.blog-card:hover {
  transform: translateY(-5px);
}

.explore-card {
  border: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.2s ease-in-out;
}

.explore-card:hover {
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

/* Post content styles */
.post-body .content .trix-content {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #333;
}

.post-body .content .trix-content h1,
.post-body .content .trix-content h2,
.post-body .content .trix-content h3 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: #2c3e50;
}

.post-body .content .trix-content p {
  margin-bottom: 1.5rem;
}

.post-body .content .trix-content blockquote {
  background-color: #f8f9fa;
  border-left: 4px solid #007bff;
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  font-style: italic;
}

.post-body .content .trix-content ul,
.post-body .content .trix-content ol {
  margin-bottom: 1.5rem;
  padding-left: 2rem;
}

.post-body .content .trix-content li {
  margin-bottom: 0.5rem;
}

.post-body .content .trix-content pre {
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 0.375rem;
  padding: 1rem;
  margin: 1.5rem 0;
  overflow-x: auto;
}

.post-body .content .trix-content img {
  border-radius: 0.375rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin: 1.5rem 0;
}

/* Personality Test Answer View Styles - Now using Bootstrap classes */

/* Answer options now using Bootstrap flex classes */

.btn-choice {
  border: 2px solid #e9ecef;
  background-color: #ffffff;
  transition: all 0.2s ease-in-out;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-choice:hover {
  border-color: #0555C8;
  background-color: #f8f9ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(5, 85, 200, 0.15);
}

.btn-check:checked + .btn-choice {
  border-color: #0555C8;
  background-color: #0555C8;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(5, 85, 200, 0.25);
}

.btn-check:checked + .btn-choice .emoji {
  filter: brightness(1.2) contrast(1.1);
  text-shadow: 0 0 4px rgba(255, 255, 255, 0.3);
}

.emoji {
  font-size: 2rem;
  line-height: 1;
  transition: transform 0.2s ease-in-out;
}

.btn-choice:hover .emoji {
  transform: scale(1.1);
}

.option-text {
  font-size: 0.9rem;
  text-align: center;
  line-height: 1.3;
}

.navigation-buttons {
  border-color: #e9ecef !important;
}

@media (max-width: 768px) {
  .question-text {
    font-size: 1.1rem;
  }
  
  .btn-choice {
    min-height: 100px;
  }
  
  .emoji {
    font-size: 1.75rem;
  }
  
  .option-text {
    font-size: 0.85rem;
  }
}

/* Personality Test Summary View Styles */
.personality-result-image {
  max-width: 300px;
  max-height: 300px;
  object-fit: cover;
  border: 3px solid #0555C8;
  transition: transform 0.2s ease-in-out;
}

.personality-result-image:hover {
  transform: scale(1.02);
}

.personality-image-container {
  padding: 1rem;
  background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
  border-radius: 1rem;
  border: 1px solid #e9ecef;
}

.factor-avatar {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border: 2px solid #e9ecef;
  transition: all 0.2s ease-in-out;
}

.factor-avatar:hover {
  border-color: #0555C8;
  transform: scale(1.1);
}

.factor-image-wrapper {
  flex-shrink: 0;
}

.table-primary {
  background-color: rgba(5, 85, 200, 0.1) !important;
}

.table-primary .factor-avatar {
  border-color: #0555C8;
  box-shadow: 0 2px 8px rgba(5, 85, 200, 0.2);
}

/* Results Table Layout Optimization */
.results-table-container {
  background: #ffffff;
  border-radius: 0.75rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.results-table {
  margin-bottom: 0 !important;
  border-collapse: separate;
  border-spacing: 0;
}

.results-table th {
  border-bottom: 2px solid #e9ecef;
  padding: 1rem 0.75rem;
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  color: #6b7280;
}

.results-table td {
  padding: 1rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.character-column {
  width: 60%;
  text-align: left;
}

.score-column {
  width: 20%;
}

.percentage-column {
  width: 20%;
}

.character-cell {
  padding-left: 1rem !important;
}

.factor-image-wrapper {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.factor-avatar {
  width: 45px;
  height: 45px;
  object-fit: cover;
  border: 2px solid #e9ecef;
  transition: all 0.2s ease-in-out;
}

.factor-text-content {
  flex: 1;
  min-width: 0;
}

.factor-name {
  font-size: 0.95rem;
  line-height: 1.4;
  color: #374151;
}

.score-cell, .percentage-cell {
  padding: 1rem 0.5rem !important;
}

.score-value, .percentage-value {
  font-size: 1rem;
  line-height: 1;
}

.percentage-value {
  color: #0555C8 !important;
}

.total-icon {
  width: 45px;
  height: 45px;
  background: linear-gradient(135deg, #0555C8, #1BA2FF);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: white;
  box-shadow: 0 2px 8px rgba(5, 85, 200, 0.2);
}

.table-primary {
  background-color: rgba(5, 85, 200, 0.08) !important;
  border-left: 4px solid #0555C8;
}

.table-primary .factor-avatar {
  border-color: #0555C8;
  box-shadow: 0 2px 8px rgba(5, 85, 200, 0.2);
}

.table-primary .factor-name {
  color: #0555C8;
  font-weight: 700;
}

.table-primary .percentage-value {
  color: #0555C8 !important;
  font-weight: 700;
}

/* Hover effects */
.results-table tbody tr:hover {
  background-color: rgba(5, 85, 200, 0.04);
  transition: background-color 0.2s ease-in-out;
}

.results-table tbody tr:hover .factor-avatar {
  border-color: #0555C8;
  transform: scale(1.05);
}

@media (max-width: 768px) {
  .personality-result-image {
    max-width: 250px;
    max-height: 250px;
  }
  
  .factor-avatar {
    width: 40px;
    height: 40px;
  }
  
  .factor-image-wrapper {
    width: 45px;
    height: 45px;
  }
  
  .total-icon {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }
  
  .character-column {
    width: 65%;
  }
  
  .score-column, .percentage-column {
    width: 17.5%;
  }
  
  .results-table th,
  .results-table td {
    padding: 0.75rem 0.5rem;
  }
  
  .character-cell {
    padding-left: 0.75rem !important;
  }
  
  .factor-name {
    font-size: 0.9rem;
  }
  
  .score-value, .percentage-value {
    font-size: 0.9rem;
  }
}

/* Personality Test Introduction Page Styles - Compact */
.instructions-card {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.2s ease-in-out;
}

.instructions-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.instructions-content {
  font-size: 0.9rem;
  line-height: 1.4;
}

.scale-display {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 0.375rem;
  padding: 0.5rem;
  border: 1px solid #e9ecef;
}

.scale-display .badge {
  font-size: 0.7rem;
  padding: 0.3rem 0.5rem;
  border-radius: 0.25rem;
}

.instruction-points li {
  padding: 0.25rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.instruction-points li:last-child {
  border-bottom: none;
}

.sharing-card {
  border-left: 4px solid #0555C8 !important;
}

.sharing-card .badge {
  font-size: 0.7rem;
  padding: 0.3rem 0.5rem;
  margin: 0.1rem;
  white-space: nowrap;
}

.disclaimer-card {
  border-left: 4px solid #ffc107 !important;
}

.disclaimer-content {
  line-height: 1.4;
  color: #6c757d;
  font-size: 0.8rem;
}

.disclaimer-content strong {
  color: #495057;
}

/* Compact layout adjustments */
.page main {
  min-height: calc(100vh - 120px);
}

@media (max-width: 768px) {
  .scale-display .badge {
    font-size: 0.6rem;
    padding: 0.25rem 0.4rem;
  }
  
  .sharing-card .badge {
    font-size: 0.6rem;
    padding: 0.2rem 0.35rem;
  }
  
  .instructions-content {
    font-size: 0.85rem;
  }
  
  .disclaimer-content {
    font-size: 0.75rem;
  }
}

/* Personality Test Interlude Styles */
.progress-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin: 1.25rem 0 0.5rem;
  position: relative;
}

.progress-steps::before {
  content: "";
  position: absolute;
  left: 2.25rem;
  right: 2.25rem;
  top: calc(50% - 1px);
  height: 2px;
  background: #e5e7eb;
  z-index: 0;
}

.step-dot {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #e5e7eb;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 600;
  color: #6b7280;
  transition: all 0.3s ease-in-out;
}

.step-dot.active {
  background: #0555C8;
  border-color: #0555C8;
  color: #fff;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(5, 85, 200, 0.3);
}

.encouragement-text {
  color: #6c757d;
  font-style: italic;
}

.btn-cta {
  padding: 0.8rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 1.1rem;
  transition: all 0.2s ease-in-out;
}

.btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
  .progress-steps {
    gap: 1rem;
  }
  
  .progress-steps::before {
    left: 1.25rem;
    right: 1.25rem;
  }
  
  .step-dot {
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
  }
  
  .btn-cta {
    padding: 0.7rem 1.2rem;
    font-size: 1rem;
  }
}

/* Personality Test Loading Results Styles */
.loading-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
}

.loading-spinner {
  position: relative;
  width: 120px;
  height: 120px;
}

.spinner-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 4px solid transparent;
  border-top: 4px solid #0555C8;
  border-radius: 50%;
  animation: spin 2s linear infinite;
}

.spinner-ring:nth-child(2) {
  width: 80%;
  height: 80%;
  top: 10%;
  left: 10%;
  border-top-color: #28a745;
  animation-duration: 1.5s;
  animation-direction: reverse;
}

.spinner-ring:nth-child(3) {
  width: 60%;
  height: 60%;
  top: 20%;
  left: 20%;
  border-top-color: #ffc107;
  animation-duration: 1s;
}

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

.step-dot.loading {
  background: linear-gradient(45deg, #0555C8, #28a745, #ffc107, #dc3545);
  background-size: 400% 400%;
  animation: gradientShift 2s ease infinite;
  border-color: transparent;
}

.loading-dot {
  width: 12px;
  height: 12px;
  background: white;
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.7; }
}

.analysis-steps {
  max-width: 500px;
  margin: 0 auto;
}

.analysis-step {
  display: flex;
  align-items: center;
  padding: 1rem;
  margin-bottom: 0.5rem;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 0.75rem;
  border-left: 4px solid #e9ecef;
  opacity: 0.3;
  transform: translateX(-20px);
  transition: all 0.5s ease-in-out;
}

.analysis-step.active {
  opacity: 1;
  transform: translateX(0);
  border-left-color: #0555C8;
  background: rgba(5, 85, 200, 0.05);
  box-shadow: 0 2px 8px rgba(5, 85, 200, 0.1);
}

.step-icon {
  font-size: 1.5rem;
  margin-right: 1rem;
  min-width: 2rem;
  text-align: center;
}

.step-text {
  font-weight: 500;
  color: #495057;
}

.fun-facts {
  max-width: 600px;
  margin: 0 auto;
}

.fact-card {
  display: flex;
  align-items: center;
  padding: 1.5rem;
  background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
  border-radius: 1rem;
  border: 1px solid #e9ecef;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.fact-icon {
  font-size: 2rem;
  margin-right: 1rem;
  min-width: 3rem;
  text-align: center;
}

.fact-text {
  color: #6c757d;
  line-height: 1.6;
}

.fact-text strong {
  color: #0555C8;
}

@media (max-width: 768px) {
  .loading-spinner {
    width: 80px;
    height: 80px;
  }
  
  .analysis-step {
    padding: 0.75rem;
  }
  
  .step-icon {
    font-size: 1.25rem;
    margin-right: 0.75rem;
  }
  
  .fact-card {
    padding: 1rem;
  }
  
  .fact-icon {
    font-size: 1.5rem;
    margin-right: 0.75rem;
  }
}

/* Personality Test Results Page Styles */
.results-hero {
  background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
  border-radius: 1rem;
  padding: 3rem 2rem;
  margin-bottom: 2rem;
}

.celebration-animation {
  display: flex;
  justify-content: center;
  align-items: center;
}

.celebration-icon {
  font-size: 4rem;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-20px);
  }
  60% {
    transform: translateY(-10px);
  }
}

.dominant-personality-card {
  background: #ffffff;
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid #e9ecef;
}

.personality-name {
  background: linear-gradient(45deg, #0555C8, #28a745);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.personality-stats {
  display: flex;
  gap: 1.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  background: rgba(5, 85, 200, 0.05);
  border-radius: 0.5rem;
  min-width: 120px;
}

.stat-label {
  font-size: 0.875rem;
  color: #6c757d;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0555C8;
}

.insights-section {
  margin: 3rem 0;
}

.insight-card {
  background: #ffffff;
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid #e9ecef;
  height: 100%;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.insight-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.insight-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

.insight-title {
  color: #0555C8;
  margin-bottom: 1rem;
  font-weight: 600;
}

.insight-content ul {
  list-style: none;
  padding-left: 0;
}

.insight-content li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #f1f5f9;
  position: relative;
  padding-left: 1.5rem;
}

.insight-content li:before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #28a745;
  font-weight: bold;
}

.insight-content li:last-child {
  border-bottom: none;
}

.results-visualization {
  background: #ffffff;
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid #e9ecef;
}

.sharing-card {
  background: #ffffff;
  color: #333333;
  border-radius: 1rem;
  padding: 3rem 2rem;
  margin: 2rem 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid #e9ecef;
}

.sharing-buttons {
  margin-bottom: 1rem;
}

.share-text {
  background: #f8f9fa;
  border-radius: 0.5rem;
  padding: 1rem;
  border: 1px solid #e9ecef;
}

.viral-section {
  margin: 3rem 0;
}

.viral-card {
  background: #ffffff;
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid #e9ecef;
  height: 100%;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-align: center;
}

.viral-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.viral-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

.viral-title {
  color: #0555C8;
  margin-bottom: 1rem;
  font-weight: 600;
}

.viral-description {
  color: #6c757d;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.viral-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1rem;
}

.viral-stats .stat {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: #0555C8;
}

.stat-label {
  font-size: 0.875rem;
  color: #6c757d;
}

.viral-actions {
  margin-top: 1rem;
}

.share-preview {
  background: #f8f9fa;
  border-radius: 0.75rem;
  padding: 1rem;
  border: 1px solid #e9ecef;
}

.preview-card {
  background: #ffffff;
  border-radius: 0.5rem;
  padding: 1rem;
  text-align: left;
}

.preview-header {
  color: #0555C8;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.preview-content {
  color: #495057;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  line-height: 1.4;
}

.preview-tags {
  color: #6c757d;
  font-size: 0.8rem;
}

.viral-cta {
  background: #f8f9fa;
  border-radius: 0.5rem;
  padding: 1rem;
  border: 1px solid #e9ecef;
}

.final-actions {
  background: #f8f9fa;
  border-radius: 1rem;
  padding: 2rem;
  border: 1px solid #e9ecef;
}

.action-buttons {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

@media (max-width: 768px) {
  .results-hero {
    padding: 2rem 1rem;
  }
  
  .celebration-icon {
    font-size: 3rem;
  }
  
  .dominant-personality-card {
    padding: 1.5rem;
  }
  
  .personality-stats {
    flex-direction: column;
    gap: 1rem;
  }
  
  .insight-card {
    padding: 1.5rem;
  }
  
  .insight-icon {
    font-size: 2.5rem;
  }
  
  .sharing-card {
    padding: 2rem 1rem;
  }
  
  .sharing-card .badge {
    font-size: 0.65rem;
    padding: 0.25rem 0.4rem;
    margin: 0.05rem;
  }
  
  .sharing-buttons {
    flex-direction: column;
    gap: 1rem;
  }
  
  .sharing-buttons .btn {
    width: 100%;
    justify-content: center;
  }
  
  .viral-stats {
    flex-direction: column;
    gap: 1rem;
  }
  
  .viral-card {
    padding: 1.5rem;
  }
  
  .viral-icon {
    font-size: 2.5rem;
  }
  
  .action-buttons {
    flex-direction: column;
    width: 100%;
  }
  
  .action-buttons .btn {
    width: 100%;
  }
}

/* Enhanced Loading Page Animations */
.loading-spinner-container {
  position: relative;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}


.analysis-card {
  opacity: 0.6;
  transform: translateY(10px);
  transition: all 0.4s ease;
}

.analysis-card.active {
  opacity: 1;
  transform: translateY(0);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.analysis-icon {
  font-size: 3rem;
  transition: transform 0.3s ease;
}

.analysis-card.active .analysis-icon {
  transform: scale(1.1);
}

.analysis-text {
  font-weight: 600;
  color: #495057;
  margin-bottom: 1rem;
}

.analysis-progress {
  width: 100%;
  height: 4px;
  background-color: #e9ecef;
  border-radius: 2px;
  overflow: hidden;
}

.analysis-progress .progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #0555C8, #28a745);
  border-radius: 2px;
  width: 0%;
  transition: width 1.2s ease-in-out;
}
/* Kiosk skeleton loaders moved to Bootstrap's native .placeholder /
   .placeholder-glow component (see customer/registrations/_skeleton_card).
   The kiosk no longer loads this file, so the old .kiosk-skeleton rules
   were dead and have been removed. */

/* ============================================================
   B2B Megamenu — public marketing navbar (Industries / Services)
   Driven by megamenu_controller.js. Desktop: floating panel on
   hover/focus. Mobile (<lg): renders inline inside the collapsed
   navbar and toggles on tap.
   ============================================================ */
.megamenu-navbar {
  --mm-radius: 16px;
  /* Track the theme: --mm-accent follows Bootstrap's $primary (the brand
     blue) so the menu stays in sync with the rest of the site; #0d6efd is
     a secondary blue used only for gradient depth. */
  --mm-accent: var(--bs-primary);
  --mm-accent-2: #0d6efd;
}

.megamenu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
}
.megamenu-caret {
  font-size: 0.7em;
  transition: transform 0.2s ease;
}
.megamenu-item.is-open > .megamenu-trigger .megamenu-caret {
  transform: rotate(180deg);
}

/* Full-width band: the panel spans the whole navbar (which is full
   width), dropping edge-to-edge below it. Content re-centers in the
   inner .container. */
.megamenu-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1050;
  background: #fff;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 28px 50px -28px rgba(15, 23, 42, 0.45);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}
.megamenu-item.is-open > .megamenu-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.megamenu-container {
  padding-top: 1.75rem;
  padding-bottom: 1.5rem;
}

.megamenu-inner {
  display: flex;
  align-items: stretch;
  gap: 2.5rem;
}
.megamenu-links {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  /* Pull the row out by the card's own padding so the first column's
     icon/text aligns with the container edge (the navbar logo) instead
     of sitting one card-padding inset. */
  margin-left: -1rem;
}
.megamenu-link {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1rem;
  border-radius: 14px;
  text-decoration: none;
  color: #0f172a;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.megamenu-link:hover { background: #f1f5f9; transform: translateY(-2px); }
.megamenu-ico {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: 1.3rem;
  color: var(--mm-accent);
  background: linear-gradient(135deg, rgba(var(--bs-primary-rgb), 0.10), rgba(var(--bs-primary-rgb), 0.16));
  transition: color 0.15s ease, background 0.15s ease;
}
.megamenu-link:hover .megamenu-ico {
  color: #fff;
  background: linear-gradient(135deg, var(--mm-accent), var(--mm-accent-2));
}
.megamenu-link-title { font-weight: 600; font-size: 0.98rem; line-height: 1.25; }
.megamenu-link-desc {
  font-size: 0.82rem;
  color: #64748b;
  line-height: 1.4;
}

.megamenu-feature {
  flex: 0 0 320px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.45rem;
  padding: 1.75rem;
  border-radius: var(--mm-radius);
  text-decoration: none;
  background: linear-gradient(150deg, var(--mm-accent) 0%, var(--mm-accent-2) 100%);
}
.megamenu-feature,
.megamenu-feature * { color: #fff; }
.megamenu-feature-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  opacity: 0.85;
}
.megamenu-feature-title { font-weight: 700; font-size: 1.15rem; line-height: 1.3; }
.megamenu-feature-desc { font-size: 0.85rem; opacity: 0.9; line-height: 1.45; }
.megamenu-feature-cta {
  margin-top: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  font-size: 0.9rem;
}
.megamenu-feature-cta i { transition: transform 0.15s ease; }
.megamenu-feature:hover .megamenu-feature-cta i { transform: translateX(4px); }

.megamenu-footer {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #eef2f7;
}
.megamenu-viewall {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  font-weight: 600;
  /* readable accent text (emphasis shade), matching the .text-primary
     treatment; the icon tiles keep the brand blue via --mm-accent. */
  color: var(--bs-primary-text-emphasis);
  text-decoration: none;
}
.megamenu-viewall i { transition: transform 0.15s ease; }
.megamenu-viewall:hover i { transform: translateX(4px); }

/* Mobile: inside the collapsed navbar the panel stacks inline. */
@media (max-width: 991.98px) {
  .megamenu-panel {
    position: static;
    box-shadow: none;
    border-top: 0;
    /* neutralize the desktop hidden/animation state */
    display: none;
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  .megamenu-item.is-open > .megamenu-panel { display: block; }
  .megamenu-container { padding: 0.25rem 0 0.5rem; }
  .megamenu-inner { flex-direction: column; gap: 1rem; }
  .megamenu-links { grid-template-columns: 1fr; margin-left: 0; }
  .megamenu-link { flex-direction: row; align-items: center; padding: 0.7rem; }
  .megamenu-feature { flex-basis: auto; }
}
