.lead-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  font-family: Inter, system-ui, sans-serif;
}

.lead-modal.is-open {
  display: flex;
}

.lead-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 20, 0.65);
  /* color-mix reads the live theme token; browsers without it keep the rgba fallback above */
  background: color-mix(in oklch, var(--ink, #1a1f35) 65%, transparent);
  backdrop-filter: blur(8px);
}

.lead-modal__phone-wrap {
  position: relative;
  width: 100%;
  max-width: 380px;
  animation: lead-modal-in 0.3s ease-out;
}

@keyframes lead-modal-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.lead-modal__close {
  position: absolute;
  top: -14px;
  right: -14px;
  z-index: 2;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 999px;
  background: #fff;
  color: #16182a;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 25px -8px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s ease;
}

.lead-modal__close:hover {
  transform: scale(1.08);
}

.lead-modal__phone {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 17;
  max-height: calc(100vh - 2rem);
  border-radius: 3rem;
  background: var(--ink, #1a1f35);
  padding: 10px;
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.55);
  box-sizing: border-box;
}

.lead-modal__speaker {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 7rem;
  height: 1.5rem;
  background: #000;
  border-radius: 999px;
  z-index: 1;
}

.lead-modal__screen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  border-radius: 2.4rem;
  background: linear-gradient(165deg, #eaf4ff 0%, #dbeafe 55%, #e4edff 100%);
  padding: 1.5rem 1.5rem 1.25rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.lead-modal__form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding-top: 1.5rem;
}

.lead-modal__icon {
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 0.75rem;
  border-radius: 1rem;
  background: var(
    --gradient-brand,
    linear-gradient(135deg, #2f6fdb 0%, #5aa8ec 100%)
  );
  display: grid;
  place-items: center;
  box-shadow: 0 10px 25px -8px rgba(47, 111, 219, 0.55);
}

.lead-modal__title {
  margin: 0 0 0.25rem;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 800;
  color: #14162a;
}

.lead-modal__subtitle {
  margin: 0 0 1.25rem;
  text-align: center;
  font-size: 0.75rem;
  color: #5b6577;
}

.lead-modal__fields {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.lead-modal__field label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5b6577;
}

.lead-modal__field input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.4rem 0.7rem;
  border-radius: 0.75rem;
  border: 1px solid #d9e3f5;
  background: #fff;
  color: #14162a;
  font-size: 0.9rem;
}

.lead-modal__field input:focus {
  outline: none;
  border-color: var(--primary, #2f6fdb);
  box-shadow: 0 0 0 3px rgba(47, 111, 219, 0.2);
}

.lead-modal__submit {
  margin-top: 1.1rem;
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 1rem;
  background: var(
    --gradient-brand,
    linear-gradient(135deg, #2f6fdb 0%, #5aa8ec 100%)
  );
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.lead-modal__submit:hover {
  transform: scale(1.02);
}

.lead-modal__home-bar {
  margin: 0.75rem auto 0;
  width: 6rem;
  height: 0.25rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.lead-modal__success {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.5rem;
  padding-top: 1.5rem;
}

.lead-modal__success-icon {
  width: 4rem;
  height: 4rem;
  margin-bottom: 0.5rem;
  border-radius: 999px;
  background: var(
    --gradient-brand,
    linear-gradient(135deg, #2f6fdb 0%, #5aa8ec 100%)
  );
  display: grid;
  place-items: center;
  box-shadow: 0 10px 25px -8px rgba(47, 111, 219, 0.55);
}

.lead-modal__success h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  color: #14162a;
}

.lead-modal__success p {
  margin: 0;
  font-size: 0.85rem;
  color: #5b6577;
  max-width: 22rem;
}

@media (max-width: 420px) {
  .lead-modal__phone-wrap {
    max-width: 320px;
  }
}

@media (min-width: 1024px) {
  .lead-modal__field input {
    padding: 0.6rem 0.8rem;
  }
}

/* Custom EU phone selector: always visible, no third-party UI dependency */
.eu-phone {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;
  min-height: 38px;
  border: 1px solid #d9e3f5;
  border-radius: 0.75rem;
  background: #fff;
  box-sizing: border-box;
  overflow: visible;
}

.eu-phone:focus-within {
  border-color: var(--primary, #2f6fdb);
  box-shadow: 0 0 0 3px rgba(47, 111, 219, 0.2);
}

.lead-modal__field .eu-phone > input[name="phone"] {
  flex: 1;
  min-width: 0;
  width: auto;
  border: 0 !important;
  border-radius: 0 0.75rem 0.75rem 0;
  padding: 0.4rem 0.55rem;
  box-shadow: none !important;
}

.eu-phone__selector {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  border: 0;
  border-right: 1px solid #e2e8f0;
  border-radius: 0.75rem 0 0 0.75rem;
  background: #f8fafc;
  color: #0f172a;
  cursor: pointer;
  font: inherit;
  white-space: nowrap;
}

.eu-phone__current {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.eu-phone__flag {
  font-size: 18px;
  line-height: 1;
}

.eu-phone__code {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  color: #1e293b;
}

.eu-phone__dial {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
}

.eu-phone__arrow {
  font-size: 10px;
  color: #64748b;
  transform: translateY(-1px);
}

.eu-phone__dropdown {
  position: absolute;
  left: 0;
  bottom: calc(100% + 6px);
  z-index: 10050;
  width: min(330px, calc(100vw - 58px));
  max-height: 230px;
  overflow: auto;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .22);
  padding: 5px;
}

.eu-phone__dropdown[hidden] { display: none !important; }

.eu-phone__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.eu-phone__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 8px 9px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #0f172a;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.eu-phone__option:hover,
.eu-phone__option:focus {
  outline: none;
  background: #eff6ff;
}

.eu-phone__option-main,
.eu-phone__option-meta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.eu-phone__name {
  font-size: 13px;
  font-weight: 600;
}

.eu-phone__short {
  min-width: 22px;
  font-size: 11px;
  font-weight: 800;
  color: #334155;
}

.eu-phone__option-dial {
  font-size: 12px;
  color: #64748b;
}

.form_field.error .eu-phone {
  border-color: red !important;
}

.form_field.success .eu-phone {
  border-color: green !important;
}

@media (max-width: 420px) {
  .eu-phone__selector { padding: 0 6px; gap: 3px; }
  .eu-phone__current { gap: 4px; }
  .eu-phone__flag { font-size: 17px; }
  .eu-phone__code, .eu-phone__dial { font-size: 10px; }
  .eu-phone__dropdown { width: min(300px, calc(100vw - 52px)); }
}

/* Form validation styles retained from legacy phone stylesheet */
.form_field small{display:block;text-align:left;height:20px;color:red;margin-block:5px}
.form_field input{outline:none}
.form_field.error input[type="text"],.form_field.error input[type="email"],.form_field.error input[name="phone"]{border:1px solid red!important}
.form_field.success input[type="text"],.form_field.success input[type="email"],.form_field.success input[name="phone"]{border:1px solid green!important}
