/* Modal basic styles */
:root {
  --modal-overlay: rgba(6, 18, 34, 0.68); /* deepened slightly for richer contrast */
}

.rp-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--modal-overlay);
  z-index: 10000;
  padding: 20px;
  pointer-events: auto;
  /* richer blur + saturation boost; fixed -webkit- prefix typo from original */
  backdrop-filter: blur(6px) saturate(120%);
  -webkit-backdrop-filter: blur(6px) saturate(120%);
}

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

/* panel entry: subtle scale+fade on open — animation fires when display changes */
.rp-modal.open .rp-modal__panel {
  animation: rp-modal-panel-in 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes rp-modal-panel-in {
  from { opacity: 0; transform: scale(0.97) translateY(10px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}

.rp-modal__panel {
  position: relative;
  width: 100%;
  max-width: 450px;
  height: auto;
  max-height: 70vh;
  max-height: 70dvh;
  border-radius: 8px;
  padding: 10px 10px;
  /* layered elevation: ambient + key shadow + inner specular highlight */
  box-shadow:
    0 2px 8px rgba(6, 18, 34, 0.18),
    0 14px 36px rgba(6, 18, 34, 0.32),
    0 36px 72px rgba(6, 18, 34, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  /* warm edge ring — consistent with site's subtle border treatments */
  border: 1px solid rgba(255, 255, 255, 0.13);
  font-family: inherit;
  z-index: 10001;
  background-color: #bfae60;
  background-image:
    radial-gradient(
      circle,
      rgba(255, 255, 255, 0.11) 1px,
      rgba(255, 255, 255, 0.02) 1px,
      transparent 2px
    ),
    /* slightly richer tonal shift top-to-bottom for depth */
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(0, 0, 0, 0.07)),
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.03) 0 2px,
      transparent 2px 10px
    );
  background-size:
    14px 14px,
    100% 100%,
    10px 10px;
  background-blend-mode: overlay, normal, overlay;
  padding-top: var(--header-height);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Floating action container inside modal (bottom-right) */
.modal-fab-container {
  position: absolute;
  right: 40px;
  bottom: 95px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-direction: row;
  z-index: 101;
}

.modal-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: -70px;
}

.modal-logo img {
  width: 160px;
  transform-origin: center;
  /* lift logo off textured panel */
  filter: drop-shadow(0 2px 8px rgba(6, 18, 34, 0.22));
}

/* Common FAB styles */
.modal-fab {
  width: 44px;
  height: 44px;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  /* layered FAB shadow for tangible elevation */
  box-shadow:
    0 4px 12px rgba(6, 18, 34, 0.2),
    0 1px 3px rgba(6, 18, 34, 0.14);
  text-decoration: none;
  /* spring-like lift curve matches site's motion language */
  transition:
    transform 0.18s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.18s ease;
  outline: none;
}

/* Call and WhatsApp specific colors */
.modal-call {
  background: #007bff;
  color: #fff;
}

.modal-whatsapp {
  background: #fff;
  color: #fff;
}

/* Hover / focus */
.modal-fab:hover,
.modal-fab:focus {
  transform: translateY(-3px);
  /* deeper lift shadow on hover */
  box-shadow:
    0 10px 26px rgba(6, 18, 34, 0.24),
    0 4px 8px rgba(6, 18, 34, 0.16);
}

/* accessible focus ring using existing cream palette color */
.modal-fab:focus-visible {
  outline: 2px solid rgba(237, 226, 212, 0.65);
  outline-offset: 3px;
}

/* SVG sizing inside FAB */
.modal-fab svg {
  width: 20px !important;
  height: 20px !important;
  max-width: 22px;
  max-height: 22px;
  display: block;
  line-height: 1;
}

.rp-modal__panel h3 {
  display: flex;
  align-items: center;
  text-align: center;
  justify-content: center;
  padding: 5px;
  color: rgb(255, 255, 255);
  /* refined tracking + depth shadow for premium feel */
  letter-spacing: 0.3px;
  text-shadow: 0 1px 6px rgba(6, 18, 34, 0.2);
}

.rp-modal__panel p {
  font-size: small;
  padding: 5px;
  line-height: 1.6;
  margin-bottom: 15px;
  text-align: center;
  /* slight opacity pull-back creates visual hierarchy below h3 */
  color: rgba(255, 255, 255, 0.88);
  letter-spacing: 0.15px;
}

.rp-modal__panel input {
  display: inline-block;
  margin-bottom: 10px;
  width: 100%;
  max-width: 100%;
  padding: 10px;
  border-radius: 10px;
}

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

#rp-modal-form input[type="text"],
#rp-modal-form input[type="email"],
#rp-modal-form input[type="tel"],
#rp-modal-form input[type="message"] {
  border: none !important;
  /* softened from hard black to feel lighter on the gold panel */
  border-bottom: 1px solid rgba(0, 0, 0, 0.32) !important;
  border-radius: 0 !important;
  background: transparent !important;
  padding: 8px 12px;
  margin-bottom: 14px;
  font-size: 16px;
  letter-spacing: 1px;
  color: black;
  /* smooth focus reveal */
  transition: border-bottom-color 0.18s ease !important;
}

/* warm bronze focus line — matches site's existing accent rgb(126, 90, 37) */
#rp-modal-form input[type="text"]:focus,
#rp-modal-form input[type="email"]:focus,
#rp-modal-form input[type="tel"]:focus {
  outline: none;
  box-shadow: none;
  border-bottom-color: rgb(126, 90, 37) !important;
}

#rp-modal-form input:focus {
  outline: none;
  box-shadow: none;
}

.rp-modal__close {
  position: absolute;
  right: 7.5px;
  top: 7.5px;
  background: transparent !important;
  color: rgb(237, 226, 212);
  border: 0;
  font-size: 22px;
  cursor: pointer;
  border-radius: 4px;
  padding: 2px 5px;
  /* smooth hover state reveal */
  transition: color 0.15s ease, background 0.15s ease;
}

/* close button: warm surface reveal on hover */
.rp-modal__close:hover,
.rp-modal__close:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.14) !important;
}

.rp-modal__cta {
  margin-top: 16px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  cursor: pointer;
}

#rp-modal-visit {
  height: 38px;
  padding: 8px 18px;
  cursor: pointer;
  /* fixed original RGB typo (was "21  2"); matches site's cream color */
  background: rgb(237, 226, 212);
  border-radius: 8px;
  border: none;
  font-weight: 500;
  margin: 0 auto 5px auto;
  display: block;
  letter-spacing: 0.3px;
  /* lifted CTA with layered shadow */
  box-shadow: 0 2px 10px rgba(6, 18, 34, 0.18);
  transition:
    background 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.12s ease;
}

/* submit CTA hover: brightens to white — mirrors site's #contact-us:hover */
#rp-modal-visit:hover {
  background: rgb(255, 255, 255);
  box-shadow: 0 6px 20px rgba(6, 18, 34, 0.22);
  transform: translateY(-1px);
}

#rp-modal-visit:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(6, 18, 34, 0.14);
}

/* accessible focus ring using site's bronze accent */
#rp-modal-visit:focus-visible {
  outline: 2px solid rgb(126, 90, 37);
  outline-offset: 2px;
}

.captcha-submit-row {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.g-recaptcha {
  transform: scale(0.7);
  transform-origin: left top;
}

.g-recaptcha-wrapper {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.modal-content-con {
  display: flex;
  gap: 18px;
  align-items: stretch;
  width: 100%;
  box-sizing: border-box;
  padding: 6px 0;
}

.modal-content-con > .form-con {
  flex: 1;
  max-width: 100%;
  min-width: 260px;
  box-sizing: border-box;
  padding: 0 12px;
}

/* form inputs full width */
.modal-content-con .form-con input {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 15px;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

#rp-modal-form input#phone-input {
  flex: 1;
  width: 100%;
  padding: 12px 18px;
  border: none;
  /* softened from hard black, with focus transition */
  border-bottom: 1px solid rgba(0, 0, 0, 0.32);
  border-radius: 0;
  font-size: 16px;
  margin: 0;
  transition: border-bottom-color 0.18s ease;
}

/* warm bronze focus on phone input */
#rp-modal-form input#phone-input:focus {
  border-bottom-color: rgb(126, 90, 37);
  outline: none;
}

@media (max-width: 1200px) {
  .rp-modal__panel {
    max-width: 720px;
    width: 100%;
    top: -350px;
    padding: 18px;
  }

  .modal-content-con {
    gap: 14px;
  }

  .modal-content-con > .form-con {
    flex: 1 1 56%;
    max-width: 56%;
    min-width: 220px;
    padding: 0 8px;
  }

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

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

/* <= 900px — tablets / large phones: stack vertically, form-first layout */
@media (max-width: 900px) {
  .rp-modal__panel {
    top: 50px;
    max-width: 92%;
    height: auto;
    padding: 16px;
  }

  .modal-content-con {
    flex-direction: column;
    gap: 12px;
  }

  .modal-content-con > .left__content,
  .modal-content-con > .form-con,
  .modal-content-con > .right__content {
    flex: 0 0 auto;
    max-width: 100%;
    min-width: 0;
    padding: 0;
  }

  .modal-content-con > .left__content,
  .modal-content-con > .right__content {
    display: block;
  }

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

  .rp-modal .right__content span {
    padding-left: 18px;
    font-size: 13px;
  }

  .rp-modal .right__content span::before {
    width: 10px;
    height: 10px;
  }
}

/* <= 520px — phones: focus on form, hide side columns, full width modal */
@media (max-width: 520px) {
  .rp-modal__panel {
    width: 92%;
    max-width: 320px;
    height: auto;
    padding: 14px;
    padding-bottom: 20px;
    border-radius: 8px;
    top: 0;
  }

  .modal-logo {
    margin-top: 0;
    margin-bottom: 8px;
    justify-content: center;
  }

  .modal-logo img {
    width: 120px;
  }

  .rp-modal__panel h3 {
    font-size: x-small;
  }

  .rp-modal__panel p {
    font-size: x-small;
    padding: 0px;
  }

  .modal-content-con {
    gap: 2px;
  }

  .modal-content-con > .form-con {
    max-width: 100%;
    min-width: 0;
    padding: 0;
  }

  .rp-modal__close {
    top: 10px;
    right: 10px;
    font-size: 18px;
    z-index: 10;
  }

  .rp-modal__cta {
    flex-direction: column-reverse;
    gap: 8px;
    align-items: stretch;
    padding-right: calc(64px + env(safe-area-inset-right, 0px));
    padding-left: calc(64px + env(safe-area-inset-right, 0px));
    box-sizing: border-box;
    z-index: 10;
  }

  #rp-modal-visit {
    position: relative;
    width: 70%;
    max-width: 180px;
    margin: 10px auto 0 auto;
    display: block;
  }

  .modal-fab-container {
    position: absolute;
    right: 0;
    bottom: 15px;
    flex-direction: column;
    gap: 5px;
  }

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

  .captcha-submit-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

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

/* <= 375px — very small phones: tighten spacing & control sizes */
@media (max-width: 375px) {
  .rp-modal__panel {
    padding: 10px;
    padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px));
  }

  .rp-modal__panel h3 {
    font-size: 16px;
  }

  .modal-content-con .form-con input {
    padding: 8px;
  }

  .rp-modal .right__content span {
    padding-left: 16px;
    font-size: 12px;
  }

  .rp-modal .right__content span::before {
    width: 8px;
    height: 8px;
  }

  .rp-modal__cta {
    padding-right: calc(56px + env(safe-area-inset-right, 0px));
  }

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

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

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

  .modal-fab-container {
    position: absolute;
    right: 5px;
    bottom: 10px;
    flex-direction: column;
    gap: 5px;
  }

  #rp-modal-visit {
    height: 28px;
    padding: 3px 10px;
    font-size: 12px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 20px;
  }
}
