/* Кнопка и окно поддержки porodox.ru.
 *
 * Заменяет виджет мессенджера Т-Банка. Оформление повторяет стиль сайта:
 * жёлтый акцент #FFC42C, тёмный текст, скругления 8px.
 */

:root {
    --pd-accent: #FFC42C;
    --pd-dark: #111111;
    --pd-danger: #c0392b;
}

/* ---------- кнопка ---------- */

.pd-support-btn {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 9999;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 16px 16px 2px 16px;
    background: var(--pd-accent);
    color: var(--pd-dark);
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0, 0, 0, .1);
    transition: transform .18s ease, box-shadow .18s ease;
}

.pd-support-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, .16);
}

.pd-support-btn:active {
    transform: translateY(0);
}

.pd-support-btn:focus-visible {
    outline: 3px solid var(--pd-dark);
    outline-offset: 2px;
}

.pd-support-btn svg {
    width: 26px;
    height: 26px;
    fill: currentColor;
}

.pd-support-btn_open svg {
    opacity: .35;
}

/* ---------- окно ---------- */

.pd-support-panel {
    position: fixed;
    right: 18px;
    bottom: 88px;
    z-index: 9998;
    width: 340px;
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .18);
    font-family: "Open Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
    font-size: 14px;
    color: var(--pd-dark);
    animation: pd-support-in .16s ease-out;
}

.pd-support-panel[hidden] {
    display: none !important;
}

@keyframes pd-support-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.pd-support-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    background: var(--pd-dark);
    color: #fff;
    border-radius: 12px 12px 0 0;
}

.pd-support-title {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .2px;
}

.pd-support-close {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: background .15s ease;
}

.pd-support-close:hover {
    background: rgba(255, 255, 255, .22);
}

.pd-support-body {
    padding: 16px;
}

.pd-support-greeting {
    margin: 0 0 14px;
    color: #4a4a4a;
    line-height: 1.5;
}

.pd-support-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pd-support-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.pd-support-label {
    font-size: 12px;
    color: #6b6b6b;
}

.pd-support-input {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid #d8d8d8;
    border-radius: 8px;
    background: #fff;
    color: var(--pd-dark);
    font: inherit;
    box-sizing: border-box;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.pd-support-input:focus {
    outline: none;
    border-color: var(--pd-accent);
    box-shadow: 0 0 0 3px rgba(255, 196, 44, .25);
}

.pd-support-input_invalid {
    border-color: var(--pd-danger);
}

.pd-support-textarea {
    min-height: 96px;
    resize: vertical;
    line-height: 1.45;
}

/* ловушка для ботов: в пределах экрана, но не видна человеку */
.pd-support-trap {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.pd-support-error {
    margin: 0;
    padding: 8px 10px;
    border-left: 3px solid var(--pd-danger);
    border-radius: 6px;
    background: #fdeaea;
    color: #8f3b39;
    font-size: 12px;
    line-height: 1.4;
}

.pd-support-error[hidden] {
    display: none !important;
}

.pd-support-success {
    padding: 10px 12px;
    border-left: 3px solid #3f8f5b;
    border-radius: 6px;
    background: #eaf6ee;
    color: #2f6b44;
    line-height: 1.45;
}

.pd-support-success[hidden] {
    display: none !important;
}

.pd-support-submit {
    padding: 11px 16px;
    border: 0;
    border-radius: 8px;
    background: var(--pd-accent);
    color: var(--pd-dark);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: filter .15s ease, transform .15s ease;
}

.pd-support-submit:hover {
    filter: brightness(.96);
}

.pd-support-submit:active {
    transform: translateY(1px);
}

.pd-support-submit:disabled {
    opacity: .65;
    cursor: default;
    transform: none;
}

/* ---------- мобильный вид ---------- */

@media (max-width: 480px) {
    .pd-support-panel {
        right: 12px;
        left: 12px;
        bottom: 84px;
        width: auto;
    }

    .pd-support-btn {
        right: 12px;
        bottom: 12px;
    }
}
