/* FEA-299 — the two Div'In popups (see public/frontend/js/divin-popup.js).
 *
 *   .divin-pop--modal     Type A: navy card centred on the screen, page dimmed
 *   .divin-pop--anchored  Type B: navy bubble with an arrow, pinned under the control
 *   .divin-pop--panel     Type B holding a small form (planning: edit boat/site/guide)
 *
 * Colours pixel-sampled from the two mockups on the FEA-299 ticket:
 * card #0c2849, action #fb735d, body text light blue on navy. */

.divin-pop {
  box-sizing: border-box;
  font-family: "Afacad", sans-serif;
}
.divin-pop *,
.divin-pop *::before,
.divin-pop *::after {
  box-sizing: border-box;
}
.divin-pop[hidden] {
  display: none !important;
}

/* Type A — full-screen dim + centred card */
.divin-pop--modal {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(4, 17, 33, 0.45);
}
body.divin-pop-open {
  overflow: hidden;
}

/* Type B — absolutely positioned by the helper, sits above the sticky bars (1050-1052) */
.divin-pop--anchored {
  position: absolute;
  z-index: 1080;
  width: max-content;
  max-width: calc(100vw - 24px);
}

.divin-pop__card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 28px;
  max-width: min(860px, calc(100vw - 32px));
  padding: 22px 28px;
  border-radius: 22px;
  background: #0c2849;
  color: #fff;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}
.divin-pop--anchored .divin-pop__card {
  gap: 20px;
  padding: 18px 24px;
  border-radius: 18px;
}

.divin-pop__body {
  flex: 1 1 auto;
  min-width: 0;
}
.divin-pop__title {
  margin: 0 0 4px;
  font-family: "Amarante", serif;
  font-size: 28px;
  font-weight: 400;
  line-height: 1.15;
  color: #fff;
}
.divin-pop--anchored .divin-pop__title {
  font-size: 24px;
}
.divin-pop__text {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
  color: #9dc3f0;
}
.divin-pop--anchored .divin-pop__text {
  font-size: 16px;
}
.divin-pop__text br + * {
  margin-top: 4px;
}

.divin-pop__actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 14px;
}

.divin-btn {
  display: inline-block;
  padding: 16px 30px;
  border: 1.5px solid transparent;
  border-radius: 60px;
  font-family: "Amarante", serif;
  font-size: 19px;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}
.divin-pop--anchored .divin-btn {
  padding: 13px 26px;
  font-size: 17px;
}
.divin-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.divin-btn--ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.8);
  color: #fff;
}
.divin-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}
.divin-btn--danger {
  background: #fb735d;
  color: #fff;
}
.divin-btn--danger:hover {
  background: #f2604a;
}
.divin-btn--primary {
  background: var(--primary-color, #065db5);
  color: #fff;
}
.divin-btn--primary:hover {
  background: var(--primary-hover-color, #052646);
}

/* Type B arrow: a rotated square, placed by the helper (left) */
.divin-pop__arrow {
  position: absolute;
  top: -7px;
  width: 14px;
  height: 14px;
  border-radius: 2px;
  background: #0c2849;
  transform: translateX(-50%) rotate(45deg);
}
.divin-pop--above .divin-pop__arrow {
  top: auto;
  bottom: -7px;
}

/* Panel variant: a small form inside the bubble, stacked */
.divin-pop--panel .divin-pop__card {
  flex-direction: column;
  align-items: stretch;
  width: 380px;
  max-width: calc(100vw - 24px);
  gap: 16px;
}
.divin-pop--panel .divin-pop__actions {
  justify-content: flex-end;
}
.divin-pop--panel .form-label {
  color: #9dc3f0;
  font-size: 14px;
}
.divin-pop--panel .form-select,
.divin-pop--panel .form-control {
  background-color: #fff;
  color: #000;
}
.divin-pop--panel .mb-3:last-child {
  margin-bottom: 0 !important;
}

@media (max-width: 575.98px) {
  .divin-pop__card {
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
  }
  .divin-pop__actions {
    justify-content: flex-end;
  }
  .divin-pop__title {
    font-size: 24px;
  }
}
