/**
 * Qualification Modal Styles
 * Modular BEM-based CSS with Excel Green branding
 */

/* ==================== Modal Base ==================== */
.qual-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.qual-modal.active {
  opacity: 1;
}

.qual-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
}

.qual-modal__container {
  position: relative;
  background: var(--dark-bg-light);
  border-radius: 16px;
  max-width: 700px;
  width: 90%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: 2px solid var(--excel-green);
  transform: scale(0.9);
  transition: transform 0.3s ease;
  z-index: 10000;
}

.qual-modal.active .qual-modal__container {
  transform: scale(1);
}

/* ==================== Close Button ==================== */
.qual-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  color: var(--muted-text);
  font-size: 2rem;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
  z-index: 10;
}

.qual-modal__close:hover {
  background: var(--excel-green);
  color: var(--light-text);
  transform: rotate(90deg);
}

/* ==================== Progress Bar ==================== */
.qual-modal__progress {
  height: 4px;
  background: var(--dark-bg);
  border-radius: 16px 16px 0 0;
  overflow: hidden;
}

.qual-modal__progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--excel-green) 0%, var(--excel-green-light) 100%);
  width: 25%;
  transition: width 0.4s ease;
}

/* ==================== Header ==================== */
.qual-modal__header {
  padding: 2rem 2rem 1rem;
  text-align: center;
}

.qual-modal__title {
  font-size: 2rem;
  color: var(--excel-green-light);
  margin: 0;
}

/* ==================== Body ==================== */
.qual-modal__body {
  padding: 1rem 2rem 2rem;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.qual-modal__step {
  animation: fadeInStep 0.4s ease;
}

@keyframes fadeInStep {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==================== Input Groups ==================== */
.qual-modal__input-group {
  margin-bottom: 1.5rem;
}

.qual-modal__label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--light-text);
  font-weight: 500;
  font-size: 1rem;
}

.qual-modal__input {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--dark-bg);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  color: var(--light-text);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.qual-modal__input:focus {
  outline: none;
  border-color: var(--excel-green);
  box-shadow: 0 0 0 3px rgba(33, 115, 70, 0.2);
}

.qual-modal__input::placeholder {
  color: var(--muted-text);
  opacity: 0.6;
}

.qual-modal__error {
  display: block;
  color: #ff4444;
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

/* ==================== Questions ==================== */
.qual-modal__question {
  margin-bottom: 0;
}

.qual-modal__question-title {
  font-size: 1.5rem;
  color: var(--light-text);
  margin-bottom: 2rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.4;
}

.qual-modal__checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

.qual-modal__checkbox {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 1rem;
  background: var(--dark-bg);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.qual-modal__checkbox:hover {
  border-color: var(--excel-green);
  background: rgba(33, 115, 70, 0.1);
}

.qual-modal__checkbox input[type="radio"] {
  margin-right: 1rem;
  width: 20px;
  height: 20px;
  accent-color: var(--excel-green);
  cursor: pointer;
}

.qual-modal__checkbox input[type="radio"]:checked ~ .qual-modal__checkbox-label {
  color: var(--excel-green-light);
  font-weight: 600;
}

.qual-modal__checkbox-label {
  font-size: 1rem;
  color: var(--light-text);
  flex: 1;
}

/* ==================== Value List (Step 3) ==================== */
.qual-modal__value-list {
  margin-bottom: 1.5rem;
}

.qual-modal__value-title {
  font-size: 1.5rem;
  color: var(--excel-green-light);
  margin-bottom: 1.5rem;
  text-align: center;
}

.qual-modal__value-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  background: var(--dark-bg);
  border: 2px solid var(--excel-green);
  border-radius: 8px;
  position: relative;
}

.qual-modal__value-checkbox {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.qual-modal__checkmark {
  width: 28px;
  height: 28px;
  border: 2px solid var(--excel-green);
  border-radius: 6px;
  margin-right: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--excel-green);
  flex-shrink: 0;
}

.qual-modal__checkmark img {
  width: 18px;
  height: 18px;
  opacity: 1;
  transform: scale(1);
  filter: brightness(0) invert(1);
}

.qual-modal__value-text {
  font-size: 0.95rem;
  color: var(--light-text);
  line-height: 1.3;
}

/* ==================== Booking (Step 6) ==================== */
.qual-modal__booking {
  max-width: 500px;
  margin: 0 auto;
}

/* Calendar View */
.qual-modal__calendar-view {
  background: var(--dark-bg);
  border-radius: 12px;
  padding: 1.5rem;
  border: 2px solid var(--border-color);
}

.qual-modal__calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.qual-modal__calendar-month {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--excel-green-light);
}

.qual-modal__calendar-nav {
  background: var(--dark-bg-light);
  border: 2px solid var(--border-color);
  color: var(--light-text);
  width: 40px;
  height: 40px;
  border-radius: 8px;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qual-modal__calendar-nav:hover {
  border-color: var(--excel-green);
  background: rgba(33, 115, 70, 0.2);
}

.qual-modal__calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
  margin-bottom: 0.75rem;
  text-align: center;
}

.qual-modal__calendar-weekdays span {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted-text);
  padding: 0.5rem 0;
}

.qual-modal__calendar-weekdays .weekend {
  color: #666;
}

.qual-modal__calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
}

.qual-modal__calendar-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--dark-bg-light);
  border: 2px solid transparent;
  position: relative;
  color: var(--light-text);
}

.qual-modal__calendar-day:hover:not(.disabled):not(.empty) {
  border-color: var(--excel-green);
  transform: scale(1.05);
}

.qual-modal__calendar-day.empty {
  background: transparent;
  cursor: default;
}

.qual-modal__calendar-day.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  color: #666;
}

.qual-modal__calendar-day.weekend {
  background: var(--dark-bg);
  opacity: 0.4;
  cursor: not-allowed;
}

.qual-modal__calendar-day.available::after {
  content: '';
  position: absolute;
  bottom: 6px;
  width: 8px;
  height: 8px;
  background: var(--excel-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--excel-green);
}

.qual-modal__calendar-day.selected {
  background: var(--excel-green);
  border-color: var(--excel-green);
  color: white;
}

.qual-modal__calendar-day.selected::after {
  background: white;
  box-shadow: none;
}

.qual-modal__calendar-day.today {
  border-color: var(--excel-green-light);
}

.qual-modal__calendar-legend {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.qual-modal__legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--muted-text);
}

.qual-modal__legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.qual-modal__legend-dot.available {
  background: var(--excel-green);
  box-shadow: 0 0 6px var(--excel-green);
}

.qual-modal__legend-dot.unavailable {
  background: #666;
}

/* Time Panel */
.qual-modal__time-panel {
  background: var(--dark-bg);
  border-radius: 12px;
  padding: 1.5rem;
  border: 2px solid var(--excel-green);
}

.qual-modal__time-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.qual-modal__back-btn {
  background: transparent;
  border: none;
  color: var(--excel-green-light);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.5rem;
  transition: opacity 0.3s ease;
}

.qual-modal__back-btn:hover {
  opacity: 0.7;
}

.qual-modal__selected-date {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--light-text);
}

.qual-modal__time-slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.qual-modal__time-slot {
  padding: 1rem;
  background: var(--dark-bg-light);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  color: var(--light-text);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.qual-modal__time-slot:hover:not(.unavailable) {
  border-color: var(--excel-green);
  background: rgba(33, 115, 70, 0.2);
}

.qual-modal__time-slot.selected {
  background: var(--excel-green);
  border-color: var(--excel-green);
  color: white;
}

.qual-modal__time-slot.unavailable {
  opacity: 0.3;
  cursor: not-allowed;
  text-decoration: line-through;
}

/* Confirm Panel */
.qual-modal__confirm-panel {
  text-align: center;
}

.qual-modal__booking-selected {
  padding: 1.5rem;
  background: rgba(33, 115, 70, 0.15);
  border: 2px solid var(--excel-green);
  border-radius: 12px;
  margin-bottom: 1.5rem;
}

.qual-modal__selected-label {
  color: var(--muted-text);
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.qual-modal__selected-time {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--excel-green-light);
  line-height: 1.4;
}

.qual-modal__confirm-panel .qual-modal__button {
  width: 100%;
  margin-bottom: 1rem;
}

.qual-modal__change-btn {
  background: transparent;
  border: none;
  color: var(--muted-text);
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: underline;
}

.qual-modal__change-btn:hover {
  color: var(--light-text);
}

/* Loading */
.qual-modal__booking-loading {
  text-align: center;
  padding: 3rem;
  color: var(--muted-text);
}

.qual-modal__spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--border-color);
  border-top-color: var(--excel-green);
  border-radius: 50%;
  margin: 0 auto 1rem;
  animation: spin 1s linear infinite;
}

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

/* Success */
.qual-modal__booking-success {
  text-align: center;
  padding: 2rem;
}

.qual-modal__booking-success h3 {
  color: var(--excel-green-light);
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.qual-modal__booking-success p {
  color: var(--muted-text);
  font-size: 1.125rem;
  line-height: 1.6;
}

@media (max-width: 500px) {
  .qual-modal__time-slots {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .qual-modal__calendar-day {
    font-size: 0.875rem;
  }
  
  .qual-modal__calendar-month {
    font-size: 1.25rem;
  }
}

/* ==================== Disqualification ==================== */
.qual-modal__disqualify {
  text-align: center;
  padding: 2rem;
}

.qual-modal__disqualify-content h3 {
  font-size: 1.75rem;
  color: var(--excel-green-light);
  margin-bottom: 1rem;
}

.qual-modal__disqualify-content p {
  font-size: 1.125rem;
  color: var(--muted-text);
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* ==================== Footer / Buttons ==================== */
.qual-modal__footer {
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  background: var(--dark-bg);
  border-radius: 0 0 16px 16px;
}

.qual-modal__button {
  padding: 0.875rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  flex: 1;
}

.qual-modal__button--primary {
  background: var(--excel-green);
  color: var(--light-text);
}

.qual-modal__button--primary:hover:not(:disabled) {
  background: var(--excel-green-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(33, 115, 70, 0.4);
}

.qual-modal__button--primary:disabled {
  background: var(--border-color);
  color: var(--muted-text);
  cursor: not-allowed;
  opacity: 0.5;
}

.qual-modal__button--secondary {
  background: transparent;
  color: var(--light-text);
  border: 2px solid var(--border-color);
}

.qual-modal__button--secondary:hover {
  border-color: var(--excel-green);
  color: var(--excel-green-light);
}

/* ==================== Responsive Design ==================== */
@media (max-width: 768px) {
  .qual-modal__container {
    width: 95%;
    max-height: 95vh;
  }

  .qual-modal__header {
    padding: 1.5rem 1.5rem 1rem;
  }

  .qual-modal__title {
    font-size: 1.5rem;
  }

  .qual-modal__body {
    padding: 1rem 1.5rem 1.5rem;
  }

  .qual-modal__footer {
    flex-direction: column;
  }

  .qual-modal__button {
    width: 100%;
  }

  .qual-modal__value-item {
    padding: 0.875rem;
  }

  .qual-modal__value-text {
    font-size: 0.9rem;
  }
}

/* ==================== Scrollbar Styling ==================== */
.qual-modal__body::-webkit-scrollbar {
  width: 6px;
}

.qual-modal__body::-webkit-scrollbar-track {
  background: transparent;
}

.qual-modal__body::-webkit-scrollbar-thumb {
  background: var(--excel-green);
  border-radius: 3px;
}

.qual-modal__body::-webkit-scrollbar-thumb:hover {
  background: var(--excel-green-light);
}



/* Disqualification Messages - Clean Centered */
#stepDisqualify .qual-modal__disqualify-content,
#stepBudgetDisqualify .qual-modal__disqualify-content {
  text-align: center;
  max-width: 450px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

#stepDisqualify .qual-modal__disqualify-content h3,
#stepBudgetDisqualify .qual-modal__disqualify-content h3 {
  color: var(--excel-green-light);
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

#stepDisqualify .qual-modal__disqualify-content p,
#stepBudgetDisqualify .qual-modal__disqualify-content p {
  color: var(--light-text);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 1rem;
}

.qual-modal__disqualify-signoff {
  margin-top: 1.5rem;
  font-weight: 500;
  color: var(--excel-green-light);
  font-style: italic;
}

/* Value Reminder Box */
.qual-modal__value-reminder {
  background: rgba(33, 115, 70, 0.1);
  border: 1px solid var(--excel-green);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.qual-modal__value-reminder p {
  margin: 0 0 0.5rem 0;
  color: var(--light-text);
  font-size: 0.95rem;
}

.qual-modal__value-reminder ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.qual-modal__value-reminder li {
  color: var(--excel-green-light);
  font-size: 0.9rem;
  padding: 0.25rem 0;
}

/* Tighten disqualify spacing */
#stepDisqualify .qual-modal__disqualify-content,
#stepBudgetDisqualify .qual-modal__disqualify-content {
  padding: 1rem 1.5rem;
}

#stepDisqualify .qual-modal__disqualify-content h3,
#stepBudgetDisqualify .qual-modal__disqualify-content h3 {
  margin-bottom: 0.5rem;
}

#stepDisqualify .qual-modal__disqualify-content h2,
#stepBudgetDisqualify .qual-modal__disqualify-content h2 {
  white-space: nowrap;
  font-size: 1.4rem;
}
