/* ============================================================================
   MULTI-STEP QUOTE REQUEST MODAL - DARK PREMIUM THEME
   Matches North Star's core styles.css
   ========================================================================== */
/* ============================================================================
   1. MODAL OVERLAY & CONTAINER
   ========================================================================== */

.quote-modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 12, 0);
  backdrop-filter: blur(0px);
  opacity: 0;
  pointer-events: none;
  /* THE FIX: Completely strips the invisible modal from the touch matrix */
  visibility: hidden; 
  z-index: 9999;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.quote-modal-overlay.active {
  background: rgba(10, 10, 12, 0.85);
  backdrop-filter: blur(12px);
  opacity: 1;
  pointer-events: auto;
  /* THE FIX: Brings the modal back to life when opened */
  visibility: visible; 
}



.quote-modal-container {
  position: relative;
  width: 90%;
  max-width: 550px;
  background: #0a0a0c; /* Base dark color */
  border: 1px solid rgba(255, 255, 255, 0.08); /* Glass border */
  border-radius: 1.5rem;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  transform: scale(0.95) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.quote-modal-overlay.active .quote-modal-container {
  transform: scale(1) translateY(0);
}

/* ============================================================================
   2. MODAL HEADER
   ========================================================================== */

.quote-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
}

.quote-modal-title {
  font-family: 'Manrope', -apple-system, sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
  letter-spacing: -0.02em;
}

.quote-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  color: #a1a1a6;
  transition: all 0.15s cubic-bezier(0.22, 1, 0.36, 1);
}

.quote-modal-close:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  transform: rotate(90deg);
}

/* ============================================================================
   3. MODAL CONTENT & STEPS (Updated for Smart Scrolling)
   ========================================================================== */

.quote-modal-content {
  position: relative;
  padding: 2rem;
  /* Cap the height so it doesn't grow off-screen */
  max-height: 75vh; 
  /* Auto-scroll: Only appears if content exceeds max-height */
  overflow-y: auto; 
  overflow-x: hidden;
  transition: height 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Re-add the sleek dark scrollbar so it matches the aesthetic */
.quote-modal-content::-webkit-scrollbar {
  width: 6px;
}
.quote-modal-content::-webkit-scrollbar-track {
  background: transparent;
}
.quote-modal-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
}
.quote-modal-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

.quote-step {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  position: absolute;
  inset: 2rem;
}


.quote-step.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  position: relative;
  inset: auto;
}

.quote-step-title {
  font-family: 'Manrope', -apple-system, sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: #ffffff;
  margin: 0 0 1.5rem 0;
  letter-spacing: -0.02em;
}

/* ============================================================================
   4. BUTTON GROUPS & OPTIONS
   ========================================================================== */

.quote-button-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.quote-option-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.5rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  cursor: pointer;
  /* THE SPEED FIX: Dropped from 0.15s to 0.15s */
  transition: all 0.15s cubic-bezier(0.22, 1, 0.36, 1);
}

.quote-option-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-4px);
}

.quote-option-btn.selected {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.quote-option-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  font-family: 'Manrope', sans-serif;
  font-weight: 600;
  font-size: 1.2rem;
  color: #a1a1a6;
  transition: all 0.15s ease;
}

.quote-option-btn.selected .quote-option-icon {
  background: #ffffff;
  color: #000000;
}

.quote-option-text {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  color: #a1a1a6;
  text-align: center;
  transition: color 0.15s ease;
}

.quote-option-btn.selected .quote-option-text {
  color: #ffffff;
}

/* ============================================================================
   5. FORM GROUPS & INPUTS
   ========================================================================== */

.quote-form-group {
  margin-bottom: 1.5rem;
}

.quote-label {
  display: block;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  color: #a1a1a6;
  margin-bottom: 0.5rem;
}

.quote-required {
  color: #ffffff;
}

.quote-input,
.quote-textarea {
  width: 100%;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 1rem;
  color: #ffffff;
  transition: all 0.15s cubic-bezier(0.22, 1, 0.36, 1);
}

.quote-input::placeholder,
.quote-textarea::placeholder {
  color: rgba(255, 255, 255, 0.2);
}

.quote-input:focus,
.quote-textarea:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.4);
}

.quote-input.error,
.quote-textarea.error {
  border-color: #ff453a;
  background: rgba(255, 69, 58, 0.05);
}

.quote-textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

/* ============================================================================
   6. FILE UPLOAD
   ========================================================================== */

.quote-file-drop {
  position: relative;
  padding: 2rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.quote-file-drop:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.4);
}

.quote-file-drop.dragover {
  background: rgba(255, 255, 255, 0.08);
  border-color: #ffffff;
}

.quote-file-input {
  display: none;
}

.quote-file-text {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  color: #f5f5f7;
  margin: 0 0 0.25rem 0;
}

.quote-file-hint {
  font-size: 0.85rem;
  color: #a1a1a6;
  margin: 0;
}

.quote-file-list {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quote-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  font-size: 0.85rem;
}

.quote-file-name {
  color: #ffffff;
  font-weight: 500;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quote-file-size {
  color: #a1a1a6;
  font-size: 0.8rem;
  margin: 0 0.75rem;
}

.quote-file-remove {
  background: none;
  border: none;
  color: #ff453a;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.quote-file-remove:hover {
  transform: scale(1.2) rotate(90deg);
}

/* ============================================================================
   7. BUTTONS (Matching .btn-primary)
   ========================================================================== */

.quote-next-btn,
.quote-submit-btn,
.quote-close-success-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.75rem;
  background-color: #ffffff;
  color: #000000;
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  border-radius: 2rem;
  border: none;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.22, 1, 0.36, 1);
  margin-top: 1rem;
}

.quote-next-btn:hover,
.quote-submit-btn:hover,
.quote-close-success-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 15px 30px rgba(255, 255, 255, 0.12);
  background-color: #f5f5f7;
}

.quote-next-btn:active,
.quote-submit-btn:active,
.quote-close-success-btn:active {
  transform: scale(0.98);
}

/* ============================================================================
   8. SUCCESS SCREEN
   ========================================================================== */

.quote-success {
  text-align: center;
  padding: 2rem 0;
}

.quote-success-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  margin: 0 auto 1.5rem;
  color: #ffffff;
}

.quote-success-icon svg {
  width: 40px;
  height: 40px;
  stroke-width: 2.5;
}

.quote-success-title {
  font-family: 'Manrope', sans-serif;
  font-size: 1.75rem;
  font-weight: 600;
  color: #ffffff;
  margin: 0 0 0.75rem 0;
  letter-spacing: -0.02em;
}

.quote-success-message {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 1.05rem;
  color: #a1a1a6;
  margin: 0 0 2rem 0;
  line-height: 1.6;
}

/* ============================================================================
   9. PROGRESS BAR
   ========================================================================== */

.quote-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
}

.quote-progress-bar {
  height: 100%;
  background: #ffffff;
  width: 20%;
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* ============================================================================
   10. VALIDATION ERROR
   ========================================================================== */

.quote-validation-error {
  padding: 1rem;
  background: rgba(255, 69, 58, 0.1);
  border: 1px solid rgba(255, 69, 58, 0.3);
  border-radius: 1rem;
  color: #ff453a;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  animation: slideDown 0.15s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}


/* ============================================================================
   12. RESPONSIVE DESIGN (The Nuclear Mobile Clamp)
   ========================================================================== */

@media (max-width: 640px) {
  .quote-modal-overlay {
    align-items: center; 
    padding: 1rem; 
  }

  .quote-modal-container {
    width: 100%;
    margin: auto;
    /* Strict limit on the entire box */
    max-height: 85vh !important; 
    display: flex;
    flex-direction: column;
    border-radius: 1.5rem;
    overflow: hidden; 
  }

  .quote-modal-header {
    flex-shrink: 0; 
    background: #0a0a0c;
    z-index: 10;
  }

  .quote-modal-title {
    font-size: 1.15rem; 
  }

  .quote-modal-content {
    padding: 1.5rem;
    /* 
     * NUCLEAR CLAMP: Physically limit the scrolling area to 85vh minus the header height (~80px).
     * The !important flag completely overpowers the JavaScript animation height.
     */
    max-height: calc(85vh - 80px) !important; 
    overflow-y: auto; 
    overflow-x: hidden;
  }

  .quote-step-title {
    font-size: 1.35rem; 
    line-height: 1.3;
    letter-spacing: -0.01em;
  }

  .quote-button-group {
    grid-template-columns: 1fr;
    gap: 0.75rem; 
  }

  .quote-action-group {
    flex-direction: column-reverse;
    gap: 0.75rem;
  }

  /* Ensures the bottom margin exists inside the scrolling area */
  .quote-modal-content::after {
    content: "";
    display: block;
    height: 3.5rem; 
    width: 100%;
  }
}

/* ============================================================================
   13. ACTION BUTTON GROUPS (NEXT & BACK)
   ========================================================================== */

.quote-action-group {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.quote-back-btn {
  flex: 1; /* Takes up 1 part of the width */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.5rem;
  background-color: transparent;
  color: #f5f5f7;
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  border-radius: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.22, 1, 0.36, 1);
}

.quote-back-btn:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.4);
  transform: scale(1.02);
}

.quote-back-btn:active {
  transform: scale(0.98);
}

.quote-next-btn, 
.quote-submit-btn {
  flex: 2; /* Makes the primary action button twice as wide as the back button */
  margin-top: 0 !important; /* Removes the old top margin to align perfectly */
}

/* On mobile phones, stack the buttons so the primary action is on top */
@media (max-width: 640px) {
  .quote-action-group {
    flex-direction: column-reverse;
    gap: 0.75rem;
  }
}

/* ============================================================================
   14. SCROLL SPACING FIX
   ========================================================================== */
.quote-modal-content::after {
  content: "";
  display: block;
  height: 3.5rem; 
  width: 100%;
}