/* ============================================
   MIRLO · LEAD QUALIFIER WIZARD
   Modal full-screen tipo Typeform.
   Prefijo de clases: mq-
   ============================================ */

/* ---- Overlay y base ---- */
.mq-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #F7F6F5;
  font-family: 'Inter', system-ui, sans-serif;
  color: #1F262C;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transition: opacity 220ms cubic-bezier(0.4, 0, 0.2, 1);
}
.mq-overlay[hidden] { display: none !important; }
.mq-overlay.is-open { opacity: 1; }

body.mq-locked { overflow: hidden; }

/* ---- Header ---- */
.mq-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #ECEAE8;
  background: #FFFFFF;
}
.mq-logo { height: 28px; width: auto; }
.mq-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  border: 1px solid #ECEAE8;
  background: #FFFFFF;
  color: #1F262C;
  cursor: pointer;
  transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
              border-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
.mq-close:hover { background: #F7F6F5; border-color: #DFDCDA; }
.mq-close svg { width: 18px; height: 18px; }

/* ---- Progress bar ---- */
.mq-progress {
  height: 3px;
  background: #ECEAE8;
  position: relative;
  overflow: hidden;
}
.mq-progress-bar {
  position: absolute;
  inset: 0 auto 0 0;
  background: #E36326;
  width: 0%;
  transition: width 380ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Body ---- */
.mq-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 3rem 1.5rem 2rem;
  -webkit-overflow-scrolling: touch;
}
.mq-step {
  width: 100%;
  max-width: 640px;
  animation: mq-fade-in 360ms cubic-bezier(0.4, 0, 0.2, 1) both;
}
@keyframes mq-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.mq-step-counter {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #A69C97;
  margin: 0 0 1rem;
}
.mq-question {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: #0F1822;
  margin: 0 0 0.75rem;
}
.mq-helper {
  font-size: 1rem;
  line-height: 1.5;
  color: #6B635D;
  margin: 0 0 2rem;
}

@media (min-width: 768px) {
  .mq-body { padding: 4.5rem 2rem 2.5rem; }
  .mq-question { font-size: 2.25rem; }
}

/* ---- Inputs ---- */
.mq-fields {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2rem;
}
.mq-field { display: flex; flex-direction: column; }
.mq-field-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #1F262C;
  margin-bottom: 0.375rem;
}
.mq-field-label .mq-required { color: #E36326; margin-left: 2px; }
.mq-field-helper {
  font-size: 0.8125rem;
  color: #6B635D;
  margin: 0 0 0.5rem;
}

.mq-input {
  width: 100%;
  padding: 0.875rem 1rem;
  background: #FFFFFF;
  color: #1F262C;
  font-family: inherit;
  font-size: 1rem;
  border: 1px solid #ECEAE8;
  border-radius: 12px;
  transition: border-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-appearance: none;
  appearance: none;
}
.mq-input::placeholder { color: #A69C97; }
.mq-input:focus {
  outline: none;
  border-color: #E36326;
  box-shadow: 0 0 0 3px rgba(227, 99, 38, 0.15);
}
.mq-input[aria-invalid="true"] {
  border-color: #DC2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}
.mq-field-error {
  font-size: 0.75rem;
  color: #DC2626;
  margin-top: 0.375rem;
  display: none;
}
.mq-field-error.is-visible { display: block; }

/* ---- Select (dropdown nativo) ---- */
.mq-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B635D' 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 1rem center;
  background-size: 18px 18px;
  padding-right: 2.75rem;
  cursor: pointer;
}
.mq-select:invalid,
.mq-select option[value=""] { color: #A69C97; }
.mq-select option { color: #1F262C; }

/* ---- Pills (segmented control) ---- */
.mq-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.mq-pill {
  flex: 1 1 calc(50% - 0.25rem);
  padding: 0.75rem 1rem;
  background: #FFFFFF;
  color: #1F262C;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
  border: 1px solid #ECEAE8;
  border-radius: 9999px;
  cursor: pointer;
  transition: border-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
              background-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
              color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
.mq-pill:hover { border-color: #A69C97; }
.mq-pill:focus-visible {
  outline: none;
  border-color: #E36326;
  box-shadow: 0 0 0 3px rgba(227, 99, 38, 0.15);
}
.mq-pill.is-selected {
  background: #E36326;
  border-color: #E36326;
  color: #FFFFFF;
}
@media (min-width: 640px) {
  .mq-pill { flex: 1 1 auto; }
}

/* ---- Radio options (cards) ---- */
.mq-options {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-bottom: 1.5rem;
}
.mq-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: #FFFFFF;
  border: 1px solid #ECEAE8;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #1F262C;
  text-align: left;
  width: 100%;
  transition: border-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
              background-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
              transform 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
.mq-option:hover {
  border-color: #A69C97;
  background: #FFFFFF;
}
.mq-option:focus-visible {
  outline: none;
  border-color: #E36326;
  box-shadow: 0 0 0 3px rgba(227, 99, 38, 0.15);
}
.mq-option.is-selected {
  border-color: #E36326;
  background: rgba(227, 99, 38, 0.06);
}
.mq-option-check {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 9999px;
  border: 1.5px solid #DFDCDA;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 150ms, background-color 150ms;
}
.mq-option-check--multi { border-radius: 6px; } /* checkbox en preguntas multi-select */
.mq-option-check svg { width: 12px; height: 12px; color: #FFFFFF; opacity: 0; transition: opacity 120ms; }
.mq-option.is-selected .mq-option-check {
  border-color: #E36326;
  background: #E36326;
}
.mq-option.is-selected .mq-option-check svg { opacity: 1; }

/* ---- Footer / nav ---- */
.mq-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: #FFFFFF;
  border-top: 1px solid #ECEAE8;
}
@media (min-width: 768px) {
  .mq-footer { padding: 1.25rem 2rem; }
}

.mq-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: transparent;
  color: #6B635D;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  transition: color 150ms, background-color 150ms;
}
.mq-back:hover { color: #1F262C; background: #F7F6F5; }
.mq-back:disabled { opacity: 0; pointer-events: none; }
.mq-back svg { width: 16px; height: 16px; }

.mq-next {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  background: #E36326;
  color: #FFFFFF;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
.mq-next:hover { background: #C7521C; }
.mq-next:disabled { opacity: 0.45; cursor: not-allowed; }
.mq-next svg { width: 16px; height: 16px; }

/* ---- Loading / final step ---- */
.mq-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  text-align: center;
  padding: 2.5rem 0;
}
.mq-spinner {
  width: 48px;
  height: 48px;
  border-radius: 9999px;
  border: 3px solid #ECEAE8;
  border-top-color: #E36326;
  animation: mq-spin 800ms linear infinite;
}
@keyframes mq-spin { to { transform: rotate(360deg); } }
.mq-loading-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #0F1822;
}
.mq-loading-sub {
  font-size: 0.9375rem;
  color: #6B635D;
}

/* ============================================
   intl-tel-input · overrides para alinear con Mirlo
   ============================================ */
.iti { width: 100%; display: block; }
.iti--allow-dropdown .iti__country-container,
.iti--inline-dropdown .iti__country-container { padding: 0; }
.iti__selected-country {
  background: #FFFFFF;
  border: 1px solid #ECEAE8;
  border-right: 0;
  border-radius: 12px 0 0 12px;
  padding: 0 0.75rem;
}
.iti__selected-country:hover,
.iti__selected-country:focus { background: #FAFAFA; }
.iti--separate-dial-code .iti__selected-dial-code { color: #1F262C; font-weight: 500; }

/* Input dentro del wrapper iti: quitar el border-radius izquierdo */
.iti .mq-input {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  padding-left: 0.875rem;
}

/* Dropdown de países */
.iti__dropdown-content {
  border-radius: 12px;
  border: 1px solid #ECEAE8;
  box-shadow: 0 12px 32px rgba(15, 24, 34, 0.10);
  overflow: hidden;
  background: #FFFFFF;
  margin-top: 4px;
}
.iti__search-input {
  padding: 0.75rem 0.875rem;
  border-bottom: 1px solid #ECEAE8;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.875rem;
  background: #FAFAFA;
}
.iti__search-input:focus { outline: none; background: #FFFFFF; }
.iti__country-list { background: #FFFFFF; max-height: 260px; }
.iti__country {
  padding: 0.625rem 0.875rem;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.875rem;
  color: #1F262C;
}
.iti__country.iti__highlight { background: rgba(227, 99, 38, 0.08); }
.iti__country .iti__dial-code { color: #6B635D; }

/* Focus del wrapper: replicar el ring del input */
.iti:focus-within .mq-input,
.iti:focus-within .iti__selected-country {
  border-color: #E36326;
  box-shadow: 0 0 0 3px rgba(227, 99, 38, 0.15);
}
.iti:focus-within .iti__selected-country { box-shadow: -3px 0 0 0 rgba(227, 99, 38, 0.15); }


/* ---- Hint con `Enter` ---- */
.mq-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: #A69C97;
  margin-top: 0.75rem;
}
.mq-hint kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.6875rem;
  padding: 2px 6px;
  border: 1px solid #ECEAE8;
  border-radius: 4px;
  background: #FFFFFF;
}
