/* ============================================================
   MODAL — Premium Contact Form
   ============================================================ */

.rp-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(45, 45, 45, 0.72);
  z-index: 10000;
  padding: 20px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.rp-modal.open {
  display: flex;
}

/* ===== PANEL ===== */
.rp-modal__panel {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 16px;
  padding: 44px 40px 36px;
  background: var(--primary-green);
  box-shadow:
    0 8px 32px rgba(45, 45, 45, 0.3),
    0 24px 64px rgba(45, 45, 45, 0.25);
  z-index: 10001;
  font-family: var(--font3);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== HEADING ===== */
.rp-modal__panel h3 {
  font-size: 1.45rem;
  font-weight: 700;
  font-family: var(--font1);
  color: var(--secondary-col);
  text-align: center;
  margin-bottom: 32px;
  letter-spacing: -0.3px;
  padding: 0;
}

/* ===== CLOSE BUTTON ===== */
.rp-modal__close {
  position: absolute;
  right: 16px;
  top: 16px;
  background: transparent;
  color: rgba(249, 247, 242, 0.45);
  border: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
  transition: color 0.15s ease;
}

.rp-modal__close:hover {
  color: var(--secondary-col);
}

/* ===== FORM LAYOUT ===== */
.modal-content-con {
  width: 100%;
}

.modal-content-con > .form-con {
  width: 100%;
  max-width: 100%;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* ===== TEXT / EMAIL / TEL INPUTS — underline style ===== */
/* Exclude .country-search-input which lives inside the white dropdown panel */
#rp-modal-form input[type="text"]:not(.country-search-input),
#rp-modal-form input[type="email"],
#rp-modal-form input[type="tel"] {
  display: block;
  width: 100%;
  box-sizing: border-box;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(249, 247, 242, 0.28);
  border-radius: 0;
  padding: 10px 0;
  margin-bottom: 20px;
  font-size: 14px;
  font-family: var(--font3);
  letter-spacing: 0.3px;
  color: var(--secondary-col);
  transition: border-color 0.2s ease;
}

#rp-modal-form input[type="text"]:not(.country-search-input)::placeholder,
#rp-modal-form input[type="email"]::placeholder,
#rp-modal-form input[type="tel"]::placeholder {
  color: rgba(249, 247, 242, 0.4);
}

#rp-modal-form input[type="text"]:not(.country-search-input):focus,
#rp-modal-form input[type="email"]:focus,
#rp-modal-form input[type="tel"]:focus {
  outline: none;
  box-shadow: none;
  border-bottom-color: var(--secondary-col);
}

#rp-modal-form input[name="message"] {
  height: 40px;
}

/* ===== PHONE INPUT GROUP ===== */
.phone-input-group {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 0;
}

/* ===== COUNTRY SELECTOR — match underline style on dark panel ===== */
.rp-modal .country-selector-wrapper {
  border: none;
  border-bottom: 1px solid rgba(249, 247, 242, 0.28);
  border-radius: 0;
  background: transparent;
  transition: border-color 0.2s;
}

.rp-modal .country-selector-wrapper.open,
.rp-modal .country-selector-wrapper:focus-within {
  border-bottom-color: var(--secondary-col);
}

.rp-modal .country-dropdown-trigger {
  padding: 10px 4px 10px 0;
  color: var(--secondary-col);
}

.rp-modal .trigger-code {
  color: var(--secondary-col);
}

.rp-modal .dropdown-chevron {
  color: rgba(249, 247, 242, 0.45);
}

/* Country search input — lives in white panel, restore its own colors */
.rp-modal .country-search-input {
  color: var(--fourth-col) !important;
  background: rgba(249, 247, 242, 0.08) !important;
  border: 1px solid rgba(249, 247, 242, 0.15) !important;
  border-radius: 8px !important;
  padding: 7px 10px 7px 30px !important;
  margin-bottom: 0 !important;
}

/* Override undefined --primary-col for focus state */
.rp-modal .country-search-input:focus {
  border-color: var(--secondary-col) !important;
  background: rgba(249, 247, 242, 0.14) !important;
}

/* ===== PHONE INPUT ===== */
#phone-input {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(249, 247, 242, 0.28);
  border-radius: 0;
  padding: 10px 0;
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 14px;
  font-family: var(--font3);
  color: var(--secondary-col);
  transition: border-color 0.2s;
  box-sizing: border-box;
}

#phone-input::placeholder {
  color: rgba(249, 247, 242, 0.4);
}

#phone-input:focus {
  outline: none;
  border-bottom-color: var(--secondary-col);
  box-shadow: none;
}

/* ===== CAPTCHA ===== */
.g-recaptcha-wrapper {
  margin-bottom: 6px;
}

.form-con .g-recaptcha {
  transform: scale(0.81);
  transform-origin: left top;
  display: flex;
  justify-content: flex-start;
}

.captcha-error {
  font-size: 0.75rem;
  color: var(--secondary-green);
  margin-bottom: 8px;
  font-family: var(--font3);
  padding: 0;
}

/* ===== SUBMIT BUTTON ===== */
.rp-modal__cta {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}

#rp-modal-visit {
  width: 100%;
  padding: 13px 24px;
  background: var(--secondary-col);
  color: var(--primary-green);
  border: none;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: var(--font2);
  text-transform: uppercase;
  letter-spacing: 2.5px;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#rp-modal-visit:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

#rp-modal-visit:active {
  transform: translateY(0);
  opacity: 1;
}

/* ===== FLOATING ACTION BUTTONS ===== */
.modal-fab-container {
  position: absolute;
  right: 18px;
  bottom: 90px;
  display: flex;
  gap: 10px;
  z-index: 40;
  align-items: center;
  flex-direction: row;
}

.modal-fab {
  width: 44px;
  height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(45, 45, 45, 0.25);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  outline: none;
}

.modal-fab:hover,
.modal-fab:focus {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(45, 45, 45, 0.3);
}

.modal-fab svg {
  width: 20px;
  height: 20px;
  display: block;
}

.modal-call {
  background: var(--secondary-green);
}

.modal-whatsapp {
  background: var(--secondary-col);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-logo-con {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 8px;
}

.modal-logo {
  max-width: 165px;
  height: auto;
  object-fit: contain;
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */

@media (max-width: 1200px) {
  .rp-modal__panel {
    max-width: 420px;
    padding: 40px 32px 32px;
  }

  .modal-fab-container {
    right: 14px;
    bottom: 14px;
  }

  .form-con .g-recaptcha {
    transform: scale(0.87);
    transform-origin: left top;
  }
}

@media (max-width: 900px) {
  .rp-modal__panel {
    max-width: 92%;
    padding: 36px 28px 28px;
  }

  .modal-fab-container {
    right: 12px;
    bottom: 12px;
  }

  .form-con .g-recaptcha {
    transform: scale(0.87);
    transform-origin: left top;
  }
}

@media (max-width: 520px) {
  .rp-modal {
    padding: 12px;
  }

  .rp-modal__panel {
    width: 100%;
    max-width: 100%;
    padding: 32px 20px 24px;
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
    border-radius: 14px;
  }

  .rp-modal__panel h3 {
    font-size: 1.2rem;
    margin-bottom: 24px;
  }

  #rp-modal-visit {
    font-size: 0.75rem;
    padding: 12px 20px;
    letter-spacing: 2px;
  }

  .modal-fab-container {
    right: 16px;
    bottom: 30px;
  }

  .form-con .g-recaptcha {
    transform: scale(0.87);
    transform-origin: left top;
  }
}

@media (max-width: 375px) {
  .rp-modal__panel {
    padding: 28px 16px 20px;
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    border-radius: 12px;
  }

  .rp-modal__panel h3 {
    font-size: 1.1rem;
    margin-bottom: 20px;
  }

  .modal-fab {
    width: 40px;
    height: 40px;
  }

  .modal-fab svg {
    width: 18px;
    height: 18px;
  }

  .form-con .g-recaptcha {
    transform: scale(0.87);
    transform-origin: left top;
  }
}
