/* ============================================
   BCMG Portal — Component Styles
   Chat UI, Service Cards, Quote, Admin
   ============================================ */

/* ---- Navigation ---- */
.portal-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  background: rgba(8, 12, 24, 0.8);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 100;
}

.portal-nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--text-primary);
}

.portal-nav-logo svg {
  width: 28px;
  height: 28px;
  color: var(--accent);
}

.portal-nav-logo span {
  opacity: 0.5;
  font-weight: 400;
  margin-left: var(--space-1);
}

.portal-nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

/* ---- Service Option Cards (Landing Page) ---- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
  max-width: 780px;
  margin: 0 auto;
}

.service-option {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: var(--space-8);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}

.service-option::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    ellipse 200px 150px at 20% 20%,
    var(--accent-glow),
    transparent 70%
  );
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out);
  pointer-events: none;
}

.service-option:hover {
  border-color: var(--border-accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
}

.service-option:hover::before {
  opacity: 1;
}

.service-option-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--accent-glow);
  color: var(--accent);
  margin-bottom: var(--space-5);
  transition: background var(--duration-normal) var(--ease-out);
}

.service-option:hover .service-option-icon {
  background: var(--accent-glow-strong);
}

.service-option-icon svg {
  width: 24px;
  height: 24px;
}

.service-option-title {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-2);
  color: var(--text-primary);
}

.service-option-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: var(--space-6);
  flex: 1;
}

.service-option-arrow {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--accent);
  opacity: 0;
  transform: translateX(-8px);
  transition: all var(--duration-normal) var(--ease-out);
}

.service-option:hover .service-option-arrow {
  opacity: 1;
  transform: translateX(0);
}

.service-option-arrow svg {
  width: 16px;
  height: 16px;
  transition: transform var(--duration-fast) var(--ease-out);
}

.service-option:hover .service-option-arrow svg {
  transform: translateX(3px);
}

@media (max-width: 640px) {
  .services-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .service-option {
    padding: var(--space-6);
  }
}

/* ---- Progress Bar ---- */
.progress-bar-wrapper {
  width: 100%;
  padding: var(--space-4) 0;
}

.progress-bar-track {
  width: 100%;
  height: 3px;
  background: var(--border-default);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-full);
  transition: width var(--duration-slow) var(--ease-out);
  box-shadow: 0 0 8px var(--accent-glow);
}

.progress-bar-steps {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.progress-bar-step.active {
  color: var(--accent);
  font-weight: 600;
}

.progress-bar-step.completed {
  color: var(--text-secondary);
}

/* ---- Chat Container ---- */
.chat-wrapper {
  max-width: var(--container-narrow);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--nav-height) - 80px);
  padding: var(--space-8) var(--space-4);
}

.chat-messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding-bottom: var(--space-8);
}

/* ---- Chat Bubbles ---- */
.chat-bubble {
  max-width: 85%;
  animation: fadeInUp var(--duration-normal) var(--ease-out) both;
}

.chat-bubble-bot {
  align-self: flex-start;
}

.chat-bubble-user {
  align-self: flex-end;
}

.chat-bubble-content {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  line-height: 1.6;
}

.chat-bubble-bot .chat-bubble-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-bottom-left-radius: var(--radius-sm);
  color: var(--text-primary);
}

.chat-bubble-user .chat-bubble-content {
  background: var(--accent-dim);
  color: #fff;
  border-bottom-right-radius: var(--radius-sm);
}

.chat-bubble-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-1);
  padding-left: var(--space-1);
}

.chat-bubble-bot .chat-bubble-label {
  text-align: left;
}

.chat-bubble-user .chat-bubble-label {
  text-align: right;
}

/* ---- Chat Options (pill buttons / choice cards) ---- */
.chat-options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  animation: fadeInUp var(--duration-normal) var(--ease-out) both;
  animation-delay: 200ms;
}

.chat-option-btn {
  padding: var(--space-3) var(--space-5);
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  white-space: nowrap;
}

.chat-option-btn:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
  color: var(--accent);
}

.chat-option-btn.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text-inverse);
}

/* Option cards (for larger choices like pricing tiers) */
.chat-option-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-3);
  width: 100%;
  animation: fadeInUp var(--duration-normal) var(--ease-out) both;
  animation-delay: 200ms;
}

.chat-option-card {
  padding: var(--space-5);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  text-align: left;
}

.chat-option-card:hover {
  border-color: var(--accent);
  background: var(--bg-surface-hover);
}

.chat-option-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-glow);
}

.chat-option-card-title {
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.chat-option-card-price {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--accent);
}

.chat-option-card-desc {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-2);
}

/* Chat input area */
.chat-input-area {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  margin-top: auto;
}

.chat-input-area .input {
  border: none;
  background: transparent;
  padding: var(--space-2);
}

.chat-input-area .input:focus {
  box-shadow: none;
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: var(--space-4) var(--space-5);
  align-self: flex-start;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typingBounce 1.2s ease-in-out infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* ---- Quote Card ---- */
.quote-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  overflow: hidden;
  max-width: 560px;
  margin: 0 auto;
  animation: scaleIn var(--duration-slow) var(--ease-out) both;
}

.quote-card-header {
  padding: var(--space-6) var(--space-6) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}

.quote-card-title {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-1);
}

.quote-card-subtitle {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.quote-card-items {
  padding: var(--space-4) var(--space-6);
}

.quote-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.quote-item:last-child {
  border-bottom: none;
}

.quote-item-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.quote-item-price {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.quote-card-totals {
  padding: var(--space-4) var(--space-6);
  background: var(--bg-base);
  border-top: 1px solid var(--border-default);
}

.quote-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) 0;
}

.quote-total-row.primary {
  font-size: var(--text-lg);
  font-weight: 700;
}

.quote-total-row.primary .quote-total-amount {
  color: var(--accent);
  font-size: var(--text-xl);
}

.quote-total-label {
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.quote-total-amount {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.quote-card-footer {
  padding: var(--space-4) var(--space-6) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.quote-expires {
  text-align: center;
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ---- Admin Layout ---- */
.admin-layout {
  display: flex;
  min-height: 100vh;
  padding-top: var(--nav-height);
}

.admin-sidebar {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-base);
  border-right: 1px solid var(--border-subtle);
  padding: var(--space-6) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  z-index: 90;
  overflow-y: auto;
}

.admin-sidebar-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: var(--space-4) var(--space-3) var(--space-2);
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-out);
}

.admin-nav-item:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.admin-nav-item.active {
  background: var(--accent-glow);
  color: var(--accent);
}

.admin-nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.admin-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: var(--space-8);
  min-width: 0;
}

/* Stats cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.stat-card {
  padding: var(--space-5) var(--space-6);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
}

.stat-card-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.stat-card-value {
  font-size: var(--text-3xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat-card-value.accent {
  color: var(--accent);
}

.stat-card-change {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

/* Admin Paste Email */
.paste-area {
  width: 100%;
  min-height: 200px;
  padding: var(--space-5);
  background: var(--bg-base);
  border: 2px dashed var(--border-default);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-family: var(--font-body);
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color var(--duration-fast) var(--ease-out);
}

.paste-area:focus {
  border-color: var(--accent);
  border-style: solid;
}

.paste-result {
  margin-top: var(--space-6);
  padding: var(--space-6);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
}

.paste-result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.paste-result-row:last-child {
  border-bottom: none;
}

.price-adjuster {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.price-adjuster input[type="range"] {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border-default);
  border-radius: var(--radius-full);
  outline: none;
}

.price-adjuster input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 8px var(--accent-glow);
}

.price-display {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--accent);
  min-width: 100px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---- Success Page ---- */
.success-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--nav-height));
  padding: var(--space-8);
  text-align: center;
}

.success-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--accent-glow-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-6);
  animation: scaleIn 0.6s var(--ease-spring) both;
}

.success-icon svg {
  width: 40px;
  height: 40px;
  color: var(--accent);
}

.success-title {
  font-size: var(--text-3xl);
  font-weight: 800;
  margin-bottom: var(--space-3);
  animation: fadeInUp var(--duration-slow) var(--ease-out) 0.2s both;
}

.success-message {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 480px;
  margin-bottom: var(--space-8);
  animation: fadeInUp var(--duration-slow) var(--ease-out) 0.35s both;
}

.success-details {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  width: 100%;
  max-width: 400px;
  animation: fadeInUp var(--duration-slow) var(--ease-out) 0.5s both;
}

/* Confetti particles */
.confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -20px;
  width: 10px;
  height: 10px;
  animation: confettiFall linear forwards;
}

/* ---- Footer ---- */
.portal-footer {
  padding: var(--space-8) var(--space-6);
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

.portal-footer-text {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* ---- Responsive Admin ---- */
@media (max-width: 1024px) {
  .admin-sidebar {
    transform: translateX(-100%);
    transition: transform var(--duration-normal) var(--ease-out);
  }

  .admin-sidebar.open {
    transform: translateX(0);
  }

  .admin-content {
    margin-left: 0;
    padding: var(--space-6) var(--space-4);
  }
}

/* ---- Loading Skeleton ---- */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-surface) 25%,
    var(--bg-surface-hover) 50%,
    var(--bg-surface) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

/* ============================================
   Visual Configurator — Product Builder UI
   Two-column layout with live quote sidebar
   ============================================ */

/* ---- Layout ---- */
.configurator {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: var(--space-8);
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-6) var(--space-16);
  align-items: start;
}

.configurator-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-10);
}

/* ---- Page Header ---- */
.configurator-header {
  margin-bottom: var(--space-2);
}

.configurator-header h1 {
  font-size: var(--text-3xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-2);
  animation: fadeInUp var(--duration-slow) var(--ease-out) both;
}

.configurator-header p {
  font-size: var(--text-base);
  color: var(--text-secondary);
  animation: fadeInUp var(--duration-slow) var(--ease-out) 80ms both;
}

/* ---- Section Groups ---- */
.config-section {
  animation: fadeInUp var(--duration-slow) var(--ease-out) both;
}

.config-section-label {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.config-section-number {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--accent-glow);
  color: var(--accent);
  font-size: var(--text-xs);
  font-weight: 700;
  flex-shrink: 0;
}

.config-section-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
}

.config-section-subtitle {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

/* ---- Option Cards (single select) ---- */
.config-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-3);
}

.config-option {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: var(--space-5);
  background: var(--bg-surface);
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  user-select: none;
}

.config-option:hover {
  border-color: var(--border-hover);
  background: var(--bg-surface-hover);
  transform: translateY(-1px);
}

.config-option.selected {
  border-color: var(--accent);
  background: var(--bg-surface);
  box-shadow: 0 0 0 1px var(--accent), 0 0 20px var(--accent-glow);
}

.config-option.selected::after {
  content: '';
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23080c18' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  animation: scaleIn var(--duration-fast) var(--ease-spring) both;
}

.config-option-name {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.config-option-price {
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--accent);
  margin-bottom: var(--space-2);
  font-variant-numeric: tabular-nums;
}

.config-option-desc {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.5;
}

/* ---- Multi-select Tiles ---- */
.config-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-3);
}

.config-tile {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-4);
  background: var(--bg-surface);
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  user-select: none;
}

.config-tile:hover {
  border-color: var(--border-hover);
  background: var(--bg-surface-hover);
}

.config-tile.selected {
  border-color: var(--accent);
  background: rgba(74, 222, 128, 0.06);
}

.config-tile-check {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 2px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--duration-fast) var(--ease-out);
}

.config-tile.selected .config-tile-check {
  background: var(--accent);
  border-color: var(--accent);
}

.config-tile-check svg {
  width: 12px;
  height: 12px;
  color: var(--text-inverse);
  opacity: 0;
  transform: scale(0.5);
  transition: all var(--duration-fast) var(--ease-spring);
}

.config-tile.selected .config-tile-check svg {
  opacity: 1;
  transform: scale(1);
}

.config-tile-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
}

/* ---- Text Inputs in Configurator ---- */
.config-input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.config-input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.config-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-base);
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-base);
  transition: border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
  outline: none;
}

.config-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.config-input::placeholder {
  color: var(--text-muted);
}

.config-textarea {
  resize: vertical;
  min-height: 100px;
  font-family: var(--font-body);
  line-height: 1.6;
}

.config-input-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
}

/* ---- Pill Options (for simple choices like urgency) ---- */
.config-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.config-pill {
  padding: var(--space-2) var(--space-5);
  background: transparent;
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  user-select: none;
}

.config-pill:hover {
  border-color: var(--border-hover);
  background: var(--bg-surface);
}

.config-pill.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text-inverse);
}

/* ---- Sticky Quote Summary Sidebar ---- */
.quote-summary {
  position: sticky;
  top: calc(var(--nav-height) + var(--space-8));
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  overflow: hidden;
  animation: fadeInUp var(--duration-slow) var(--ease-out) 200ms both;
}

.quote-summary-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quote-summary-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
}

.quote-summary-badge {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-glow);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
}

.quote-summary-items {
  padding: var(--space-4) var(--space-6);
  min-height: 60px;
}

.quote-summary-empty {
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-align: center;
  padding: var(--space-4) 0;
}

.quote-summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) 0;
  animation: fadeInUp var(--duration-fast) var(--ease-out) both;
}

.quote-summary-item + .quote-summary-item {
  border-top: 1px solid var(--border-subtle);
}

.quote-summary-item-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.quote-summary-item-price {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.quote-summary-item-freq {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 400;
  margin-left: var(--space-1);
}

.quote-summary-totals {
  padding: var(--space-4) var(--space-6);
  background: var(--bg-base);
  border-top: 1px solid var(--border-default);
}

.quote-summary-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-1) 0;
  font-size: var(--text-sm);
}

.quote-summary-total-row.primary {
  font-size: var(--text-lg);
  font-weight: 700;
  padding: var(--space-2) 0;
}

.quote-summary-total-row.primary .quote-summary-total-amount {
  color: var(--accent);
  font-size: var(--text-xl);
}

.quote-summary-total-label {
  color: var(--text-secondary);
}

.quote-summary-total-amount {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.quote-summary-footer {
  padding: var(--space-4) var(--space-6) var(--space-6);
}

.quote-summary-cta {
  width: 100%;
  padding: var(--space-4) var(--space-6);
  background: var(--accent);
  color: var(--text-inverse);
  font-size: var(--text-base);
  font-weight: 700;
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.quote-summary-cta:hover {
  background: var(--accent-hover);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.quote-summary-cta:active {
  transform: translateY(0);
}

.quote-summary-cta:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.quote-summary-cta svg {
  width: 18px;
  height: 18px;
}

.quote-summary-note {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-align: center;
  margin-top: var(--space-3);
}

/* ---- Submit Area (bottom of main column, visible on mobile) ---- */
.config-submit-area {
  display: none;
}

/* ---- Mobile: Quote Summary as collapsible bottom bar ---- */
@media (max-width: 900px) {
  .configurator {
    grid-template-columns: 1fr;
    gap: var(--space-6);
    padding-bottom: 120px;
  }

  .quote-summary {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    z-index: 90;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.5);
    max-height: 80vh;
    overflow-y: auto;
    transition: transform var(--duration-normal) var(--ease-out);
  }

  .quote-summary.collapsed .quote-summary-items,
  .quote-summary.collapsed .quote-summary-totals {
    display: none;
  }

  .quote-summary-header {
    cursor: pointer;
  }

  .quote-summary-toggle {
    display: flex;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: transform var(--duration-fast) var(--ease-out);
  }

  .quote-summary.collapsed .quote-summary-toggle {
    transform: rotate(180deg);
  }

  .config-options {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }

  .config-tiles {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  .config-input-row {
    grid-template-columns: 1fr;
  }
}

/* Desktop: hide toggle chevron */
@media (min-width: 901px) {
  .quote-summary-toggle {
    display: none;
  }
}

/* ---- Validation error state ---- */
.config-input.error {
  border-color: var(--status-error);
  box-shadow: 0 0 0 3px var(--status-error-bg);
}

.config-error-msg {
  font-size: var(--text-xs);
  color: var(--status-error);
  margin-top: var(--space-1);
  display: none;
}

.config-error-msg.visible {
  display: block;
}

/* ---- Loading/submitting state ---- */
.quote-summary-cta.loading {
  pointer-events: none;
  opacity: 0.8;
}

.quote-summary-cta.loading::after {
  content: '';
  width: 18px;
  height: 18px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
