/* ========================================================================
   QUALIFICATION FORM MODAL
   ======================================================================== */

.qf-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 3vw, 2rem);
  opacity: 0;
  transition: opacity 0.35s var(--ease-out-quart);
}

.qf-overlay.is-open {
  display: flex;
  opacity: 1;
}

.qf-modal {
  position: relative;
  width: 100%;
  max-width: 720px;
  max-height: 92vh;
  background: var(--dark);
  border: 1px solid rgba(212, 175, 55, 0.18);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), var(--shadow-gold);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(24px) scale(0.98);
  opacity: 0;
  transition: transform 0.45s var(--ease-out-expo), opacity 0.35s var(--ease-out-quart);
}

.qf-overlay.is-open .qf-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Header */
.qf-header {
  padding: clamp(1.5rem, 3vw, 2rem) clamp(1.5rem, 3vw, 2.5rem);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
}

.qf-eyebrow {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.qf-title {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.5vw, 1.65rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1.2;
  margin: 0;
}

.qf-subtitle {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 0.5rem;
  line-height: 1.5;
}

.qf-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 5;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}

.qf-close:hover {
  background: rgba(212, 175, 55, 0.2);
  transform: rotate(90deg);
}

/* Progress */
.qf-progress {
  display: flex;
  gap: 6px;
  padding: 0 clamp(1.5rem, 3vw, 2.5rem);
  margin-top: 1rem;
}

.qf-progress-bar {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.qf-progress-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grad-gold);
  transform: translateX(-100%);
  transition: transform 0.5s var(--ease-out-expo);
}

.qf-progress-bar.is-active::after,
.qf-progress-bar.is-complete::after {
  transform: translateX(0);
}

/* Body */
.qf-body {
  flex: 1;
  overflow-y: auto;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 55, 0.3) transparent;
}

.qf-body::-webkit-scrollbar { width: 6px; }
.qf-body::-webkit-scrollbar-thumb { background: rgba(212, 175, 55, 0.3); border-radius: 3px; }

.qf-step {
  display: none;
  animation: qfFadeIn 0.4s var(--ease-out-quart);
}

.qf-step.is-active {
  display: block;
}

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

.qf-step-label {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 0.4rem;
}

.qf-step-heading {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  font-weight: 600;
  color: var(--white);
  margin: 0 0 1.5rem;
  line-height: 1.3;
}

/* Form fields */
.qf-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.qf-row--single {
  grid-template-columns: 1fr;
}

.qf-field {
  margin-bottom: 1rem;
}

.qf-label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 0.45rem;
  letter-spacing: 0.01em;
}

.qf-label .qf-required {
  color: var(--gold);
  margin-left: 2px;
}

.qf-label .qf-optional {
  color: rgba(255, 255, 255, 0.35);
  font-weight: 400;
  font-size: 0.7rem;
  margin-left: 4px;
}

.qf-input,
.qf-select,
.qf-textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--white);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.qf-input::placeholder,
.qf-textarea::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.qf-input:focus,
.qf-select:focus,
.qf-textarea:focus {
  border-color: var(--gold);
  background: rgba(212, 175, 55, 0.04);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.qf-input.is-invalid,
.qf-select.is-invalid,
.qf-textarea.is-invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.qf-textarea {
  min-height: 90px;
  resize: vertical;
  font-family: var(--font-body);
}

.qf-select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23D4AF37' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

.qf-select option {
  background: var(--dark);
  color: var(--white);
}

/* Checkbox group */
.qf-checkgroup {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.qf-check {
  position: relative;
  cursor: pointer;
  user-select: none;
}

.qf-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.qf-check-box {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.9rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
  transition: all 0.2s ease;
}

.qf-check-box::before {
  content: '';
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: 10px;
  background-repeat: no-repeat;
  background-position: center;
  transition: all 0.2s ease;
}

.qf-check input:checked + .qf-check-box {
  border-color: var(--gold);
  background: rgba(212, 175, 55, 0.08);
  color: var(--white);
}

.qf-check input:checked + .qf-check-box::before {
  border-color: var(--gold);
  background-color: var(--gold);
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='8' viewBox='0 0 10 8' fill='none'%3E%3Cpath d='M1 4L4 7L9 1' stroke='%23111' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.qf-check:hover .qf-check-box {
  border-color: rgba(212, 175, 55, 0.4);
}

/* Honeypot */
.qf-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Footer */
.qf-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem clamp(1.5rem, 3vw, 2.5rem);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.2);
}

.qf-step-counter {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
}

.qf-step-counter strong {
  color: var(--gold);
  font-weight: 700;
}

.qf-actions {
  display: flex;
  gap: 0.6rem;
}

.qf-btn {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.25s var(--ease-out-quart);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.qf-btn--ghost {
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  border-color: rgba(255, 255, 255, 0.15);
}

.qf-btn--ghost:hover {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.35);
}

.qf-btn--gold {
  background: var(--grad-gold);
  color: var(--dark);
  border-color: var(--gold);
}

.qf-btn--gold:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-gold);
}

.qf-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Success */
.qf-success {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(2.5rem, 5vw, 4rem) clamp(1.5rem, 3vw, 2.5rem);
}

.qf-success.is-active {
  display: flex;
}

.qf-success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--grad-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-gold);
  animation: qfPulse 1.4s ease-in-out infinite;
}

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

.qf-success h3 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 700;
  color: var(--white);
  margin: 0 0 0.75rem;
  line-height: 1.2;
}

.qf-success p {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.6;
  margin: 0 0 1.5rem;
  max-width: 460px;
}

.qf-success-redirect {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.5rem;
}

.qf-error-msg {
  display: none;
  margin: 1rem 0 0;
  padding: 0.75rem 1rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  color: #fca5a5;
  font-family: var(--font-body);
  font-size: 0.85rem;
}

.qf-error-msg.is-visible {
  display: block;
}

/* Spinner */
.qf-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(17, 17, 17, 0.3);
  border-top-color: var(--dark);
  border-radius: 50%;
  animation: qfSpin 0.7s linear infinite;
}

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

/* Responsive */
@media (max-width: 640px) {
  .qf-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .qf-checkgroup {
    grid-template-columns: 1fr;
  }
  .qf-footer {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .qf-actions {
    width: 100%;
  }
  .qf-actions .qf-btn {
    flex: 1;
    justify-content: center;
  }
  .qf-step-counter {
    text-align: center;
  }
}

/* Body scroll lock when modal open */
body.qf-modal-open {
  overflow: hidden;
}

/* Native cursors on form controls */
.qf-input,
.qf-textarea {
  cursor: text;
}

.qf-select,
.qf-check,
.qf-check-box {
  cursor: pointer;
}
