/* ════════════════════════════════════════════════
  COLOUR TOKENS  — edit here to retheme everything
  ════════════════════════════════════════════════ */
:root {

  --color-page-bg:             #f0f2f5;
  --color-card-bg:             #ffffff;

  --color-sidebar-bg:          #f7f8fa;
  --color-sidebar-border:      #e4e6eb;

  /* Brand */
  --color-brand:               #95B1EE;
  --color-brand-text:          #001129;
  --color-brand-text-inverted: #001129;
  --color-brand-light:         #DCE5FD;
  --color-brand-light-text:    #001129;

  /* Steps */
  --color-step-active-bg:      var(--color-brand-light);
  --color-step-active-fg:      var(--color-brand-light-text);
  --color-step-done-bg:        var(--color-brand);
  --color-step-done-fg:        #ffffff;
  --color-step-idle-border:    #d1d5db;
  --color-step-idle-fg:        #9ca3af;
  --color-step-line:           #e5e7eb;

  /* Text */
  --color-text-primary:        #111827;
  --color-text-secondary:      #6b7280;
  --color-text-link:           var(--color-brand);
  --color-text-danger:         #f44336;

  /* Inputs */
  --color-input-border:        #d1d5db;
  --color-input-bg:            #ffffff;
  --color-input-focus:         var(--color-brand);
  --color-input-placeholder:   #9ca3af;

  /* Buttons */
  --color-btn-primary-bg:      var(--color-brand);
  --color-btn-primary-fg:      var(--color-brand-text-inverted);
  --color-btn-ghost-border:    var(--color-brand-light);
  --color-btn-ghost-bg:        var(--color-brand-light);
  --color-btn-ghost-fg:        var(--color-brand-text);
  --color-btn-ghost-hover:     var(--color-brand-light);

  /* Misc */
  --color-divider:             #e5e7eb;
  --color-tag-bg:              #f3f4f6;
  --color-tag-fg:              #6b7280;
  --color-sticky-bg:           rgba(255,255,255,0.95);
  --color-shadow:              rgba(0,0,0,0.06);

  /* Sidebar scroll fade — must match sidebar bg */
  --color-sidebar-fade:        #f7f8fa;

  /* Radii */
  --radius-card:    1rem;
  --radius-input:   0.5rem;
  --radius-btn:     0.5rem;
}

/* ════════════════════════════════════════════════
    RESET & BASE
    ════════════════════════════════════════════════ */

body {
  background: var(--color-page-bg);
}

.js-sfp-formContentSection.show {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;

  /* @media screen and (width > 768px) {
    padding: 2rem;
  } */
}

/* ════════════════════════════════════════════════
    SHELL
    ════════════════════════════════════════════════ */
.que-shell :not(.user-content, .user-content *) {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.que-shell.que-shell {
  position: relative;

  display: flex;
  width: 100%;
  height: 100%;
  background: var(--color-card-bg);
  overflow: hidden;

   /* @media screen and (width > 768px) {
    max-width: 1440px;
    height: 80dvh;
    border-radius: var(--radius-card);
    box-shadow: 0 4px 24px var(--color-shadow), 0 1px 4px var(--color-shadow);
   } */

  @media screen and (width <= 768px) {
    flex-direction: column;
  }

  /* ════════════════════════════════════════════════
      SIDEBAR
      ════════════════════════════════════════════════ */
  .que-sidebar {
    position: relative;
    width:300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--color-sidebar-bg);
    border-right: 1px solid var(--color-sidebar-border);

    @media screen and (width <= 768px) {
      width: 100%;

      .que-sidebar-divider{
        display: none;
      }

      .que-sidebar-fade{
        display: none;
      }
      .que-sidebar-desc{
        display: none;
      }
      .que-steps{
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 16px;

        .que-step-body{
          display: none;
        }

        .que-step-track{
          flex-direction: row;
        }

        .que-step-track-line{
          width: 20px;
          height: 1px;
          min-height: unset;
        }
      }
      .que-sidebar-scroll {
        padding-bottom: 8px;
      }
    }
  }

  /* Scrollable inner track */
  .que-sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 1.5rem 3rem;
    scrollbar-width: none;
  }
  .que-sidebar-scroll::-webkit-scrollbar { display: none; }

  /* Scroll-fade overlays */
  .que-sidebar-fade {
    position: absolute;
    left: 0; right: 0;
    height: 60px;
    pointer-events: none;
    z-index: 2;
  }
  .que-sidebar-fade--top {
    top: 0;
    background: linear-gradient(to bottom,
      var(--color-sidebar-fade) 0%,
      transparent 100%);
  }
  .que-sidebar-fade--bottom {
    bottom: 0;
    background: linear-gradient(to top,
      var(--color-sidebar-fade) 0%,
      transparent 100%);
  }

  /* Logo */
  .que-logo {
    margin-bottom: 2rem;

    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  /* Sidebar title block */
  .que-sidebar-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 0.375rem;
  }
  .que-sidebar-desc {
    font-size: 0.75rem;
    line-height: 1.65;
    color: var(--color-text-secondary);
    margin-bottom: 1.75rem;

    &:empty {
      display: none;
    }
  }

  .que-sidebar-divider {
    height: 1px;
    background: var(--color-divider);
    margin-bottom: 1.5rem;
  }

  /* Steps list */
  .que-steps { display: flex; flex-direction: column; }

  .que-step {
    display: flex;
    gap: 0.75rem;

    &[data-state="active"] {
      .que-step-badge {
        background: var(--color-step-active-bg);
        color: var(--color-step-active-fg);
      }

      .que-step-label {
        color: var(--color-step-active-fg);
      }
    }

    &[data-state="idle"] {
      .que-step-badge {
        background: transparent;
        border: 1.5px solid var(--color-step-idle-border);
        color: var(--color-step-idle-fg);
      }
    }

    &[data-state="done"] {
      .que-step-badge {
        background: var(--color-step-done-bg);
        color: var(--color-step-done-fg);
      }
    }
  }

  /* Vertical connector */
  .que-step-track {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
  }
  .que-step-track-line {
    width: 1px;
    height: 100%;
    min-height: 48px;
    background: var(--color-step-line);
    margin: 3px 0;
  }
  .que-step:last-child .que-step-track-line { display: none; }

  .que-step-badge {
    width: 28px; height: 28px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
  }
  .que-step-body {
    padding-bottom: 0.25rem;
    flex: 1;
    min-width: 0;
    padding-top: 0.15rem;
  }
  .que-step-label {
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-text-primary);
  }

  .que-step-sublabel {
    font-size: 0.7rem;
    line-height: 1.5;
    color: var(--color-text-secondary);
    margin-top: 0.15rem;
  }

  /* Spacer below step body (aligns with line) */
  .que-step-spacer { height: 32px; }

  /* ════════════════════════════════════════════════
      MAIN PANEL
      ════════════════════════════════════════════════ */
  .que-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-y: auto;
  }

  /* Scrollable content area (header is NOT sticky) */
  .que-content {
    flex: 1;
    padding: 2rem 2.25rem 1.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--color-divider) transparent;
  }
  .que-content::-webkit-scrollbar { width: 5px; }
  .que-content::-webkit-scrollbar-track { background: transparent; }
  .que-content::-webkit-scrollbar-thumb {
    background: var(--color-divider);
    border-radius: 99px;
  }


  .que-form-content:not([data-active="true"]){
    display: none;
  }

  /* Page header – scrolls with content */
  .que-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.25rem;

    &:not([data-active="true"]){
      display: none;
    }
  }
  .que-step-meta {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 0.3rem;
  }
  .que-page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: 1.2;
  }
  .que-page-desc {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
    margin-top: 0.35rem;

    &:empty {
      display: none;
    }
  }

  .que-btn-exit {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.45rem 0.9rem;
    border-radius: var(--radius-btn);
    border: 1px solid var(--color-btn-ghost-border);
    background: var(--color-btn-ghost-bg);
    color: var(--color-btn-ghost-fg);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
    flex-shrink: 0;
  }
  .que-btn-exit:hover { background: var(--color-btn-ghost-hover); }

  .que-content-divider {
    height: 1px;
    background: var(--color-divider);
    margin-bottom: 1.75rem;
  }

  /* Info blurb + scan button row */
  .que-form-meta {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.75rem;
  }
  .que-form-info { max-width: 260px; }
  .que-form-info-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 0.4rem;
  }
  .que-form-info-text {
    font-size: 0.75rem;
    line-height: 1.65;
    color: var(--color-text-secondary);
  }
  .que-form-info-link {
    display: inline-block;
    margin-top: 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-link);
    text-decoration: none;
  }
  .que-form-info-link:hover { text-decoration: underline; }

  .que-btn-scan {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.45rem 0.9rem;
    border-radius: var(--radius-btn);
    border: 1px solid var(--color-btn-ghost-border);
    background: var(--color-btn-ghost-bg);
    color: var(--color-btn-ghost-fg);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
    flex-shrink: 0;
  }
  .que-btn-scan:hover { background: var(--color-btn-ghost-hover); }

  /* Form grid */
  .que-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 1.25rem;
  }
  .que-field { display: flex; flex-direction: column; gap: 0.375rem; }
  .que-field--full { grid-column: 1 / -1; }

  .que-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-primary);
  }

  .que-input,
  .que-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-input-border);
    border-radius: var(--radius-input);
    background: var(--color-input-bg);
    color: var(--color-text-primary);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8125rem;
    transition: border-color 0.15s, box-shadow 0.15s;
  }
  .que-input::placeholder { color: var(--color-input-placeholder); }
  .que-input:focus,
  .que-select:focus {
    outline: none;
    border-color: var(--color-input-focus);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-input-focus) 15%, transparent);
  }

  /* Custom select arrow */
  .que-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.65rem center;
    padding-right: 2rem;
    cursor: pointer;
  }

  /* VIN row */
  .que-vin-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  .que-vin-wrap { position: relative; flex: 1; }
  .que-vin-wrap .que-input { padding-right: 2rem; width: 100%; }
  .que-vin-clear {
    position: absolute;
    right: 0.625rem; top: 50%;
    transform: translateY(-50%);
    background: none; border: none;
    cursor: pointer;
    color: var(--color-text-secondary);
    display: flex; align-items: center;
    padding: 0;
    transition: color 0.15s;
  }
  .que-vin-clear:hover { color: var(--color-text-primary); }

  .que-or-chip {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    background: var(--color-tag-bg);
    color: var(--color-tag-fg);
    flex-shrink: 0;
  }

  /* Icon helper */
  .que-icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
  }

  /* ════════════════════════════════════════════════
      STICKY FOOTER
      ════════════════════════════════════════════════ */
  .que-footer {
    flex-shrink: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas: 'prev next';

    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 2.25rem;
    border-top: 1px solid var(--color-divider);
  }

  :is(.que-btn-prev, .js-que-btn-prev){
    grid-area: prev;
    justify-self: start;
  }

  .que-btn-prev {

    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-btn);
    border: 1px solid var(--color-btn-ghost-border);
    background: var(--color-btn-ghost-bg);
    color: var(--color-btn-ghost-fg);
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    transition: background 0.15s;
  }
  .que-btn-prev:hover { background: var(--color-btn-ghost-hover); }

  :is(.que-btn-next, .que-btn-submit, .js-que-btn-next, .js-que-btn-submit) {
    grid-area: next;
    justify-self: end;
  }

  :is(.que-btn-next, .que-btn-submit) {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.5rem 1.5rem;
    border-radius: var(--radius-btn);
    border: none;
    background: var(--color-btn-primary-bg);
    color: var(--color-btn-primary-fg) !important;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    transition: opacity 0.15s;
  }
  :is(.que-btn-next, .que-btn-submit):hover { opacity: 0.85; }

  :is(.que-btn-next, .que-btn-prev, .que-btn-submit, .js-que-btn-next, .js-que-btn-prev, .js-que-btn-submit)[data-hidden="true"] {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
  }









  .que-status-card {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
  }

  .que-status-card-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 380px;
    gap: 0;
  }

  .que-status-card-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--color-step-done-bg);
    color: var(--color-step-done-fg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    flex-shrink: 0;
    
    i {
      font-size: inherit;
    }
  }

  .que-status-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 0.75rem;
    line-height: 1.3;
  }

  .que-status-card-desc {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    line-height: 1.65;
    margin-bottom: 2rem;

    &:empty {
      display: none;
    }
  }

  .que-status-card-btn {
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.6rem 1.5rem;
    text-decoration: none;
  }



  .que-error .que-status-card-icon {
    background: var(--color-input-error-bg, #fef2f2);
    color: var(--color-input-error, #dc2626);
  }

  .que-error-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .que-error-retry {
    background: var(--color-btn-primary-bg);
    color: var(--color-btn-primary-fg);
    border-color: var(--color-btn-primary-bg);
  }

  .que-error-retry:hover {
    background: var(--color-btn-primary-bg);
    opacity: 0.85;
  }
  
  .que-widget-error-text {
	  color: var(--color-text-danger);
	  font-weight: 600;
  }
}