/* Floating "Ask a question" widget — fixed at viewport vertical center while scrolling */

:root {
    --pyn-brand-teal: #00A79D;
    --pyn-brand-teal-hover: #009688;
    --pyn-brand-teal-focus: rgba(0, 167, 157, 0.12);
}

/* Hide Plax back-to-top white circle (overlaps FAB) */
.progress-wrap {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.pyn-ask-widget,
.pyn-ask-widget.pyn-ask-widget--pinned {
    position: fixed;
    top: 50vh;
    right: 24px;
    bottom: auto;
    left: auto;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
    font-family: 'Inter', sans-serif;
    pointer-events: none;
    margin: 0;
    transform: translateY(-50%);
    will-change: top, transform;
}

.pyn-ask-widget .pyn-ask-fab,
.pyn-ask-widget .pyn-ask-panel {
    pointer-events: auto;
}

.pyn-ask-panel {
    display: none;
    position: absolute;
    right: 0;
    bottom: calc(100% + 12px);
    top: auto;
    width: 420px;
    max-width: calc(100vw - 48px);
    max-height: min(560px, calc(100dvh - 120px));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    border: 1px solid #E5EAE8;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(11, 21, 18, 0.12), 0 2px 8px rgba(11, 21, 18, 0.06);
    padding: 24px;
    box-sizing: border-box;
}

.pyn-ask-widget.is-open {
    top: auto !important;
    bottom: 24px;
    transform: none !important;
}

.pyn-ask-widget.is-open .pyn-ask-fab {
    display: none;
}

.pyn-ask-widget.is-open .pyn-ask-panel {
    display: block;
    position: relative;
    right: auto;
    bottom: auto;
    top: auto;
    max-height: min(560px, calc(100dvh - 48px));
}

.pyn-ask-panel-head {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.pyn-ask-panel-head h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 22px;
    color: #0B1512;
}

.pyn-ask-close {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1.5px solid #C5CDCA;
    border-radius: 999px;
    background: #F5F8F7;
    color: #0B1512;
    font-size: 24px;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(11, 21, 18, 0.1);
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.pyn-ask-close:hover,
.pyn-ask-close:focus-visible {
    background: #E5EAE8;
    border-color: #45514C;
    color: #0B1512;
    box-shadow: 0 2px 8px rgba(11, 21, 18, 0.14);
    outline: none;
}

.pyn-ask-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pyn-ask-field {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.pyn-ask-field label {
    font-size: 12px;
    font-weight: 600;
    line-height: 15px;
    color: #0B1512;
}

.pyn-ask-required {
    color: #DC2626;
    margin-left: 2px;
    font-weight: 600;
}

.pyn-ask-field input,
.pyn-ask-field select,
.pyn-ask-field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #E5EAE8;
    border-radius: 8px;
    background: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 20px;
    color: #0B1512;
    outline: none;
}

.pyn-ask-field input::placeholder,
.pyn-ask-field textarea::placeholder {
    color: #9CA3AF;
}

.pyn-ask-field input:focus,
.pyn-ask-field select:focus,
.pyn-ask-field textarea:focus {
    border-color: var(--pyn-brand-teal);
    box-shadow: 0 0 0 2px var(--pyn-brand-teal-focus);
}

.pyn-ask-field select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2345514C' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

.pyn-ask-field textarea {
    min-height: 96px;
    resize: vertical;
}

.pyn-ask-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 46px;
    padding: 12px 20px;
    border: none;
    border-radius: 999px;
    background: var(--pyn-brand-teal);
    background-color: #00A79D !important;
    background-image: none !important;
    color: #fff !important;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    cursor: pointer;
    box-shadow: none;
}

.pyn-ask-submit:hover,
.pyn-ask-submit:focus,
.pyn-ask-submit:active {
    background: var(--pyn-brand-teal);
    background-color: #00A79D !important;
    background-image: none !important;
    color: #FFFFFF !important;
    filter: none !important;
    transform: none !important;
}

.pyn-ask-submit img {
    display: block;
    flex-shrink: 0;
}

.pyn-ask-privacy-note,
.pyn-ask-disclaimer {
    margin: 12px 0 0;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    color: #6B7280;
}

.pyn-ask-feedback {
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 4px;
}

.pyn-ask-feedback--success {
    background: #E7F6EF;
    border: 1px solid rgba(0, 167, 157, 0.25);
    color: #0B1512;
}

.pyn-ask-feedback--error {
    background: #FEF2F2;
    border: 1px solid rgba(220, 38, 38, 0.2);
    color: #7F1D1D;
}

.pyn-ask-submit:disabled {
    opacity: 0.7;
    cursor: wait;
}

.pyn-ask-fab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    height: 46px;
    box-sizing: border-box;
    border: none;
    border-radius: 999px;
    background: var(--pyn-brand-teal);
    background-color: #00A79D !important;
    background-image: none !important;
    color: #FFFFFF !important;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 14px;
    line-height: 20px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 167, 157, 0.35), 0 2px 8px rgba(11, 21, 18, 0.12);
    white-space: nowrap;
    filter: none;
    opacity: 1;
    -webkit-appearance: none;
    appearance: none;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    position: relative;
    pointer-events: auto;
}

.pyn-ask-fab:hover,
.pyn-ask-fab:focus,
.pyn-ask-fab:active {
    background: var(--pyn-brand-teal);
    background-color: #00A79D !important;
    background-image: none !important;
    color: #FFFFFF !important;
    box-shadow: 0 12px 28px rgba(0, 167, 157, 0.4), 0 4px 12px rgba(11, 21, 18, 0.14);
    filter: none;
    opacity: 1;
    transform: translateY(-2px);
}

.pyn-ask-fab img {
    display: block;
    flex-shrink: 0;
}

@media (max-width: 767px) {
    .pyn-ask-widget,
    .pyn-ask-widget.pyn-ask-widget--mobile-bottom {
        top: auto;
        bottom: 16px;
        right: 16px;
        left: auto;
        transform: none;
        align-items: flex-end;
    }

    .pyn-ask-widget.is-open {
        top: auto !important;
        bottom: 16px;
        transform: none !important;
    }

    .pyn-ask-widget.is-open .pyn-ask-panel {
        max-height: min(560px, calc(100dvh - 32px));
    }

    .pyn-ask-panel {
        width: 100%;
        max-width: none;
    }

    .pyn-ask-fab {
        align-self: flex-end;
        width: fit-content;
    }
}
