/* ==========================================================
   Riverport Business Club - Request a Callback (member profiles)
   Pink button on the contact card + pop-up form (native <dialog>).
   Desktop/tablet: centred pop-up. Phones: slides up from the bottom.
   ========================================================== */

/* ---------- Button on the contact card ---------- */
.cbk-open { margin-top: 0.25rem; background: var(--brand); color: var(--white); }
.cbk-open:hover { background: var(--brand-dark); color: var(--white); box-shadow: 0 10px 24px rgba(254, 104, 191, 0.35); }

/* ---------- Pop-up ---------- */
.cbk-modal {
  width: min(480px, calc(100% - 2rem)); max-width: none; max-height: calc(100dvh - 2rem);
  margin: auto; padding: 0; border: 0; border-radius: var(--radius-lg);
  background: var(--white); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
.cbk-modal::backdrop { background: rgba(30, 30, 30, 0.6); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.cbk-modal[open] { animation: cbk-in 0.25s var(--ease); }
@keyframes cbk-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
.cbk-modal__box { position: relative; max-height: calc(100dvh - 2rem); overflow-y: auto; overscroll-behavior: contain; padding: clamp(1.4rem, 4vw, 2rem); border-top: 4px solid var(--brand); }
html.cbk-locked { overflow: hidden; }
.cbk-modal__box:focus { outline: none; }   /* focused on open so screen readers start here - no visible ring needed */

.cbk-modal__close {
  position: absolute; top: 0.85rem; right: 0.85rem; display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--grey); color: var(--charcoal); font-size: 1.1rem; cursor: pointer;
  transition: background-color 0.2s var(--ease);
}
.cbk-modal__close:hover { background: #e9e9ec; }

.cbk-modal__head { display: flex; align-items: center; gap: 1rem; margin: 0 2.75rem 1.4rem 0; }
.cbk-modal__photo { width: 64px; height: 64px; flex-shrink: 0; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 3px var(--brand-tint); }
.cbk-modal__photo--mono { display: flex; align-items: center; justify-content: center; background: var(--charcoal); color: var(--white); font-weight: 800; }
.cbk-modal__title { margin: 0 0 0.25rem; font-size: var(--fs-h3); font-weight: 800; line-height: 1.2; }
.cbk-modal__sub { margin: 0; font-size: 0.95rem; line-height: 1.5; color: var(--muted); }

/* ---------- Form ---------- */
.cbk-form { display: grid; gap: 1rem; }
.cbk-field { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.cbk-field label { font-size: 0.9rem; font-weight: 700; color: #2b2b2b; }
.cbk-req { color: var(--brand-deep); }
.cbk-optional { font-weight: 500; color: var(--muted); }
.cbk-field input, .cbk-field textarea {
  width: 100%; min-width: 0; font: inherit; font-size: 1rem; color: #2b2b2b;   /* 16px stops iOS zooming in */
  padding: 0.8rem 0.95rem; border: 2px solid var(--grey-line); border-radius: 10px; background: var(--white);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.cbk-field textarea { resize: none; min-height: 5.5rem; line-height: 1.5; }
.cbk-field input:focus, .cbk-field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(254, 104, 191, 0.2); }
.cbk-field.is-invalid input { border-color: var(--brand-deep); }
.cbk-error { margin: 0; font-size: 0.85rem; font-weight: 600; color: var(--brand-deep); }
.cbk-field--hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.cbk-submit, button.cbk-submit { margin-top: 0.25rem; background: var(--brand); color: var(--white); }
.cbk-submit:hover { background: var(--brand-dark); color: var(--white); }
.cbk-note { margin: 0; font-size: 0.82rem; line-height: 1.5; color: var(--muted); text-align: center; }
.cbk-note a { color: #2b2b2b; text-underline-offset: 2px; }

/* Sent */
.cbk-done { display: grid; justify-items: center; gap: 0.9rem; text-align: center; }
.cbk-done p { margin: 0; line-height: 1.6; }
.cbk-done__icon { display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 50%; background: var(--brand); color: var(--white); font-size: 1.3rem; }

/* ---------- Phones: slide up from the bottom ---------- */
@media (max-width: 560px) {
  .cbk-modal { width: 100%; max-height: 92dvh; margin: auto 0 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .cbk-modal[open] { animation: cbk-up 0.3s var(--ease); }
  .cbk-modal__box { max-height: 92dvh; padding-bottom: calc(1.4rem + env(safe-area-inset-bottom)); }
  .cbk-modal__photo { width: 52px; height: 52px; }
}
@keyframes cbk-up { from { transform: translateY(100%); } to { transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .cbk-modal[open] { animation: none; }
}
