/*!
 * ImmoCloud — Lead capture popup
 * Adapted from 360.adcloudit.com/landing.css. Tokens resolved inline so it's
 * self-contained. Loads after theme CSS and only affects .adc-popup* nodes.
 */

.adc-popup {
  --adc-navy: #0F1B2D;
  --adc-navy-500: #3A4A60;
  --adc-slate: #5B6B82;
  --adc-slate-2: #A6B5C4;
  --adc-cloud: #C3D2DE;
  --adc-line: #E1E8F0;
  --adc-blue: #2FA8E0;
  --adc-blue-600: #1E88E5;
  --adc-blue-700: #1769BF;
  --adc-accent: #19D48B;
  --adc-font-display: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --adc-font-body: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --adc-font-mono: "SF Mono", ui-monospace, "Consolas", monospace;

  position: fixed;
  inset: 0;
  z-index: 999998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
  font-family: var(--adc-font-body);
}
.adc-popup[data-open="true"] { opacity: 1; pointer-events: auto; }
.adc-popup[hidden] { display: none; }

.adc-popup *,
.adc-popup *::before,
.adc-popup *::after { box-sizing: border-box; }

.adc-popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 14, 24, .55);
  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
}

.adc-popup-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  width: 100%;
  max-width: 920px;
  height: auto;
  max-height: min(calc(100vh - 48px), 700px);
  background: #ffffff;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 50px 120px -30px rgba(0, 0, 0, .45),
              0 0 0 1px rgba(15, 30, 50, .04);
  transform: translateY(20px) scale(.98);
  transition: transform .4s cubic-bezier(.2, .85, .3, 1.05);
}
.adc-popup-card > * { min-height: 0; }   /* critical: allow flex/grid children to shrink below content size */
.adc-popup[data-open="true"] .adc-popup-card { transform: translateY(0) scale(1); }

.adc-popup-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 5;
  width: 36px;
  height: 36px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .9);
  border: 1px solid var(--adc-line);
  color: var(--adc-navy);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background .2s, color .2s, transform .2s;
}
.adc-popup-close:hover {
  background: #ffffff;
  color: var(--adc-blue-600);
  transform: rotate(90deg);
}

/* Left decorative panel */
.adc-popup-aside {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, #0E1623 0%, #1A2638 55%, #1E2C40 100%);
  color: #ffffff;
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.adc-popup-aside-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 80% 10%, rgba(47, 168, 224, .30) 0%, transparent 55%),
    radial-gradient(circle at 20% 90%, rgba(25, 212, 139, .16) 0%, transparent 50%);
}
.adc-popup-aside-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 50%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse at 50% 50%, #000 30%, transparent 75%);
}
.adc-popup-aside-content { position: relative; }
.adc-popup-aside-tag {
  display: inline-block;
  font-family: var(--adc-font-mono);
  font-size: 10.5px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  font-weight: 500;
  padding: 6px 11px;
  border-radius: 6px;
  background: rgba(25, 212, 139, .16);
  color: #7CE0B0;
  margin-bottom: 24px;
}
.adc-popup-aside-title {
  font-family: var(--adc-font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.1;
  color: #ffffff;
  margin: 0 0 14px;
}
.adc-popup-aside-title span {
  background: linear-gradient(120deg, #5BC5F0, #2FA8E0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.adc-popup-aside-sub {
  font-size: 14px;
  color: var(--adc-cloud);
  line-height: 1.55;
  margin: 0 0 26px;
  font-weight: 400;
}
.adc-popup-aside-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.adc-popup-aside-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: #E8F5FC;
  font-weight: 500;
  letter-spacing: -.005em;
}
.adc-popup-aside-list svg {
  color: var(--adc-accent);
  flex: 0 0 auto;
  background: rgba(25, 212, 139, .16);
  border-radius: 99px;
  padding: 3px;
  width: 20px;
  height: 20px;
}
.adc-popup-aside-foot {
  position: relative;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.adc-popup-aside-num {
  font-family: var(--adc-font-display);
  font-size: 32px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -.035em;
  line-height: 1;
}
.adc-popup-aside-cap { font-size: 12px; color: var(--adc-slate-2); font-weight: 400; }

/* Right form panel — scrolls internally when content exceeds viewport */
.adc-popup-body {
  padding: 34px 34px 28px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
  max-height: 100%;
  display: flex;
  flex-direction: column;
}
.adc-popup-body .adc-popup-form,
.adc-popup-body .adc-popup-success { flex: 0 0 auto; }
/* leave a bit of breathing room at the bottom so the submit/legal isn't glued to the edge */
.adc-popup-body::after { content: ""; display: block; height: 4px; flex: 0 0 auto; }
.adc-popup-eyebrow {
  display: inline-block;
  font-family: var(--adc-font-mono);
  font-size: 10.5px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--adc-blue-600);
  font-weight: 600;
  margin-bottom: 14px;
}
.adc-popup-body h2 {
  font-family: var(--adc-font-display);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.03em;
  color: var(--adc-navy);
  margin: 0 0 10px;
}
.adc-popup-body h2 span { color: var(--adc-blue-600); font-weight: 700; }
.adc-popup-lead {
  font-size: 14px;
  color: var(--adc-navy-500);
  line-height: 1.6;
  margin: 0 0 22px;
  font-weight: 400;
}

.adc-popup-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.adc-popup-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.adc-popup-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.adc-popup-field label {
  font-family: var(--adc-font-display);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--adc-navy-500);
  text-transform: uppercase;
  letter-spacing: 1.2px;
}
.adc-popup-field input,
.adc-popup-field select {
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 400;
  color: var(--adc-navy);
  background: #F8FAFC;
  border: 1px solid var(--adc-line);
  padding: 12px 14px;
  border-radius: 11px;
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
  width: 100%;
  line-height: 1.4;
}
.adc-popup-field input::placeholder { color: #A6B5C4; font-weight: 400; }
.adc-popup-field input:focus,
.adc-popup-field select:focus {
  border-color: var(--adc-blue);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(47, 168, 224, .14);
}
.adc-popup-field input:invalid:not(:placeholder-shown):not(:focus) {
  border-color: #E8B4B4;
  background: #FDF6F6;
}
.adc-popup-field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%233A4A60' stroke-width='1.5'><path d='M3 4.5L6 7.5 9 4.5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px;
  padding-right: 38px;
  cursor: pointer;
}

.adc-popup-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
  width: 100%;
  padding: 14px 22px;
  background: linear-gradient(135deg, #1E88E5 0%, #2FA8E0 55%, #13B6A6 100%);
  background-size: 200% 100%;
  background-position: 0% 50%;
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .01em;
  cursor: pointer;
  box-shadow: 0 10px 28px -12px rgba(30, 136, 229, .55),
              inset 0 1px 0 rgba(255, 255, 255, .18);
  transition: background-position .35s ease, transform .18s ease, box-shadow .18s ease;
}
.adc-popup-submit:hover {
  background-position: 100% 50%;
  transform: translateY(-1px);
  box-shadow: 0 14px 34px -10px rgba(30, 136, 229, .7),
              inset 0 1px 0 rgba(255, 255, 255, .22);
}
.adc-popup-submit:disabled { opacity: .65; cursor: wait; transform: none; }

.adc-popup-legal {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--adc-slate);
  font-weight: 400;
  margin: 10px 0 0;
  line-height: 1.4;
}
.adc-popup-legal svg { color: var(--adc-slate-2); flex: 0 0 auto; }

/* Success state */
.adc-popup-success {
  text-align: center;
  padding: 24px 0;
}
.adc-popup-success[hidden] { display: none; }
.adc-popup-success-ic {
  width: 64px;
  height: 64px;
  border-radius: 99px;
  background: rgba(25, 212, 139, .14);
  color: #0E9B61;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}
.adc-popup-success h3 {
  font-family: var(--adc-font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--adc-navy);
  letter-spacing: -.02em;
  margin: 0 0 10px;
}
.adc-popup-success p {
  color: var(--adc-navy-500);
  font-size: 14.5px;
  line-height: 1.6;
  font-weight: 400;
  margin: 0 0 22px;
}
.adc-popup-success strong { color: var(--adc-navy); font-weight: 700; }
.adc-popup-success-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  background: transparent;
  color: var(--adc-navy);
  border: 1px solid var(--adc-line);
  border-radius: 11px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease;
  margin: 0 auto;
}
.adc-popup-success-close:hover {
  background: #F8FAFC;
  border-color: var(--adc-blue);
}

/* Mobile */
@media (max-width: 720px) {
  /* Align to top so long forms scroll from the top instead of being clipped
     when vertically centered on a short screen. */
  .adc-popup { padding: 10px; align-items: flex-start; overflow-y: auto; }
  .adc-popup-card {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;                 /* let the overlay scroll, card grows */
    overflow: visible;
    border-radius: 18px;
    margin: 6px 0;
  }
  .adc-popup-card > * { min-height: 0; }
  .adc-popup-aside { display: none; }
  /* Body must NOT create its own nested scroll on mobile — that was cutting
     off the submit button + legal line. Let it flow inside the scrolling overlay. */
  .adc-popup-body {
    padding: 30px 20px 26px;
    overflow: visible !important;
    max-height: none !important;
    display: block !important;
  }
  .adc-popup-body h2 { font-size: 23px; }
  .adc-popup-row { grid-template-columns: 1fr; }
  .adc-popup-close { top: 10px; right: 10px; }
}
/* Very short / landscape phones — keep the close button reachable */
@media (max-width: 720px) and (max-height: 640px) {
  .adc-popup { align-items: flex-start; }
}
