/* ==========================================================================
   PopFace Quick Lead — quick-lead.css
   Плаваючі кнопки зв'язку + модальна форма швидкої відправки фото.
   Жодних inline-стилів у PHP/HTML.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Утиліти
   -------------------------------------------------------------------------- */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --------------------------------------------------------------------------
   Плаваючий блок
   -------------------------------------------------------------------------- */
.popface-floating-contact {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Підйом на 80px коли видимий мобільний бар калькулятора */
.popface-floating-contact.is-lifted {
    transform: translateY(-80px);
}

/* --------------------------------------------------------------------------
   Кнопки (базові)
   -------------------------------------------------------------------------- */
.popface-float-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    border: none;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.popface-float-btn svg {
    flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Кнопка Telegram
   -------------------------------------------------------------------------- */
.popface-float-btn--tg {
    background: linear-gradient(135deg, #2AABEE 0%, #229ED9 100%);
    box-shadow: 0 4px 16px rgba(34, 158, 217, 0.35);
}

.popface-float-btn--tg:hover,
.popface-float-btn--tg:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(34, 158, 217, 0.5);
    color: #fff;
    text-decoration: none;
}

/* --------------------------------------------------------------------------
   Кнопка Фото на оцінку
   -------------------------------------------------------------------------- */
.popface-float-btn--photo {
    background: linear-gradient(135deg, #FF385C 0%, #e02d50 100%);
    box-shadow: 0 4px 16px rgba(255, 56, 92, 0.35);
}

.popface-float-btn--photo:hover,
.popface-float-btn--photo:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 56, 92, 0.5);
    color: #fff;
}

/* --------------------------------------------------------------------------
   Мобільна адаптивність кнопок
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .popface-floating-contact {
        bottom: 20px;
        right: 16px;
        gap: 8px;
    }

    .popface-float-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .popface-float-btn__text {
        display: none;
    }

    .popface-float-btn {
        padding: 12px;
        border-radius: 50%;
        width: 48px;
        height: 48px;
        justify-content: center;
    }

    .popface-float-btn svg {
        width: 22px;
        height: 22px;
    }
}

/* --------------------------------------------------------------------------
   Модальне вікно — оверлей
   -------------------------------------------------------------------------- */
.popface-quick-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.popface-quick-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.popface-quick-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* --------------------------------------------------------------------------
   Модальне вікно — картка
   -------------------------------------------------------------------------- */
.popface-quick-modal-content {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 20px;
    padding: 32px 28px;
    width: 100%;
    max-width: 440px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
    transform: translateY(12px);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-overflow-scrolling: touch;
}

.popface-quick-modal.is-open .popface-quick-modal-content {
    transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Кнопка закриття
   -------------------------------------------------------------------------- */
.popface-quick-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
    padding: 0;
}

.popface-quick-modal-close:hover,
.popface-quick-modal-close:focus-visible {
    background: #e2e8f0;
    color: #1e293b;
}

/* --------------------------------------------------------------------------
   Заголовки модалки
   -------------------------------------------------------------------------- */
.popface-quick-modal-title {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    color: #0f172a;
    padding-right: 28px;
}

.popface-quick-modal-subtitle {
    margin: 0 0 20px;
    font-size: 14px;
    line-height: 1.5;
    color: #64748b;
}

/* --------------------------------------------------------------------------
   Повідомлення про результат
   -------------------------------------------------------------------------- */
.popface-quick-message {
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
}

.popface-quick-message--success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.popface-quick-message--error {
    background: #fff1f2;
    color: #9f1239;
    border: 1px solid #fecdd3;
}

/* --------------------------------------------------------------------------
   Поля форми
   -------------------------------------------------------------------------- */
.popface-quick-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.popface-quick-field:last-of-type {
    margin-bottom: 20px;
}

.popface-quick-field label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    line-height: 1.3;
}

.popface-quick-field input[type="text"],
.popface-quick-field input[type="email"],
.popface-quick-field textarea {
    width: 100%;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 15px;
    line-height: 1.4;
    color: #1e293b;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
    font-family: inherit;
}

.popface-quick-field input[type="text"]:focus,
.popface-quick-field input[type="email"]:focus,
.popface-quick-field textarea:focus {
    outline: none;
    border-color: #FF385C;
    box-shadow: 0 0 0 4px rgba(255, 56, 92, 0.12);
}

.popface-quick-field input.is-invalid,
.popface-quick-field textarea.is-invalid {
    border-color: #f43f5e;
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.12);
}

.popface-quick-field textarea {
    resize: vertical;
    min-height: 72px;
}

/* --------------------------------------------------------------------------
   Дропзона
   -------------------------------------------------------------------------- */
.popface-quick-dropzone {
    position: relative;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.popface-quick-dropzone:hover,
.popface-quick-dropzone:focus-visible,
.popface-quick-dropzone.is-dragover {
    border-color: #FF385C;
    background: #fff5f7;
}

.popface-quick-dropzone:focus-visible {
    outline: none;
}

.popface-quick-dropzone-text {
    font-size: 14px;
    color: #475569;
    line-height: 1.4;
}

.popface-quick-dropzone-sub {
    font-size: 12px;
    color: #94a3b8;
}

/* --------------------------------------------------------------------------
   Список вибраних файлів
   -------------------------------------------------------------------------- */
.popface-quick-file-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.popface-quick-file-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 12px;
    color: #475569;
    max-width: 180px;
}

.popface-quick-file-badge span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.popface-quick-file-badge-remove {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    border: none;
    background: none;
    cursor: pointer;
    color: #94a3b8;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color 0.15s ease, background 0.15s ease;
    line-height: 1;
    font-size: 14px;
}

.popface-quick-file-badge-remove:hover {
    color: #ef4444;
    background: #fee2e2;
}

/* --------------------------------------------------------------------------
   Кнопка відправки
   -------------------------------------------------------------------------- */
.popface-quick-submit {
    width: 100%;
    border: none;
    border-radius: 12px;
    padding: 14px;
    background: linear-gradient(135deg, #FF385C 0%, #e02d50 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity 0.2s ease, transform 0.2s ease;
    font-family: inherit;
    line-height: 1;
}

.popface-quick-submit:hover:not(:disabled) {
    opacity: 0.92;
    transform: translateY(-1px);
}

.popface-quick-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Спінер у кнопці */
.popface-quick-submit-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ql-spin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes ql-spin {
    to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   Адаптивність модалки
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
    .popface-quick-modal {
        padding: 0;
        align-items: flex-end;
    }

    .popface-quick-modal-content {
        border-radius: 20px 20px 0 0;
        max-height: 92vh;
        padding: 24px 20px;
    }
}
