/* ═══════════════════════════════════════════════════════════════
   FEEDBACK — in-app bug/idea capture (#21574)

   Self-contained on purpose: entry points and modal live here so the
   design team can restyle the whole widget without touching any other
   sheet.  All values come from tokens.css per the UI Strategy rules.
   ═══════════════════════════════════════════════════════════════ */


/* ── Entry point: sidebar footer row ──────────────────────────
   Matches .nav-add (muted, 13px) so it reads as chrome rather than a
   call to action — it sits below the journey, not inside it. */

.feedback__trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--kz-color-text-muted);
    text-decoration: none;
    background: transparent;
    border: 0;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    width: 100%;
}

.feedback__trigger:hover {
    background: rgba(0, 0, 0, 0.035);
    color: var(--kz-color-text);
}

.feedback__trigger:focus-visible {
    outline: 2px solid var(--kz-color-action);
    outline-offset: 2px;
}

.feedback__trigger svg {
    width: 14px;
    height: 14px;
    flex: none;
}

/* ── Entry point: scan app-bar pill ───────────────────────────
   The questionnaire has no sidebar, and mid-scan is where confusing
   wording causes silent drop-off.  Sized to match the adjacent
   .lang-switch so the bar reads as one cluster of controls. */

.scan-app-bar-right .feedback__trigger {
    width: auto;
    font-size: 11.5px;
    padding: 5px 9px;
    border: 1px solid var(--kz-color-border);
    border-radius: 999px;
    white-space: nowrap;
}

.scan-app-bar-right .feedback__trigger svg {
    width: 12px;
    height: 12px;
}


/* ── Modal ───────────────────────────────────────────────────── */

.feedback__modal {
    position: fixed;
    inset: 0;
    background: rgba(28, 25, 23, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: var(--kz-z-modal);
}

.feedback__modal[hidden] {
    display: none;
}

.feedback__card {
    background: var(--kz-color-surface);
    border: 1px solid var(--kz-color-border);
    border-radius: 14px;
    padding: 26px 26px 22px;
    max-width: 460px;
    width: 100%;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    box-shadow: 0 18px 40px rgba(28, 25, 23, 0.18);
}

.feedback__title {
    margin: 0;
    font-family: var(--kz-font-display);
    font-weight: var(--kz-font-weight-medium);
    font-size: 20px;
    letter-spacing: -0.01em;
    color: var(--kz-color-heading);
}

.feedback__subtitle {
    margin: 6px 0 18px;
    color: var(--kz-color-text-muted);
    font-size: 13.5px;
    line-height: 1.5;
}

/* Type picker — two radio-backed pills.  Radios stay in the DOM for
   keyboard and screen-reader users; the pill is the visible control. */
.feedback__types {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.feedback__type {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--kz-color-border-heavy);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13.5px;
    cursor: pointer;
    color: var(--kz-color-text-soft);
    background: var(--kz-color-surface);
}

.feedback__type:hover {
    border-color: var(--kz-color-text-faint);
}

.feedback__type svg {
    width: 15px;
    height: 15px;
    flex: none;
}

.feedback__type-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.feedback__type:has(.feedback__type-input:checked) {
    border-color: var(--kz-color-brand-navy);
    box-shadow: inset 0 0 0 1px var(--kz-color-brand-navy);
    color: var(--kz-color-text);
    font-weight: var(--kz-font-weight-medium);
}

.feedback__type:has(.feedback__type-input:focus-visible) {
    outline: 2px solid var(--kz-color-action);
    outline-offset: 2px;
}

.feedback__textarea {
    width: 100%;
    box-sizing: border-box;
    min-height: 96px;
    resize: vertical;
    border: 1px solid var(--kz-color-border-heavy);
    border-radius: 10px;
    padding: 11px 12px;
    font: inherit;
    font-size: 14px;
    line-height: 1.5;
    color: var(--kz-color-text);
    background: var(--kz-color-surface);
}

.feedback__textarea::placeholder {
    color: var(--kz-color-text-faint);
}

.feedback__textarea:focus-visible {
    outline: 2px solid var(--kz-color-action);
    outline-offset: 1px;
}

/* What gets attached.  Stating it plainly is what makes the payload
   defensible — and reassuring to an audience discussing burnout. */
.feedback__context {
    margin: 12px 0 0;
    padding: 10px 12px;
    background: var(--kz-color-bg-muted);
    border-radius: 8px;
    font-size: 11.5px;
    line-height: 1.55;
    color: var(--kz-color-text-muted);
}

.feedback__context strong {
    color: var(--kz-color-text-soft);
    font-weight: var(--kz-font-weight-medium);
}

.feedback__consent {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 12px;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--kz-color-text-muted);
    cursor: pointer;
}

.feedback__consent input {
    margin: 2px 0 0;
    accent-color: var(--kz-color-brand-navy);
}

.feedback__actions {
    margin-top: 18px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
}

.feedback__error {
    margin: 12px 0 0;
    font-size: 12.5px;
    color: var(--kz-color-mismatch);
}

.feedback__error[hidden] {
    display: none;
}

/* Sent state — replaces the form body rather than stacking a toast, so
   the dialog has one job at a time. */
.feedback__done {
    text-align: center;
    padding: 8px 0 4px;
}

.feedback__done-icon {
    width: 34px;
    height: 34px;
    margin: 0 auto 12px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--kz-color-bg-muted);
    color: var(--kz-color-action);
}

.feedback__done-icon svg {
    width: 17px;
    height: 17px;
}

.feedback__done p {
    margin: 0 0 4px;
    color: var(--kz-color-text-muted);
    font-size: 13.5px;
    line-height: 1.55;
}

@media (max-width: 480px) {
    .feedback__types {
        flex-direction: column;
    }
}
