/*
 * RMC Virtual Tour Intake — Modal Styles
 * Scoped under #rmc-vt-popup-rfi-overlay.
 * Fonts (Roboto, Roboto Slab) are loaded separately via wp_enqueue_style.
 */

:root {
  --rfi-gold: #ffcf00;
  --rfi-gold-dark: #d4a900;
  --rfi-black: #111111;
  --rfi-text: #1e1e1e;
  --rfi-muted: #666666;
  --rfi-line: #d9d9d9;
  --rfi-ease: 260ms cubic-bezier(.2,.7,.2,1);
}

#rmc-vt-popup-rfi-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.64);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  font-family: "Roboto", Arial, sans-serif;
}

#rmc-vt-popup-rfi-modal {
  width: min(980px, 100%);
  height: fit-content;           /* gives the grid a definite height so fr units & overflow work */
  min-height: 620px;
  max-height: calc(100vh - 56px);
  background: #ffffff;
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.28);
  display: grid;
  grid-template-columns: minmax(440px,48%) minmax(0,52%);
  grid-template-rows: minmax(0, 1fr); /* single row fills the definite container height */
  position: relative;
}

.rmc-vt-popup-rfi-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  border: 0;
  background: transparent;
  color: #ffffff;
  border-radius: 0;
  cursor: pointer;
  z-index: 10;
  transition: background var(--rfi-ease);
}
.rmc-vt-popup-rfi-close:hover { background: rgba(255,255,255,0.15); }
.rmc-vt-popup-rfi-close::before,
.rmc-vt-popup-rfi-close::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 22px; height: 2px;
  background: currentColor;
  transform-origin: center;
}
.rmc-vt-popup-rfi-close::before { transform: translate(-50%,-50%) rotate(45deg); }
.rmc-vt-popup-rfi-close::after  { transform: translate(-50%,-50%) rotate(-45deg); }

.rmc-vt-popup-rfi-form-pane {
  background: #ffffff;
  padding: 42px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;   /* allow grid item to shrink below intrinsic content height */
  position: relative;
  overflow: hidden;
}

.rmc-vt-popup-rfi-media-pane {
  position: relative;
  background: #dfe8ef;
  min-width: 0;
  min-height: 0;   /* allow grid item to shrink to the row's definite height */
}

.rmc-vt-popup-rfi-iframe {
  width: 100%; height: 100%;
  border: 0; display: block;
}

.rmc-vt-popup-rfi-step-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.rmc-vt-popup-rfi-step-label {
  font-size: 13px;
  font-weight: 700;
  color: #b17f00;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.rmc-vt-popup-rfi-stepper { display: inline-flex; align-items: center; gap: 8px; }

.rmc-vt-popup-rfi-step-circle {
  width: 32px; height: 32px;
  border-radius: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700;
  border: 1px solid #dadada;
  background: #efefef; color: #666;
  transition: all var(--rfi-ease);
}
.rmc-vt-popup-rfi-step-circle.is-active  { background: var(--rfi-gold); border-color: var(--rfi-gold-dark); color: var(--rfi-black); }
.rmc-vt-popup-rfi-step-circle.is-complete { background: #fff; border-color: #bfbfbf; color: var(--rfi-black); }

.rmc-vt-popup-rfi-step-line {
  width: 48px; height: 2px;
  background: #d7d7d7;
  position: relative; overflow: hidden;
}
.rmc-vt-popup-rfi-step-line-fill {
  position: absolute; inset: 0 auto 0 0;
  width: 0; background: var(--rfi-gold);
  transition: width var(--rfi-ease);
}
.rmc-vt-popup-rfi-step-line.is-complete .rmc-vt-popup-rfi-step-line-fill { width: 100%; }

.rmc-vt-popup-rfi-stage-viewport {
  position: relative;
  flex: 1;
  min-height: 0;    /* flex item can shrink below intrinsic size — required for scroll to trigger */
  display: block;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.18) transparent;
}

.rmc-vt-popup-rfi-stage {
  position: absolute; inset: 0;
  display: none; /* fully inactive stages are out of layout — prevents their content from bleeding into stage-viewport scroll area */
  opacity: 0; visibility: hidden;
  transform: translateX(18px);
  transition: opacity var(--rfi-ease), transform var(--rfi-ease), visibility 0s linear var(--rfi-ease);
  pointer-events: none;
  flex-direction: column;
  min-height: 100%;
}
.rmc-vt-popup-rfi-stage.is-active {
  display: flex;
  opacity: 1; visibility: visible;
  transform: translateX(0);
  transition: opacity var(--rfi-ease), transform var(--rfi-ease), visibility 0s linear 0s;
  pointer-events: auto;
  position: relative;
  min-height: 0;  /* override base min-height:100% — active stage should be content height only */
}
.rmc-vt-popup-rfi-stage.is-leaving {
  display: flex; /* visible during exit animation */
  opacity: 0; transform: translateX(-18px); visibility: visible;
}

.rmc-vt-popup-rfi-title {
  margin: 0 0 14px;
  font-family: "Roboto Slab", Georgia, serif;
  font-size: clamp(1.8rem, 2.2vw, 2.4rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--rfi-black);
}

.rmc-vt-popup-rfi-copy {
  margin: 0 0 22px;
  color: #444;
  font-size: 16px;
  line-height: 1.5;
}

.rmc-vt-popup-rfi-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.rmc-vt-popup-rfi-form-group { margin-bottom: 16px; }
.rmc-vt-popup-rfi-form-group-half { max-width: 240px; }

.rmc-vt-popup-rfi-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #232323;
  margin-bottom: 6px;
}
.rmc-vt-popup-rfi-label-large { font-size: 17px; }

.rmc-vt-popup-rfi-help { margin: 0 0 12px; font-size: 14px; color: #555; line-height: 1.4; }

.rmc-vt-popup-rfi-req { color: #cc2222; }
.rmc-vt-popup-rfi-opt { font-weight: 400; letter-spacing: 0; color: #888888; font-size: 11px; }

.rmc-vt-popup-rfi-field,
.rmc-vt-popup-rfi-select {
  width: 100%;
  height: 44px;
  border: 1px solid #cfcfcf;
  border-radius: 0;
  background: #fff;
  color: var(--rfi-text);
  font-family: "Roboto", Arial, sans-serif;
  font-size: 14px;
  padding: 0 14px;
  box-sizing: border-box;
  appearance: none; -webkit-appearance: none;
  transition: border-color var(--rfi-ease), box-shadow var(--rfi-ease);
}
.rmc-vt-popup-rfi-field::placeholder { color: #8a8a8a; }
.rmc-vt-popup-rfi-field:focus,
.rmc-vt-popup-rfi-select:focus {
  outline: none;
  border-color: var(--rfi-gold-dark);
  box-shadow: 0 0 0 3px rgba(255,207,0,0.28);
}
.rmc-vt-popup-rfi-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23555' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.rmc-vt-popup-rfi-field.rmc-vt-popup-rfi-invalid { border-color: #cc2222; }
.rmc-vt-popup-rfi-field.rmc-vt-popup-rfi-valid   { border-color: #2a6611; }

.rmc-vt-popup-rfi-errmsg {
  display: none;
  font-size: 12px;
  color: #cc2222;
  margin-top: 4px;
  line-height: 1.4;
}
.rmc-vt-popup-rfi-errmsg.rmc-vt-popup-rfi-show { display: block; }

.rmc-vt-popup-rfi-interest-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.rmc-vt-popup-rfi-interest {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px;
  border: 2px solid var(--rfi-black);
  border-radius: 0;
  background: #ffffff;
  color: var(--rfi-black);
  cursor: pointer;
  font-family: "Roboto", Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  transition: background var(--rfi-ease), color var(--rfi-ease), transform var(--rfi-ease);
  width: 100%;
}
.rmc-vt-popup-rfi-interest:hover { transform: translateY(-1px); background: var(--rfi-gold); }
.rmc-vt-popup-rfi-interest.is-selected {
  background: var(--rfi-gold);
  border-color: var(--rfi-gold-dark);
  box-shadow: 0 6px 16px rgba(255,207,0,0.28);
}

.rmc-vt-popup-rfi-ico svg,
.rmc-vt-popup-rfi-ico img {
  width: 15px; height: 15px;
  display: block; flex-shrink: 0;
}
.rmc-vt-popup-rfi-ico svg {
  stroke: var(--rfi-black);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.rmc-vt-popup-rfi-ico img {
  object-fit: contain;
}

.rmc-vt-popup-rfi-interest-text { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.rmc-vt-popup-rfi-actions { margin-top: auto; padding-top: 16px; }

.rmc-vt-popup-rfi-btn {
  width: 100%;
  height: 50px;
  border: 0;
  border-radius: 0;
  background: var(--rfi-gold);
  color: var(--rfi-black);
  font-family: "Roboto", Arial, sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform var(--rfi-ease), box-shadow var(--rfi-ease);
}
.rmc-vt-popup-rfi-btn:hover, .rmc-vt-popup-rfi-btn:focus { transform: translateY(-2px);  border: 1px solid #6e5800;  /* box-shadow: 0 12px 28px rgba(255,207,0,0.45); */}
.rmc-vt-popup-rfi-btn:active { transform: translateY(0); box-shadow: none; }
.rmc-vt-popup-rfi-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.rmc-vt-popup-rfi-btn:disabled { background: #cccccc; color: #888888; cursor: default; transform: none; box-shadow: none; }
@media (prefers-reduced-motion: reduce) { .rmc-vt-popup-rfi-btn { transition: none; } }

.rmc-vt-popup-rfi-skip-link {
  display: block;
  margin-top: 14px;
  text-align: center;
  color: #444;
  font-size: 14px;
  text-underline-offset: 2px;
  cursor: pointer;
}
.rmc-vt-popup-rfi-skip-link:hover { text-decoration: underline; color: var(--rfi-black); }

.rmc-vt-popup-rfi-note {
  margin-top: 8px;
  font-size: 12px;
  color: #cc2222;
  text-align: center;
  min-height: 16px;
}

.rmc-vt-popup-rfi-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  font-family: "Roboto", Arial, sans-serif;
  font-size: 15px;
  color: var(--rfi-black);
  cursor: pointer;
  padding: 0;
  margin-bottom: 20px;
}
.rmc-vt-popup-rfi-back:hover { text-decoration: underline; }
.rmc-vt-popup-rfi-back-arrow { font-size: 22px; line-height: 1; }

@media (max-width: 960px) {
  #rmc-vt-popup-rfi-overlay { padding: 16px; }
  #rmc-vt-popup-rfi-modal { grid-template-columns: 1fr; grid-template-rows: auto; height: auto; min-height: unset; max-height: min(92vh,920px); overflow-y: auto; }
  .rmc-vt-popup-rfi-media-pane { order: -1; min-height: 220px; }
  .rmc-vt-popup-rfi-form-pane { padding: 28px 24px 30px; }
  .rmc-vt-popup-rfi-close { color: rgba(255,255,255,0.8); }
}

@media (max-height: 780px) and (min-width: 961px) {
  #rmc-vt-popup-rfi-overlay { padding: 16px; }
  #rmc-vt-popup-rfi-modal {
    max-height: calc(100vh - 32px);
    min-height: unset;
  }
  .rmc-vt-popup-rfi-form-pane { padding: 28px 32px 28px; }
}

@media (max-width: 640px) {
  .rmc-vt-popup-rfi-row,
  .rmc-vt-popup-rfi-interest-grid { grid-template-columns: 1fr; }
  .rmc-vt-popup-rfi-title { font-size: 1.75rem; }
}

/* Pano hint — panorama cue icon centered above the tour iframe */
@keyframes rmc-pano-pulse {
  0%, 100% { transform: scale(1);     opacity: 0.82; }
  50%       { transform: scale(1.07); opacity: 1;    }
}

.rmc-vt-popup-rfi-pano-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;  /* never intercepts clicks/taps to the iframe behind it */
  z-index: 2;
  transition: opacity 0.6s ease;
}
.rmc-vt-popup-rfi-pano-hint.is-hidden { opacity: 0; }
.rmc-vt-popup-rfi-pano-hint img {
  display: block;
  /* Scales with viewport: small on mobile, capped on large screens */
  width: clamp(56px, 7vw, 96px);
  height: auto;
  animation: rmc-pano-pulse 2.8s ease-in-out infinite;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.35));
  user-select: none;
  -webkit-user-drag: none;
}
.rmc-vt-popup-rfi-pano-hint.is-hidden img { animation-play-state: paused; }
