/* Modal basic styles */
:root {
  --modal-overlay: rgba(6, 18, 34, 0.85);
}

.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;
  backdrop-filter: blur(10px) saturate(150%);
  -webkit-backdrop-filter: blur(10px) saturate(150%);
}

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

.rp-modal.open .rp-modal__panel {
  animation: rp-modal-panel-in 0.35s 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;
  /* deep navy shadows give the panel tangible weight */
  box-shadow:
    0 2px 8px rgba(6, 18, 34, 0.3),
    0 14px 40px rgba(6, 18, 34, 0.45),
    0 40px 80px rgba(6, 18, 34, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 rgba(6, 18, 34, 0.18);
  /* cream top-line acts like an embossed ridge */
  border-top: 1px solid rgba(237, 226, 212, 0.55);
  border-left: 1px solid rgba(237, 226, 212, 0.18);
  border-right: 1px solid rgba(237, 226, 212, 0.18);
  border-bottom: 1px solid rgba(6, 18, 34, 0.3);
  font-family: inherit;
  z-index: 10001;
  /* bronze at the edges, gold at the center — metallic sweep */
  background-color: #bfae60;
  background-image:
    /* fine diagonal weave for tactile texture */
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.04) 0 1px,
      transparent 1px 8px
    ),
    /* top highlight — bright streak like polished metal */
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.18) 0%,
      rgba(255, 255, 255, 0.04) 18%,
      transparent 50%,
      rgba(6, 18, 34, 0.1) 100%
    ),
    /* bronze-to-gold-to-bronze radial sweep for depth */
    radial-gradient(
      ellipse 120% 80% at 50% 30%,
      #bfae60 0%,
      rgb(126, 90, 37) 100%
    );
  background-size:
    8px 8px,
    100% 100%,
    100% 100%;
  background-blend-mode: overlay, normal, normal;
  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;
  filter: drop-shadow(0 2px 10px rgba(6, 18, 34, 0.35));
}

/* Common FAB styles */
.modal-fab {
  width: 44px;
  height: 44px;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  box-shadow:
    0 4px 12px rgba(6, 18, 34, 0.28),
    0 1px 3px rgba(6, 18, 34, 0.18);
  text-decoration: none;
  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);
  box-shadow:
    0 10px 26px rgba(6, 18, 34, 0.32),
    0 4px 8px rgba(6, 18, 34, 0.2);
}

.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(6, 18, 34);
  letter-spacing: 0.6px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2);
}

.rp-modal__panel p {
  font-size: small;
  padding: 5px;
  line-height: 1.6;
  margin-bottom: 15px;
  text-align: center;
  color: rgba(6, 18, 34, 0.72);
  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;
  border-bottom: 1px solid rgba(6, 18, 34, 0.28) !important;
  border-radius: 0 !important;
  background: transparent !important;
  padding: 8px 12px;
  margin-bottom: 14px;
  font-size: 16px;
  letter-spacing: 1px;
  color: rgb(6, 18, 34);
  transition: border-bottom-color 0.18s ease !important;
}

#rp-modal-form input[type="text"]::placeholder,
#rp-modal-form input[type="email"]::placeholder,
#rp-modal-form input[type="tel"]::placeholder {
  color: rgba(6, 18, 34, 0.4);
}

#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(6, 18, 34) !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: rgba(6, 18, 34, 0.55);
  border: 0;
  font-size: 22px;
  cursor: pointer;
  border-radius: 4px;
  padding: 2px 5px;
  transition: color 0.15s ease, background 0.15s ease;
}

.rp-modal__close:hover,
.rp-modal__close:focus-visible {
  color: rgb(6, 18, 34);
  background: rgba(6, 18, 34, 0.1) !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;
  background: rgb(6, 18, 34);
  color: rgb(237, 226, 212);
  border-radius: 8px;
  border: none;
  font-weight: 600;
  margin: 0 auto 5px auto;
  display: block;
  letter-spacing: 0.6px;
  box-shadow:
    0 2px 10px rgba(6, 18, 34, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition:
    background 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.12s ease;
}

#rp-modal-visit:hover {
  background: rgb(237, 226, 212);
  color: rgb(6, 18, 34);
  box-shadow: 0 6px 22px rgba(6, 18, 34, 0.3);
  transform: translateY(-1px);
}

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

#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(6, 18, 34, 0.15);
}

#rp-modal-form input#phone-input {
  flex: 1;
  width: 100%;
  padding: 12px 18px;
  border: none;
  border-bottom: 1px solid rgba(6, 18, 34, 0.28);
  border-radius: 0;
  font-size: 16px;
  margin: 0;
  transition: border-bottom-color 0.18s ease;
}

#rp-modal-form input#phone-input::placeholder {
  color: rgba(6, 18, 34, 0.4);
}

#rp-modal-form input#phone-input:focus {
  border-bottom-color: rgb(6, 18, 34);
  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;
  }
}
