/* ─────────────────────────────────────────────────────────────
   Modal Consult — 3-step in-home consultation popup
   Polished design with progress indicators, transitions, and
   responsive bottom-sheet treatment on mobile.
   ───────────────────────────────────────────────────────────── */
:root { --mc-z: 1200; }

/* Overlay container */
#modal-consult {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: var(--mc-z);
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, sans-serif;
  padding: 24px;
}
#modal-consult.open { display: flex; }

.mc-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 27, 42, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  animation: mc-fade-in .25s ease forwards;
}

@keyframes mc-fade-in {
  to { opacity: 1; }
}

/* Panel */
.mc-panel {
  position: relative;
  z-index: calc(var(--mc-z) + 1);
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  background: var(--white);
  color: var(--text);
  box-shadow: 0 40px 100px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 106, 0, .15);
  transform: translateY(20px) scale(.97);
  opacity: 0;
  animation: mc-panel-in .35s cubic-bezier(.2, .8, .2, 1) .05s forwards;
}

@keyframes mc-panel-in {
  to { transform: none; opacity: 1; }
}

/* Close button */
.mc-close {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 36px;
  height: 36px;
  background: rgba(0, 0, 0, .04);
  border: 0;
  border-radius: 999px;
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: all .18s ease;
}
.mc-close:hover {
  background: var(--orange);
  color: var(--white);
  transform: rotate(90deg);
}

/* Header — navy band with logo and title */
.mc-header {
  background: var(--navy);
  color: var(--white);
  padding: 28px 28px 24px;
  display: flex;
  gap: 16px;
  align-items: center;
  border-bottom: 3px solid var(--orange);
  position: relative;
  overflow: hidden;
}
.mc-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255, 106, 0, .15), transparent 60%);
  pointer-events: none;
}
.mc-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  position: relative;
}
.mc-header > div { position: relative; }
.mc-header h3 {
  margin: 0;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--white);
  text-transform: none;
  line-height: 1.3;
}
.mc-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: rgba(255, 255, 255, .65);
  line-height: 1.4;
}

/* Step indicators — numbered circles connected by a progress line */
.mc-steps {
  padding: 28px;
  overflow-y: auto;
  flex: 1;
}
.mc-step-indicators {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin: 0 0 28px;
  position: relative;
  padding: 0 8px;
}
.mc-step-indicators::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 8%;
  right: 8%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}
.mc-step-indicators::after {
  content: '';
  position: absolute;
  top: 18px;
  left: 8%;
  height: 2px;
  background: var(--orange);
  z-index: 1;
  width: 0%;
  transition: width .35s cubic-bezier(.2, .8, .2, 1);
}
.mc-step-indicators[data-progress="1"]::after { width: 0%; }
.mc-step-indicators[data-progress="2"]::after { width: 42%; }
.mc-step-indicators[data-progress="3"]::after { width: 84%; }

.mc-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  position: relative;
  z-index: 2;
  flex: 1;
  background: none;
  border: none;
  padding: 0;
}
.mc-step-circle {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--white);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--muted);
  transition: all .25s ease;
}
.mc-step-circle svg { display: none; }
.mc-step-label {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color .25s ease;
  white-space: nowrap;
}
.mc-step.mc-step-active .mc-step-circle {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--white);
  box-shadow: 0 0 0 4px rgba(255, 106, 0, .18);
}
.mc-step.mc-step-active .mc-step-label { color: var(--navy); }
.mc-step.mc-step-done .mc-step-circle {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--white);
}
.mc-step.mc-step-done .mc-step-circle .mc-step-num { display: none; }
.mc-step.mc-step-done .mc-step-circle svg { display: block; color: var(--white); }
.mc-step.mc-step-done .mc-step-label { color: var(--navy); }

/* Step content panels */
.mc-step-content {
  animation: mc-step-in .3s cubic-bezier(.2, .8, .2, 1);
}
.mc-step-content[hidden] { display: none !important; }

@keyframes mc-step-in {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: none; }
}
.mc-form.is-going-back .mc-step-content {
  animation-name: mc-step-in-back;
}
@keyframes mc-step-in-back {
  from { opacity: 0; transform: translateX(-16px); }
  to   { opacity: 1; transform: none; }
}

/* Form fields */
.mc-field {
  margin-bottom: 14px;
}
.mc-field-label {
  display: block;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.mc-step-content input,
.mc-step-content select,
.mc-step-content textarea {
  width: 100%;
  padding: 13px 16px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  transition: all .18s ease;
}
.mc-step-content input::placeholder,
.mc-step-content textarea::placeholder { color: #aaa; }
.mc-step-content input:focus,
.mc-step-content select:focus,
.mc-step-content textarea:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(255, 106, 0, .12);
}
.mc-step-content select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%23999' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><polyline points='1 1 6 6 11 1'/></svg>");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 12px;
  padding-right: 40px;
  cursor: pointer;
}
.mc-step-content textarea { min-height: 96px; resize: vertical; }

/* ───── Custom icon dropdown (renovation type picker) ───── */
.mc-iselect {
  position: relative;
}
.mc-iselect-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 10px 12px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
  transition: all .18s ease;
  min-height: 54px;
}
.mc-iselect-trigger:hover { border-color: var(--navy); }
.mc-iselect.is-open .mc-iselect-trigger,
.mc-iselect-trigger:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(255, 106, 0, .12);
}
.mc-iselect-current {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.mc-iselect-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}
.mc-iselect-text {
  font-weight: 600;
  color: var(--text);
  text-align: left;
}
.mc-iselect-placeholder {
  color: #aaa;
  padding-left: 4px;
}
.mc-iselect-chevron {
  color: var(--muted);
  transition: transform .2s ease;
  flex-shrink: 0;
  margin-left: 12px;
}
.mc-iselect.is-open .mc-iselect-chevron { transform: rotate(180deg); }

.mc-iselect-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 10;
  list-style: none;
  margin: 0;
  padding: 6px;
  border-radius: 10px;
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .18);
  max-height: 280px;
  overflow-y: auto;
  animation: mc-iselect-pop .18s cubic-bezier(.2, .8, .2, 1);
}
.mc-iselect-list[hidden] { display: none !important; }

@keyframes mc-iselect-pop {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

.mc-iselect-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 7px;
  cursor: pointer;
  transition: background .12s ease;
}
.mc-iselect-list li img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}
.mc-iselect-list li span {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}
.mc-iselect-list li.is-highlighted,
.mc-iselect-list li:hover {
  background: rgba(255, 106, 0, .08);
}
.mc-iselect-list li.is-selected {
  background: rgba(255, 106, 0, .12);
}
.mc-iselect-list li.is-selected span {
  color: var(--navy);
}

@media (max-width: 600px) {
  .mc-iselect-icon { width: 28px; height: 28px; }
  .mc-iselect-list li img { width: 32px; height: 32px; }
  .mc-iselect-list li span { font-size: 13px; }
}

/* Action buttons */
.mc-actions {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.mc-btn[hidden] {
  display: none !important;
}
.mc-btn {
  cursor: pointer;
  border-radius: 8px;
  padding: 13px 22px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 2px solid transparent;
  transition: all .18s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.mc-btn:disabled { opacity: .5; cursor: not-allowed; }
.mc-back {
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
}
.mc-back:hover:not(:disabled) {
  color: var(--navy);
  border-color: var(--navy);
}
.mc-next,
.mc-submit {
  background: var(--orange);
  color: var(--white);
  border-color: var(--orange);
  margin-left: auto;
}
.mc-next:hover:not(:disabled),
.mc-submit:hover:not(:disabled) {
  background: var(--orange-hover);
  border-color: var(--orange-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(255, 106, 0, .35);
}

/* Thanks screen */
.mc-thanks {
  text-align: center;
  padding: 48px 28px;
  animation: mc-step-in .35s cubic-bezier(.2, .8, .2, 1);
}
.mc-thanks-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  border-radius: 999px;
  background: var(--orange);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  animation: mc-pop .4s cubic-bezier(.2, 1.4, .5, 1);
}
@keyframes mc-pop {
  from { transform: scale(.4); opacity: 0; }
  to   { transform: scale(1);  opacity: 1; }
}
.mc-thanks h4 {
  margin: 0 0 8px;
  font-family: 'Montserrat', sans-serif;
  font-size: 22px;
  color: var(--navy);
  text-transform: none;
  letter-spacing: -0.01em;
}
.mc-thanks p {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 15px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .mc-backdrop,
  .mc-panel,
  .mc-step-content,
  .mc-thanks,
  .mc-thanks-icon { animation: none; opacity: 1; transform: none; }
  .mc-step-indicators::after { transition: none; }
}

/* Mobile — bottom-sheet style */
@media (max-width: 600px) {
  #modal-consult { padding: 0; align-items: flex-end; }
  .mc-panel {
    width: 100%;
    max-height: 92vh;
    border-radius: 16px 16px 0 0;
    transform: translateY(40px);
  }
  @keyframes mc-panel-in {
    to { transform: none; opacity: 1; }
  }
  .mc-header { padding: 22px 22px 20px; }
  .mc-header h3 { font-size: 16px; }
  .mc-steps { padding: 22px; }
  .mc-step-circle { width: 32px; height: 32px; font-size: 13px; }
  .mc-step-indicators::before,
  .mc-step-indicators::after { top: 15px; }
  .mc-step-label { font-size: 10px; }
  .mc-actions { flex-wrap: wrap; }
  .mc-btn { padding: 12px 18px; font-size: 12px; }
  .mc-back { order: 2; }
  .mc-next, .mc-submit { order: 1; width: 100%; justify-content: center; }
}
