/**
 * LD Loop messenger-gate form — compact mobile-first modal form (.ld-loop-form).
 */

.ld-loop-form [hidden] {
  display: none !important;
}

.ld-loop-form {
  position: relative;
  box-sizing: border-box;
  max-width: 100%;
  width: 100%;
  max-height: calc(100vh - 120px);
  margin: 0;
  padding: 4px 12px 8px 4px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ld-loop-form.ld-loop-form--local {
  max-height: calc(100vh - 100px);
  gap: 4px;
  padding-top: 2px;
}

.ld-loop-form.ld-loop-form--international {
  /* default spacing from .ld-loop-form */
}

.ld-loop-form *,
.ld-loop-form *::before,
.ld-loop-form *::after {
  box-sizing: border-box;
}

.ld-loop-form .ld-loop-form__title {
  margin: 0 0 4px;
  font-size: clamp(1rem, 3vw, 1.2rem);
  font-weight: 600;
  line-height: 1.25;
  color: #2e396e;
}

.ld-loop-form .ld-loop-form__field {
  margin: 0;
}

.ld-loop-form__field--local-time {
  padding: 6px 0;
}

.ld-loop-form__field--turnstile {
  margin: 0;
  padding: 4px 0 2px;
}

.ld-loop-form__turnstile {
  width: 100%;
  max-width: 100%;
  min-height: 65px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.ld-loop-form__turnstile iframe {
  max-width: 100% !important;
}


.ld-loop-form .ld-loop-form__label {
  display: block;
  margin-bottom: 3px;
  font-weight: 600;
  font-size: 14px;
  color: #2f396e;
}

.ld-loop-form__field--local-time .ld-loop-form__label {
  font-size: 13px;
  color: #5a6487;
  margin-bottom: 4px;
}

.ld-loop-form .ld-loop-form__req {
  color: #e04545;
  font-weight: 600;
}

.ld-loop-form .ld-loop-form__input,
.ld-loop-form .ld-loop-form__select {
  width: 100%;
  max-width: 100%;
  min-height: 40px;
  padding: 7px 10px;
  font-size: 16px;
  line-height: 1.25;
  color: #1d2327;
  border: 1px solid #c8ced8;
  border-radius: 8px;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

.ld-loop-form .ld-loop-form__select {
  background-image: linear-gradient(45deg, transparent 50%, #8892bf 50%),
    linear-gradient(135deg, #8892bf 50%, transparent 50%);
  background-position: calc(100% - 14px) calc(50% + 2px), calc(100% - 9px) calc(50% + 2px);
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
  padding-right: 28px;
}

.ld-loop-form .ld-loop-form__input:hover:not(:disabled),
.ld-loop-form .ld-loop-form__select:hover:not(:disabled) {
  border-color: #a8b2cc;
}

.ld-loop-form .ld-loop-form__input:focus,
.ld-loop-form .ld-loop-form__select:focus {
  border-color: #2f396e;
  box-shadow: 0 0 0 2px rgba(47, 57, 110, 0.18);
  outline: none;
}

.ld-loop-form .ld-loop-form__input:disabled,
.ld-loop-form .ld-loop-form__select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: #f0f2f7;
}

.ld-loop-form .ld-loop-form__local-time {
  display: block;
  width: 100%;
  padding: 6px 8px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
  color: #3d4a73;
  background: #eef1f8;
  border: 1px solid #dde3ef;
  border-radius: 8px;
}

.ld-loop-form .ld-loop-form__consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
}

.ld-loop-form .ld-loop-form__consent span {
  font-size: 14px;
  font-weight: 500;
  color: #2f396e;
  line-height: 1.4;
}

.ld-loop-form .ld-loop-form__consent input[type="checkbox"] {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  border: 2px solid #2f396e;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.ld-loop-form .ld-loop-form__consent input[type="checkbox"]:checked {
  background-color: #2f396e;
  border-color: #2f396e;
  box-shadow: inset 0 0 0 2px #fff;
}

.ld-loop-form .ld-loop-form__consent input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(47, 57, 110, 0.25);
}

.ld-loop-form .ld-loop-form__honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.ld-loop-form .ld-loop-form__message {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.4;
}

.ld-loop-form .ld-loop-form__message[data-state="error"] {
  color: #8f2426;
  background: #fcf0f1;
  border: 1px solid #e8b4b8;
}

.ld-loop-form .ld-loop-form__message[data-state="success"] {
  color: #1a5a1d;
  background: #eef8ef;
  border: 1px solid #b5dcb8;
}

.ld-loop-form .ld-loop-form__message-link {
  display: inline-block;
  margin-top: 4px;
  font-weight: 600;
  text-decoration: underline;
}

.ld-loop-form .ld-loop-form__message[data-state="error"] .ld-loop-form__message-link {
  color: #1478b3;
}

.ld-loop-form .ld-loop-form__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
  padding-top: 4px;
}

.ld-loop-form .button.ld-loop-form__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-shadow: none;
  box-shadow: none;
  border-radius: 12px;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.12s ease, background-color 0.15s ease;
}

.ld-loop-form .button.ld-loop-form__submit:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(47, 57, 110, 0.35);
}

.ld-loop-form .button.ld-loop-form__submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.ld-loop-form .button.ld-loop-form__submit--whatsapp {
  background: #e8f9ef !important;
  color: #0f7a6e !important;
  border: 1px solid #25d366 !important;
}

.ld-loop-form .button.ld-loop-form__submit--whatsapp:hover:not(:disabled) {
  background: #25d366 !important;
  color: #fff !important;
}

.ld-loop-form .button.ld-loop-form__submit--telegram {
  background: #e8f4fc !important;
  color: #1478b3 !important;
  border: 1px solid #229ed9 !important;
}

.ld-loop-form .button.ld-loop-form__submit--telegram:hover:not(:disabled) {
  background: #229ed9 !important;
  color: #fff !important;
}

.ld-loop-form .ld-loop-form__field.is-invalid .ld-loop-form__input,
.ld-loop-form .ld-loop-form__field.is-invalid .ld-loop-form__select,
.ld-loop-form .ld-loop-form__field.is-invalid .ld-loop-country-picker__control {
  border-color: #e04545;
  box-shadow: 0 0 0 1px rgba(224, 69, 69, 0.22);
}

.ld-loop-form .ld-loop-form__field--consent.is-invalid .ld-loop-form__consent input[type="checkbox"] {
  border-color: #e04545;
}

/* Local: phone field with compact country / dial-code picker */
.ld-loop-form .ld-loop-phone-picker {
  position: relative;
  width: 100%;
  overflow: visible;
}

.ld-loop-form .ld-loop-phone-picker__input {
  width: 100%;
  padding-right: 48px;
}

.ld-loop-form .ld-loop-phone-picker__toggle {
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  margin: 0;
  border-radius: 0 6px 6px 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  color: #2f396e;
  background: #eef1f8;
  border: 1px solid #c8ced8;
  border-left: none;
  cursor: pointer;
  box-sizing: border-box;
}

.ld-loop-form .ld-loop-phone-picker__toggle:hover {
  background: #e2e6f2;
  border-color: #a8b2cc;
}

.ld-loop-form .ld-loop-phone-picker__toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(47, 57, 110, 0.28);
}

.ld-loop-form .ld-loop-phone-picker__dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 50;
  max-height: 240px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #c8ced8;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(32, 44, 84, 0.18);
}

.ld-loop-form .ld-loop-phone-picker__dropdown[hidden] {
  display: none !important;
}

.ld-loop-form .ld-loop-phone-picker__search {
  width: 100%;
  flex-shrink: 0;
  margin: 0;
  padding: 8px 10px;
  font-size: 16px;
  line-height: 1.25;
  color: #1d2327;
  border: none;
  border-bottom: 1px solid #dde3ef;
  border-radius: 0;
  background: #f8f9fc;
  min-height: 40px;
  box-sizing: border-box;
}

.ld-loop-form .ld-loop-phone-picker__search:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(47, 57, 110, 0.12);
}

.ld-loop-form .ld-loop-phone-picker__list {
  max-height: 190px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

.ld-loop-form .ld-loop-phone-picker__empty {
  padding: 10px 10px;
  font-size: 13px;
  line-height: 1.35;
  color: #646970;
}

.ld-loop-form .ld-loop-phone-picker__item {
  display: block;
  width: 100%;
  margin: 0;
  padding: 10px 10px;
  font-size: 14px;
  line-height: 1.35;
  text-align: left;
  color: #1d2327;
  background: #fff;
  border: none;
  border-bottom: 1px solid #eef1f8;
  cursor: pointer;
  box-sizing: border-box;
}

.ld-loop-form .ld-loop-phone-picker__item:last-child {
  border-bottom: none;
}

.ld-loop-form .ld-loop-phone-picker__item:hover {
  background: #eef1f8;
}

.ld-loop-form .ld-loop-phone-picker__item:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(47, 57, 110, 0.28);
  background: #eef1f8;
}

/* International: country field with search + flags (same layout cues as phone picker) */
.ld-loop-form .ld-loop-country-picker {
  position: relative;
  width: 100%;
  overflow: visible;
}

.ld-loop-form .ld-loop-country-picker__control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  margin: 0;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  box-sizing: border-box;
}

.ld-loop-form .ld-loop-country-picker__value {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ld-loop-form .ld-loop-country-picker__arrow {
  flex: 0 0 auto;
  font-size: 12px;
  line-height: 1;
  color: #8892bf;
}

.ld-loop-form .ld-loop-country-picker__dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 55;
  max-height: 240px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #c8ced8;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(32, 44, 84, 0.18);
}

.ld-loop-form .ld-loop-country-picker__dropdown[hidden] {
  display: none !important;
}

.ld-loop-form .ld-loop-country-picker__search {
  width: 100%;
  flex-shrink: 0;
  margin: 0;
  padding: 8px 10px;
  font-size: 16px;
  line-height: 1.25;
  color: #1d2327;
  border: none;
  border-bottom: 1px solid #dde3ef;
  border-radius: 0;
  background: #f8f9fc;
  min-height: 40px;
  box-sizing: border-box;
}

.ld-loop-form .ld-loop-country-picker__search:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(47, 57, 110, 0.12);
}

.ld-loop-form .ld-loop-country-picker__list {
  max-height: 190px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

.ld-loop-form .ld-loop-country-picker__empty {
  padding: 10px 10px;
  font-size: 13px;
  line-height: 1.35;
  color: #646970;
}

.ld-loop-form .ld-loop-country-picker__item {
  display: block;
  width: 100%;
  margin: 0;
  padding: 10px 10px;
  font-size: 14px;
  line-height: 1.35;
  text-align: left;
  color: #1d2327;
  background: #fff;
  border: none;
  border-bottom: 1px solid #eef1f8;
  cursor: pointer;
  box-sizing: border-box;
}

.ld-loop-form .ld-loop-country-picker__item:last-child {
  border-bottom: none;
}

.ld-loop-form .ld-loop-country-picker__item:hover {
  background: #eef1f8;
}

.ld-loop-form .ld-loop-country-picker__item:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(47, 57, 110, 0.28);
  background: #eef1f8;
}

.ld-loop-form .ld-loop-country-picker__control:hover:not(:disabled) {
  border-color: #a8b2cc;
}

.ld-loop-form .ld-loop-country-picker__control:focus-visible {
  outline: none;
  border-color: #2f396e;
  box-shadow: 0 0 0 2px rgba(47, 57, 110, 0.18);
}

@media (min-width: 520px) {
  .ld-loop-form .ld-loop-form__actions {
    flex-direction: row;
  }

  .ld-loop-form .button.ld-loop-form__submit {
    flex: 1;
    width: auto;
  }
}
