/* ------------------------------------------------------------------
   Site-wide participant feedback widget.

   Everything is prefixed .ukn-fb- and every rule sets the properties it
   depends on, because this loads on top of Bootstrap 3 and a lot of
   older page CSS. Nothing here leaks outside the widget.

   z-index map: tab 1030, invite 1031 (below BS3 modal backdrop at 1040,
   so the tab cannot float over an open site modal); scrim 1055 and
   panel 1056 (above BS3 modals, and only ever open on user action).
   ------------------------------------------------------------------ */

.ukn-fb,
.ukn-fb *,
.ukn-fb *:before,
.ukn-fb *:after {
    box-sizing: border-box;
}

.ukn-fb {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    color: #2f3d45;
}

@media print {
    .ukn-fb { display: none !important; }
}

/* ---------- the tab ---------- */

.ukn-fb-tab {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1030;

    margin: 0;
    padding: 16px 9px;
    border: 0;
    border-radius: 7px 0 0 7px;

    background: #009ee3;
    color: #fff;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;

    cursor: pointer;
    box-shadow: -2px 0 12px -2px rgba(0, 60, 90, 0.35);

    writing-mode: vertical-rl;
    -webkit-writing-mode: vertical-rl;
    -ms-writing-mode: tb-rl;

    display: flex;
    align-items: center;
    gap: 8px;

    transition: padding-right 0.16s ease, background-color 0.16s ease;
}

.ukn-fb-tab:hover,
.ukn-fb-tab:focus {
    background: #0079ad;
    padding-right: 14px;
    color: #fff;
    outline: none;
}

.ukn-fb-tab:focus-visible {
    outline: 3px solid #ffc16b;
    outline-offset: -3px;
}

.ukn-fb-tab svg {
    transform: rotate(90deg);
    flex: none;
}

/* IE11 and any browser without writing-mode: fall back to a corner pill. */
@supports not (writing-mode: vertical-rl) {
    .ukn-fb-tab {
        top: auto;
        bottom: 20px;
        right: 20px;
        transform: none;
        border-radius: 22px;
        padding: 11px 18px;
        writing-mode: horizontal-tb;
    }
    .ukn-fb-tab svg { transform: none; }
}

@media (max-width: 767px) {
    .ukn-fb-tab {
        padding: 12px 7px;
        font-size: 11.5px;
    }
}

/* ---------- one-time invite ---------- */

.ukn-fb-invite {
    position: fixed;
    right: 44px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1031;

    width: 280px;
    padding: 15px 16px;
    background: #fff;
    border: 1px solid #dde5e9;
    border-left: 3px solid #009ee3;
    border-radius: 8px 0 0 8px;
    box-shadow: 0 3px 24px -4px rgba(0, 45, 70, 0.28);

    animation: ukn-fb-slide 0.28s cubic-bezier(0.22, 0.8, 0.3, 1);
}

@keyframes ukn-fb-slide {
    from { opacity: 0; transform: translateY(-50%) translateX(24px); }
    to   { opacity: 1; transform: translateY(-50%) translateX(0); }
}

.ukn-fb-invite h4 {
    margin: 0 0 6px;
    padding: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    color: #16242b;
}

.ukn-fb-invite p {
    margin: 0 0 11px;
    padding: 0;
    font-size: 13px;
    line-height: 1.45;
    color: #5a6b74;
}

.ukn-fb-invite-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ukn-fb-invite-x {
    position: absolute;
    top: 6px;
    right: 8px;
    padding: 2px 6px;
    background: none;
    border: 0;
    border-radius: 4px;
    color: #8b9aa3;
    font-size: 19px;
    line-height: 1;
    cursor: pointer;
}

.ukn-fb-invite-x:hover { background: #eef3f6; color: #16242b; }

@media (max-width: 767px) {
    .ukn-fb-invite {
        right: 10px;
        left: 10px;
        width: auto;
        top: auto;
        bottom: 16px;
        transform: none;
        border-radius: 8px;
        border-left-width: 3px;
        animation: none;
    }
}

.ukn-fb-btn {
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 13px;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    line-height: 1.3;
}

.ukn-fb-btn-solid { background: #009ee3; color: #fff; }
.ukn-fb-btn-solid:hover { background: #0079ad; color: #fff; }

.ukn-fb-btn-plain { background: transparent; color: #5a6b74; border-color: #dde5e9; }
.ukn-fb-btn-plain:hover { background: #eef3f6; color: #16242b; }

/* ---------- panel ---------- */

.ukn-fb-scrim {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: 1055;
    background: rgba(9, 22, 30, 0.45);
}

.ukn-fb-panel {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    z-index: 1056;

    width: 420px;
    max-width: 94%;
    background: #fff;
    border-left: 1px solid #dde5e9;
    box-shadow: -8px 0 40px -12px rgba(0, 30, 50, 0.42);

    display: flex;
    flex-direction: column;

    animation: ukn-fb-panel-in 0.24s cubic-bezier(0.22, 0.8, 0.3, 1);
}

@keyframes ukn-fb-panel-in {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
    .ukn-fb-panel,
    .ukn-fb-invite { animation: none; }
    .ukn-fb-tab { transition: none; }
}

.ukn-fb-head {
    flex: none;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 18px 20px 15px;
    border-bottom: 1px solid #e4ebee;
}

.ukn-fb-head h3 {
    margin: 0 0 4px;
    padding: 0;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
    color: #16242b;
}

.ukn-fb-head p {
    margin: 0;
    padding: 0;
    font-size: 13px;
    line-height: 1.45;
    color: #5a6b74;
}

.ukn-fb-close {
    margin-left: auto;
    flex: none;
    padding: 2px 8px;
    background: none;
    border: 0;
    border-radius: 5px;
    color: #8b9aa3;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.ukn-fb-close:hover { background: #eef3f6; color: #16242b; }

.ukn-fb-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 18px 20px 22px;
}

.ukn-fb-field { margin-bottom: 17px; }

.ukn-fb-label {
    display: block;
    margin: 0 0 7px;
    font-size: 12.5px;
    font-weight: 700;
    color: #16242b;
}

.ukn-fb-label span {
    font-weight: 400;
    color: #8b9aa3;
}

.ukn-fb-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ukn-fb-chip {
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 500;
    padding: 6px 12px;
    border: 1px solid #dde5e9;
    border-radius: 15px;
    background: transparent;
    color: #5a6b74;
    cursor: pointer;
    line-height: 1.3;
    transition: border-color 0.13s, color 0.13s, background-color 0.13s;
}

.ukn-fb-chip:hover { border-color: #009ee3; color: #16242b; }

.ukn-fb-chip[aria-pressed="true"] {
    background: #e6f6fd;
    border-color: #009ee3;
    color: #0079ad;
    font-weight: 600;
}

.ukn-fb-input,
.ukn-fb-textarea {
    display: block;
    width: 100%;
    font-family: inherit;
    font-size: 13.5px;
    line-height: 1.45;
    color: #2f3d45;
    background: #fff;
    padding: 9px 11px;
    border: 1px solid #dde5e9;
    border-radius: 7px;
    box-shadow: none;
}

.ukn-fb-textarea { resize: vertical; min-height: 108px; }

.ukn-fb-input:focus,
.ukn-fb-textarea:focus {
    border-color: #009ee3;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 158, 227, 0.14);
}

.ukn-fb-input.ukn-fb-bad,
.ukn-fb-textarea.ukn-fb-bad { border-color: #b94a48; }

.ukn-fb-duo { display: flex; gap: 10px; }
.ukn-fb-duo > div { flex: 1 1 0; min-width: 0; }

@media (max-width: 480px) {
    .ukn-fb-duo { display: block; }
    .ukn-fb-duo > div + div { margin-top: 12px; }
}

/* honeypot: off-screen rather than display:none, which some bots skip */
.ukn-fb-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.ukn-fb-identity {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 12px;
    background: #e6f6fd;
    border: 1px solid #a9dff6;
    border-radius: 8px;
}

.ukn-fb-avatar {
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #009ee3;
    color: #fff;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 34px;
    text-align: center;
}

.ukn-fb-who {
    font-size: 13px;
    font-weight: 600;
    color: #16242b;
    line-height: 1.35;
    word-break: break-word;
}

.ukn-fb-sub {
    font-size: 11.5px;
    color: #5a6b74;
    line-height: 1.35;
    word-break: break-word;
}

.ukn-fb-tag {
    margin-left: auto;
    flex: none;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #0079ad;
    text-align: right;
    line-height: 1.3;
}

.ukn-fb-turnstile { margin-bottom: 17px; min-height: 0; }

.ukn-fb-submit {
    display: block;
    width: 100%;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 700;
    padding: 12px;
    border: 0;
    border-radius: 8px;
    background: #009ee3;
    color: #fff;
    cursor: pointer;
}

.ukn-fb-submit:hover { background: #0079ad; }
.ukn-fb-submit[disabled] { opacity: 0.6; cursor: default; }

.ukn-fb-error {
    margin: 0 0 14px;
    padding: 10px 12px;
    background: #f9e6e6;
    border: 1px solid #e4b9b8;
    border-radius: 7px;
    color: #953b39;
    font-size: 12.5px;
    line-height: 1.45;
}

.ukn-fb-ctx {
    margin-top: 15px;
    padding-top: 13px;
    border-top: 1px dashed #e0e7ea;
    font-size: 11.5px;
    line-height: 1.5;
    color: #8b9aa3;
}

.ukn-fb-ctx code {
    display: block;
    margin-top: 3px;
    padding: 0;
    background: none;
    border: 0;
    font-size: 11px;
    color: #5a6b74;
    word-break: break-all;
}

/* ---------- done ---------- */

.ukn-fb-done {
    padding: 46px 28px;
    text-align: center;
}

.ukn-fb-done-mark {
    width: 50px;
    height: 50px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: #dff0d8;
    color: #3c763d;
    font-size: 24px;
    font-weight: 700;
    line-height: 50px;
}

.ukn-fb-done h3 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 700;
    color: #16242b;
}

.ukn-fb-done p {
    margin: 0 auto 18px;
    max-width: 32ch;
    font-size: 13.5px;
    line-height: 1.55;
    color: #5a6b74;
}
