/* help-center-feedback.css
 *
 * The feedback bar at the end of a help-center article card ("Was this article helpful?"). Plain CSS like
 * the rest of the help center: its states are switched by help-center-feedback.js at runtime, through
 * data-hc-feedback-state on the section and the hidden attribute on its parts.
 *
 * The provider's accent carries the answer the reader picks and nothing else: the question stays neutral,
 * the buttons turn accent on hover and when chosen. Every hard-coded colour has a `.dark` answer at the
 * bottom of the file.
 */

.hc-feedback {
    margin-top: 40px;
    padding-top: 28px;
    border-top: 1px solid #f4f4f5;
}

.hc-feedback-ask {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px 24px;
    padding: 18px 20px 18px 24px;
    border: 1px solid #e4e4e7;
    border-radius: 18px;
    background: linear-gradient(135deg, #fafafa 0%, #ffffff 100%);
}

.hc-feedback-question {
    margin: 0;
    color: #18181b;
    font-size: 15.5px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.hc-feedback-actions {
    display: flex;
    gap: 10px;
}


/* ---------- the two answers ---------- */

.hc-feedback-vote {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 18px 0 14px;
    border: 1px solid #e4e4e7;
    border-radius: 999px;
    background: #ffffff;
    color: #3f3f46;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition:
        border-color 0.15s ease,
        background-color 0.15s ease,
        color 0.15s ease,
        transform 0.15s ease;
}

.hc-feedback-vote:hover {
    border-color: var(--lw-widget-on-light, #4f46e5);
    background: var(--lw-widget-tint, #eef2ff);
    color: var(--lw-widget-on-light, #4f46e5);
    transform: translateY(-1px);
}

.hc-feedback-vote:active {
    transform: translateY(0) scale(0.97);
}

.hc-feedback-vote:focus-visible {
    outline: 2px solid var(--lw-widget-on-light, #4f46e5);
    outline-offset: 2px;
}

.hc-feedback-icon {
    flex: none;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* The thumb nods in the direction it points: up for yes, down for no. */
.hc-feedback-vote[data-hc-feedback-vote="up"]:hover .hc-feedback-icon {
    transform: translateY(-1px) rotate(-12deg);
}

.hc-feedback-vote[data-hc-feedback-vote="down"]:hover .hc-feedback-icon {
    transform: translateY(1px) rotate(-12deg);
}

.hc-feedback-vote[aria-pressed="true"] {
    border-color: var(--lw-widget-accent, #4f46e5);
    background: var(--lw-widget-accent, #4f46e5);
    color: var(--lw-widget-accent-contrast, #ffffff);
}

.hc-feedback-vote[aria-pressed="true"] .hc-feedback-icon {
    animation: hc-feedback-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Outline while the question is open, solid on the answer given. */
.hc-feedback-icon-solid,
.hc-feedback-vote[aria-pressed="true"] .hc-feedback-icon-outline {
    display: none;
}

.hc-feedback-vote[aria-pressed="true"] .hc-feedback-icon-solid {
    display: block;
}

.hc-feedback-vote:disabled {
    cursor: default;
}

.hc-feedback-error {
    flex-basis: 100%;
    margin: 0;
    color: #b91c1c;
    font-size: 13px;
}


/* ---------- after the vote ---------- */

/* Three columns: the green tick, the thanks with its line, the chat button vertically centred on the right.
   The tick is green whatever the provider's accent: it says "done", and that is not a brand colour. The
   accent stays on the one thing the reader can still act on, the chat button. */
.hc-feedback-thanks {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px 18px;
    padding: 18px 20px 18px 18px;
    border: 1px solid #e4e4e7;
    border-radius: 18px;
    background:
        radial-gradient(120% 140% at 0% 50%, rgba(16, 185, 129, 0.09) 0%, rgba(16, 185, 129, 0) 55%),
        #ffffff;
    animation: hc-feedback-in 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hc-feedback-thanks[hidden],
.hc-feedback-ask[hidden],
.hc-feedback-thanks-note[hidden],
.hc-feedback-chat-button[hidden] {
    display: none;
}

.hc-feedback-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: linear-gradient(145deg, #34d399 0%, #10b981 55%, #059669 100%);
    color: #ffffff;
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.14);
    animation: hc-feedback-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) 0.05s both;
}

/* The tick draws itself once the badge has landed. pathLength="1" on the path makes the dash exact. */
.hc-feedback-check path {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: hc-feedback-draw 0.35s ease-out 0.25s forwards;
}

.hc-feedback-thanks-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.hc-feedback-thanks-title {
    margin: 0;
    color: #18181b;
    font-size: 15.5px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.hc-feedback-thanks-note {
    margin: 0;
    color: #71717a;
    font-size: 14px;
    line-height: 1.5;
}

.hc-feedback-chat-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 16px 0 14px;
    border: 0;
    border-radius: 999px;
    background: var(--lw-widget-accent, #4f46e5);
    color: var(--lw-widget-accent-contrast, #ffffff);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: transform 0.15s ease, filter 0.15s ease;
}

.hc-feedback-chat-button:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
}

.hc-feedback-chat-button:active {
    transform: translateY(0) scale(0.98);
}

.hc-feedback-chat-button:focus-visible {
    outline: 2px solid var(--lw-widget-on-light, #4f46e5);
    outline-offset: 3px;
}

.hc-feedback-chat-arrow {
    transition: transform 0.2s ease;
}

.hc-feedback-chat-button:hover .hc-feedback-chat-arrow {
    transform: translateX(3px);
}

/* A vote remembered from an earlier visit is shown as it is: no entrance, no pop, no drawing tick. */
.hc-feedback[data-hc-feedback-restored] .hc-feedback-thanks,
.hc-feedback[data-hc-feedback-restored] .hc-feedback-check {
    animation: none;
}

.hc-feedback[data-hc-feedback-restored] .hc-feedback-check path {
    animation: none;
    stroke-dashoffset: 0;
}

@media (max-width: 639.98px) {
    .hc-feedback-ask {
        padding: 16px 18px;
    }

    /* The button leaves the right edge for a full-width row under the text: a phone has no room beside it. */
    .hc-feedback-thanks {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .hc-feedback-chat-button {
        grid-column: 1 / -1;
        justify-content: center;
    }
}


/* ---------- motion ---------- */

@keyframes hc-feedback-in {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

@keyframes hc-feedback-pop {
    0% { transform: scale(0.6); }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

@keyframes hc-feedback-draw {
    to { stroke-dashoffset: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .hc-feedback-vote,
    .hc-feedback-icon,
    .hc-feedback-chat-button,
    .hc-feedback-chat-arrow {
        transition: none;
    }

    .hc-feedback-thanks,
    .hc-feedback-check,
    .hc-feedback-vote[aria-pressed="true"] .hc-feedback-icon {
        animation: none;
    }

    .hc-feedback-check path {
        animation: none;
        stroke-dashoffset: 0;
    }
}


/* ---------- dark scheme ---------- */

.dark .hc-feedback {
    border-top-color: #27272a;
}

.dark .hc-feedback-ask {
    border-color: #27272a;
    background: linear-gradient(135deg, #18181b 0%, #1f1f23 100%);
}

.dark .hc-feedback-question,
.dark .hc-feedback-thanks-title {
    color: #fafafa;
}

.dark .hc-feedback-vote {
    border-color: #3f3f46;
    background: #09090b;
    color: #d4d4d8;
}

.dark .hc-feedback-vote:hover {
    border-color: var(--lw-widget-on-dark, #a5b4fc);
    background: var(--lw-widget-tint-dark, #1e1b4b);
    color: var(--lw-widget-on-dark, #a5b4fc);
}

.dark .hc-feedback-vote[aria-pressed="true"] {
    border-color: var(--lw-widget-accent-dark, #6366f1);
    background: var(--lw-widget-accent-dark, #6366f1);
    color: var(--lw-widget-accent-contrast-dark, #ffffff);
}

.dark .hc-feedback-vote:focus-visible,
.dark .hc-feedback-chat-button:focus-visible {
    outline-color: var(--lw-widget-on-dark, #a5b4fc);
}

.dark .hc-feedback-error {
    color: #f87171;
}

.dark .hc-feedback-thanks {
    border-color: #27272a;
    background:
        radial-gradient(120% 140% at 0% 50%, rgba(16, 185, 129, 0.14) 0%, rgba(16, 185, 129, 0) 55%),
        #18181b;
}

.dark .hc-feedback-check {
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.18);
}

.dark .hc-feedback-thanks-note {
    color: #a1a1aa;
}

.dark .hc-feedback-chat-button {
    background: var(--lw-widget-accent-dark, #6366f1);
    color: var(--lw-widget-accent-contrast-dark, #ffffff);
}
