﻿/* =========================================
   1. АНИМАЦИИ (Keyframes)
   ========================================= */
@keyframes fadeInPage {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modalBounce {
    0% {
        transform: translate(-50%, -50%) scale(0.7);
        opacity: 0;
    }

    70% {
        transform: translate(-50%, -50%) scale(1.03);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes slideUpMobile {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

@keyframes slideDownFade {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   2.  ИСХОДНЫЕ СТИЛИ (НЕ ТРОГАЕМ)
   ========================================= */
body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    margin: 20px 20px;
    box-sizing: border-box;
    animation: fadeInPage 0.8s ease-in-out;
}

.header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
}

.rounded-table {
    border-collapse: collapse;
    border-radius: 10px;
    overflow: hidden;
    border-style: hidden;
    box-shadow: 0 0 0 1px #ccc;
    width: 100%;
}

    .rounded-table th,
    .rounded-table td {
        border: 1px solid #ccc;
        padding: 8px;
        text-align: left;
    }

    .rounded-table thead {
        background-color: #f5f5f5;
    }

.logo {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 50%;
    margin-right: 20px;
}

.logo-img {
    width: 200px;
    height: 142.86px;
    display: block;
    margin: 0 auto;
    object-fit: contain;
}

.title {
    font-size: 24px;
    font-weight: bold;
    color: #3BB30F;
}

.invoice-info {
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th,
td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

th {
    background-color: #f2f2f2;
}

.total {
    background: none !important;
    padding: 15px 0;
    margin: 20px 0;
    font-weight: bold;
    text-align: right;
}

.payment-info {
    margin-top: 30px;
    line-height: 1.4;
}

.signature {
    margin-top: 40px;
    display: flex;
    justify-content: space-between;
}

/* БЛОК РЕЙТИНГА */
/* ===== RATING ===== */
.rating {
    margin-top: 32px;
    text-align: center;
    width: 100%;
}

    /* ===== STARS ===== */
    .rating .stars {
        display: inline-flex;
        gap: 8px;
        margin: 12px 0;
        user-select: none;
    }

    .rating .star {
        width: 40px;
        height: 40px;
        fill: #e0e0e0;
        cursor: pointer;
        transition: fill 0.2s ease, transform 0.15s ease;
    }

        .rating .star:hover {
            transform: scale(1.15);
        }

        .rating .star.active {
            fill: #f5c518; /* золотой */
            transform: scale(1.2);
        }

/* ===== COMMENT ===== */
.comment {
    margin-top: 24px;
    max-width: 100%;
}

    .comment label {
        display: block;
        margin-bottom: 8px;
        font-weight: 600;
        font-size: 15px;
        color: #333;
    }

    .comment textarea {
        width: 100%;
        box-sizing: border-box;
        padding: 14px 16px;
        border: 1px solid #dcdcdc;
        border-radius: 8px;
        font-family: inherit;
        font-size: 14px;
        resize: vertical;
        min-height: 110px;
        line-height: 1.5;
        transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }

        .comment textarea::placeholder {
            color: #999;
        }

        .comment textarea:focus {
            outline: none;
            border-color: #3BB30F;
            box-shadow: 0 0 0 3px rgba(59, 179, 15, 0.2);
        }

/* ===== PAY BUTTON ===== */
.btn-pay {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #3BB30F, #2ea40c);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 24px;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.3s ease;
}

    .btn-pay:hover {
        transform: translateY(-1px);
        box-shadow: 0 6px 16px rgba(59, 179, 15, 0.3);
    }

    .btn-pay:active {
        transform: translateY(0);
        box-shadow: 0 3px 8px rgba(59, 179, 15, 0.25);
    }

/* ===== DIVIDERS ===== */
.title-divider {
    border-bottom: 2px solid #111;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.payment-divider {
    border-bottom: 2px solid #111;
    padding-bottom: 16px;
    margin: 24px 0;
}

/* ===== MOBILE ===== */
@media (max-width: 650px) {

    .payment-options-grid {
        grid-template-columns: 1fr;
    }

    .payment-option-card {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        padding: 16px 18px;
        gap: 16px;
        min-height: auto;
        /* 🔥 убираем hover-эффекты на мобилке */
        transform: none !important;
    }

    .icon-placeholder {
        font-size: 24px;
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .option-title {
        font-size: 16px;
        line-height: 1.35;
        text-align: left;
        white-space: normal;
        word-break: break-word;
    }

        .option-title br {
            display: none;
        }
}

/* =========================================
   3.  МОДАЛКА И ОВЕРЛЕЙ
   ========================================= */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    z-index: 999;
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

    .modal-overlay.active {
        display: block;
        opacity: 1;
    }

.desktop-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    width: min(95vw, 1200px);
    max-height: 90vh;
    background: #ffffff;
    border-radius: 40px;
    padding: clamp(24px, 4vw, 80px);
    box-shadow: 0 40px 100px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

    .desktop-modal.active {
        opacity: 1;
        pointer-events: auto;
        visibility: visible;
        animation: modalBounce 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    }

.modal-content-wrapper {
    width: 100%;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.close-btn {
    position: absolute;
    top: 30px;
    right: 40px;
    font-size: 45px;
    cursor: pointer;
    color: #ccc;
    transition: all 0.4s ease;
    z-index: 1010;
}

    .close-btn:hover {
        color: #333;
        transform: rotate(90deg);
    }

/* =========================================
   4. МОБИЛЬНАЯ АДАПТАЦИЯ (ТАБЛИЦЫ)
   ========================================= */
@media (max-width: 768px) {
    body {
        margin: 15px 10px !important;
        overflow-x: hidden;
    }

    table {
        min-width: 600px;
        margin-bottom: 15px;
    }

    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100vw;
        margin-left: -10px;
    }

    .mobile-sheet {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1001;
        background: white;
        border-radius: 30px 30px 0 0;
        padding: 20px 20px 40px;
        transform: translateY(100%);
        transition: transform 0.5s cubic-bezier(0.32, 1, 0.23, 1);
        box-shadow: 0 -10px 30px rgba(0,0,0,0.1);
    }

        .mobile-sheet.active {
            transform: translateY(0);
            animation: slideUpMobile 0.5s ease;
        }

        .mobile-sheet .mobile-close {
            position: absolute;
            top: 15px;
            right: 20px;
            font-size: 30px;
            color: #999;
        }

    .swipe-indicator {
        width: 50px;
        height: 5px;
        background: #e0e0e0;
        border-radius: 10px;
        margin: 0 auto 20px;
    }

    .logo-img {
        width: 100px;
        height: 71.43px;
    }
}

/* =========================================
   5. СБЕРБИЗНЕС КНОПКА
   ========================================= */
.sber-business-btn {
    background-color: #107F8C;
    color: white;
    border: none;
    padding: 18px 24px;
    border-radius: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    font-size: 17px;
    font-weight: 700;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(16, 127, 140, 0.2);
}

    .sber-business-btn:hover {
        background-color: #21A19A;
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(16, 127, 140, 0.3);
    }

    .sber-business-btn:active {
        background-color: #005E7F !important;
        transform: scale(0.98);
        box-shadow: none;
    }

/* =========================================
   6. АНИМАЦИИ ВИДЖЕТОВ И КНОПОК
   ========================================= */

/* Контейнер кредитного виджета */
.credit-widget-section {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease, margin-top 0.35s ease;
    pointer-events: none;
}

    .credit-widget-section.show {
        max-height: 520px;
        opacity: 1;
        margin-top: 10px;
        pointer-events: auto;
    }

/* Обертка для кнопки входа (анимация скрытия при выборе кредита) */
.login-btn-anim-wrapper {
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, transform 0.3s ease;
}

    .login-btn-anim-wrapper.hidden {
        max-height: 0;
        opacity: 0;
        transform: translateY(10px);
        pointer-events: none;
    }

    .login-btn-anim-wrapper.visible {
        max-height: 140px;
        opacity: 1;
        transform: translateY(0);
    }

.fade-in {
    animation: slideDownFade 0.4s ease-out forwards;
}

/* =========================================
   7. НОВЫЙ ДИЗАЙН: СПИСОК БАНКОВ И ОПЦИИ
   ========================================= */

/* Контейнер списка банков */
.banks-list-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 800px;
    margin: 0 auto;
}

/* Единичный блок банка (Аккордеон) */
.bank-item {
    border: 1px solid #e6e6e6;
    border-radius: 20px;
    background: #fff;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

    .bank-item:hover {
        box-shadow: 0 10px 20px rgba(0,0,0,0.05);
        border-color: #d0d0d0;
    }

    /* Стиль открытого банка */
    .bank-item.open {
        border-color: #107F8C; /* Цвет Сбера */
        box-shadow: 0 0 0 1px #107F8C, 0 10px 30px rgba(16, 127, 140, 0.1);
    }

/* Заголовок банка (Кликабельный) */
.bank-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    cursor: pointer;
    background: #fff;
    user-select: none;
}

.bank-logo-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bank-name {
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.bank-arrow {
    font-size: 12px;
    color: #999;
    transition: transform 0.3s ease;
}

/* Контент внутри банка */
.bank-body {
    padding: 0 25px 30px 25px;
    animation: slideDownFade 0.3s ease-out;
}

/* СЕТКА ВАРИАНТОВ ОПЛАТЫ (3 колонки) */
.payment-options-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 10px;
}

/* КАРТОЧКА ВАРИАНТА ОПЛАТЫ */
.payment-option-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px 10px;
    background: #f9f9f9;
    border: 2px solid transparent;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 120px;
}

    .payment-option-card:hover {
        background: #f0f0f0;
        transform: translateY(-2px);
    }

    /* Активное (выбранное) состояние */
    .payment-option-card.selected {
        background: rgba(16, 127, 140, 0.06);
        border-color: #107F8C;
        box-shadow: 0 8px 20px rgba(16, 127, 140, 0.15);
    }

/* Элементы внутри карточки */
.icon-placeholder {
    font-size: 28px;
    margin-bottom: 12px;
}

.option-title {
    font-size: 14px;
    line-height: 1.3;
    font-weight: 600;
    color: #555;
}

.payment-option-card.selected .option-title {
    color: #107F8C;
}

/* Мобильная адаптация сетки */
@media (max-width: 650px) {
    .payment-options-grid {
        grid-template-columns: 1fr; /* Одна колонка на телефоне */
    }

    .payment-option-card {
        flex-direction: row; /* Иконка слева, текст справа */
        justify-content: flex-start;
        padding: 15px 20px;
        min-height: auto;
        gap: 20px;
        text-align: left;
    }

    .icon-placeholder {
        margin-bottom: 0;
        font-size: 24px;
    }

    .option-title {
        font-size: 16px;
    }

        .option-title br {
            display: none; /* Убираем перенос строк на мобильном для красоты */
        }
}
/* ===== Overlay ===== */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    z-index: 999999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: all;
}

.loading-text {
    margin-top: 12px;
    font-size: 18px;
}

/* ===== Блокировка прокрутки БЕЗ JS ===== */
.page-root.loading {
    position: fixed;
    inset: 0;
    overflow: hidden;
}
