/* Public forms: the slide-out feedback / feature-request panel and the share dialog. Built on <dialog>, so focus
   trapping and Esc come from the browser. Loaded only on pages that include partials/forms-ui.php. */

button.help-card { appearance: none; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }

.rf-dialog { border: 0; padding: 0; color: var(--ink); background: #fff; font-family: inherit; }
.rf-dialog::backdrop { background: rgba(8, 6, 22, .5); backdrop-filter: blur(2px); }

/* slide-out panel */
.rf-drawer { margin: 0 0 0 auto; height: 100vh; max-height: none; width: min(480px, 100vw); border-radius: 22px 0 0 22px; box-shadow: -24px 0 60px rgba(8, 6, 22, .25); }
.rf-drawer[open] { animation: rf-slide .28s cubic-bezier(.2, .7, .2, 1); }
@keyframes rf-slide { from { transform: translateX(100%); } to { transform: none; } }
/* centred dialog */
.rf-modal { width: min(520px, 94vw); border-radius: 22px; box-shadow: 0 30px 80px rgba(8, 6, 22, .35); }
.rf-modal[open] { animation: rf-pop .2s ease; }
@keyframes rf-pop { from { transform: translateY(12px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .rf-drawer[open], .rf-modal[open] { animation: none; } }

.rf-inner { display: flex; flex-direction: column; height: 100%; }
.rf-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 24px 26px 6px; }
.rf-head h2 { margin: 0; font-size: 22px; font-weight: 850; letter-spacing: -.03em; line-height: 1.2; }
.rf-head p { margin: 6px 0 0; font-size: 14px; color: var(--muted); line-height: 1.5; }
.rf-x { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 20px; line-height: 1; cursor: pointer; color: var(--ink); }
.rf-x:hover { border-color: var(--indigo); color: var(--indigo); }
.rf-body { padding: 14px 26px 26px; overflow-y: auto; flex: 1; }

.rf-field { margin-bottom: 15px; }
.rf-field label { display: block; font-size: 13px; font-weight: 800; margin-bottom: 6px; }
.rf-field label small { font-weight: 500; color: var(--muted); }
.rf-field input, .rf-field select, .rf-field textarea { width: 100%; padding: 12px 14px; border: 1px solid rgba(8, 6, 22, .16); border-radius: 12px; background: #fff; font: inherit; font-size: 14px; color: var(--ink); }
.rf-field textarea { min-height: 130px; resize: vertical; line-height: 1.5; }
.rf-field input:focus, .rf-field select:focus, .rf-field textarea:focus { outline: 0; border-color: var(--indigo); box-shadow: 0 0 0 4px rgba(47, 47, 228, .12); }
.rf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .rf-row { grid-template-columns: 1fr; } }
.rf-count { text-align: right; font-size: 11px; color: var(--muted); margin-top: 4px; }
.rf-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }   /* honeypot: invisible to people */
.rf-error { display: none; margin: 0 0 14px; padding: 11px 14px; border-radius: 12px; background: #fbe9e9; color: #a63a3a; font-size: 13.5px; }
.rf-error.on { display: block; }
.rf-submit { width: 100%; border: 0; border-radius: 12px; padding: 14px 18px; background: var(--indigo); color: #fff; font: inherit; font-size: 15px; font-weight: 800; cursor: pointer; box-shadow: 0 12px 26px rgba(47, 47, 228, .24); }
.rf-submit[disabled] { opacity: .6; cursor: wait; }
.rf-fine { margin: 10px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.rf-done { display: none; text-align: center; padding: 30px 6px 10px; }
.rf-done.on { display: block; }
.rf-done .tick { width: 58px; height: 58px; margin: 0 auto 16px; border-radius: 50%; background: #e3f6ec; color: #16875a; display: grid; place-items: center; font-size: 30px; }
.rf-done h3 { margin: 0 0 6px; font-size: 20px; font-weight: 850; }
.rf-done p { margin: 0 0 20px; color: var(--muted); font-size: 14.5px; }
.rf-done button { border: 1px solid rgba(8, 6, 22, .18); background: #fff; border-radius: 12px; padding: 11px 22px; font: inherit; font-weight: 800; cursor: pointer; }

/* share */
.rf-social { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 4px 0 16px; }
.rf-social a, .rf-social button { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 14px 6px; border: 1px solid var(--line); border-radius: 14px; background: #fff; font: inherit; font-size: 12.5px; font-weight: 750; color: var(--ink); cursor: pointer; text-decoration: none; }
.rf-social a:hover, .rf-social button:hover { border-color: var(--indigo); transform: translateY(-1px); }
.rf-social svg { width: 26px; height: 26px; }
.rf-copy { display: flex; gap: 8px; margin-bottom: 18px; }
.rf-copy input { flex: 1; min-width: 0; padding: 11px 13px; border: 1px solid rgba(8, 6, 22, .16); border-radius: 12px; font: inherit; font-size: 13.5px; background: #f7f5ef; color: var(--ink); }
.rf-copy button { border: 0; border-radius: 12px; padding: 0 18px; background: var(--ink); color: #fff; font: inherit; font-weight: 800; cursor: pointer; }
.rf-or { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #8a899a; }
.rf-or::before, .rf-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* The centred dialog never shows a scroll bar of its own; the form part scrolls only if it really cannot fit, and the
   confirmation ("Check your inbox") is short, so it never scrolls at all. */
.rf-modal { overflow: hidden; max-height: 92vh; }
.rf-modal .rf-inner { max-height: 92vh; }
.rf-body:has(.rf-done.on) { overflow: hidden; scrollbar-width: none; }
.rf-body:has(.rf-done.on)::-webkit-scrollbar { display: none; }

/* No visible scrollbar in the dialogs (the share form and its "check your inbox" confirmation): the content is sized to fit,
   and on a very short window it still scrolls with the wheel or touch, just without a bar. */
.rf-dialog, .rf-dialog .rf-inner, .rf-dialog .rf-body, .rf-dialog .rf-done { scrollbar-width: none; -ms-overflow-style: none; }
.rf-dialog::-webkit-scrollbar, .rf-dialog .rf-inner::-webkit-scrollbar, .rf-dialog .rf-body::-webkit-scrollbar, .rf-dialog .rf-done::-webkit-scrollbar { display: none; width: 0; height: 0; }
.rf-modal .rf-body { padding-bottom: 20px; }

/* "Tell your team or a friend": wide enough that "Your email (we send you a link to confirm)" stays on one line beside "Your name". */
#rf-share.rf-modal { width: min(720px, 94vw); }
#rf-share .rf-row { align-items: start; }
@media (max-width: 760px) { #rf-share .rf-field label { white-space: normal; } }
