/* =========================================
   1. БАЗОВЫЕ НАСТРОЙКИ И ШРИФТЫ
   ========================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    background-color: #f4f7f9;
    color: #333;
    -webkit-font-smoothing: antialiased;
}

/* =========================================
   2. СТРАНИЦА АВТОРИЗАЦИИ (index.html)
   ========================================= */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #e0e5ec;
}

.main-block {
    width: 800px;
    height: 460px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
    display: flex;
}

.red-bg {
    position: absolute;
    top: 0;
    right: 0;
    width: 45%;
    height: 100%;
    background: linear-gradient(135deg, #cc0000 0%, #800000 100%);
    clip-path: polygon(25% 0, 100% 0, 100% 100%, 0% 100%);
    z-index: 1;
}

.logo {
    position: absolute;
    top: 40px;
    right: 50px;
    color: white;
    font-size: 50px;
    font-weight: bold;
    z-index: 5;
    text-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.photo {
    position: absolute;
    top: 100px;
    right: 45%;
    margin-right: -60px;
    width: 130px;
    height: 160px;
    background: #fff;
    padding: 5px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 5;
}

.photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.certification {
    position: absolute;
    top: 60px;
    left: 40px;
    font-size: 16px;
    font-weight: 700;
    color: #2c3e50;
    width: 40%;
    line-height: 1.4;
}

.scr {
    position: absolute;
    top: 160px;
    left: 40px;
    width: 320px;
    z-index: 2;
}

.input-field {
    background: #e8f0fe;
    border: 1px solid #cce0ff;
    border-radius: 4px;
    padding: 12px 15px;
    font-size: 15px;
    width: 100%;
    margin-bottom: 15px;
    outline: none;
    transition: 0.3s;
}

.input-field:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

.register-link {
    color: #20c997;
    cursor: pointer;
    text-decoration: underline;
    font-weight: bold;
    font-size: 15px;
}

/* === НОВЫЕ СТИЛИ РЕГИСТРАЦИИ e-id === */
.input-field-light { background: #fff; border: 1px solid #ddd; border-radius: 6px; padding: 10px 15px; font-size: 14px; width: 100%; margin-bottom: 10px; outline: none; color: #333; }
.input-field-light:focus { border-color: #007bff; }
.btn-grey { background: #f4f4f4; color: #aaa; border: 1px solid #ddd; padding: 8px 20px; border-radius: 6px; cursor: not-allowed; transition: 0.3s; font-weight: bold; }
.btn-grey.active { background: #007bff; color: #fff; border-color: #007bff; cursor: pointer; }
.btn-blue { background: #007bff; color: #fff; border: none; padding: 8px 20px; border-radius: 6px; cursor: pointer; font-weight: bold; }
.btn-text-blue { background: none; color: #007bff; border: none; padding: 8px 10px; cursor: pointer; font-weight: normal; }
.reg-avatar { width: 80px; height: 80px; background: #eee; margin-bottom: 10px; border-radius: 4px; overflow: hidden; margin-left: auto; margin-right: auto; }
.reg-avatar img { width: 100%; height: 100%; object-fit: cover; filter: blur(2px) grayscale(50%); }

/* =========================================
   3. ГЛАВНЫЙ КАРКАС КАБИНЕТА
   ========================================= */
.app-container {
    width: 100%;
    max-width: 500px;
    background: #fff;
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    margin: 0 auto;
    position: relative;
    padding-bottom: 50px;
}

.cab-header {
    display: flex;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    align-items: center;
}

.header-logo {
    display: flex;
    align-items: center;
}

.e-icon {
    width: 40px;
    height: 40px;
    border: 3px solid #ca0c0f;
    border-radius: 50%;
    color: #ca0c0f;
    font-size: 24px;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 10px;
}

.logo-text {
    font-weight: bold;
    font-size: 13px;
    line-height: 1.2;
}

.logo-text .red {
    color: #ca0c0f;
    font-size: 16px;
}

.header-links a {
    color: #0056b3;
    text-decoration: underline;
    margin-left: 10px;
    font-size: 14px;
    cursor: pointer;
}

/* =========================================
   4. ДАШБОРД И ИНФО-БЛОК
   ========================================= */
.dash-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.page-title {
    font-size: 28px;
    color: #ca0c0f;
    font-weight: normal;
    margin: 0;
}

.dash-icons {
    display: flex;
    gap: 15px;
    font-size: 24px;
    color: #ca0c0f;
    font-weight: bold;
}

.icon-alert {
    background: #ca0c0f;
    color: #fff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
}

.info-block {
    padding: 0 20px 15px 20px;
    font-size: 13px;
    line-height: 1.4;
    color: #000;
}

.info-block ul {
    margin-left: 20px;
    margin-top: 5px;
}

.info-block a {
    color: #ca0c0f;
    text-decoration: underline;
}

.ecr-rate {
    margin-top: 10px;
    font-size: 14px;
}

/* =========================================
   5. ВКЛАДКИ ТАРИФОВ
   ========================================= */
.tabs-head {
    display: flex;
    gap: 2px;
    padding: 0 10px;
}

.tab-btn {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    color: #fff;
    font-weight: bold;
    font-size: 14px;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    opacity: 0.35;
    transition: 0.2s;
}

.tab-btn.active {
    opacity: 1;
}

.color-lt { background: #b5b5b5; }
.color-pn { background: #1487e8; }
.color-bp { background: #f7931a; }
.color-sp { background: #ca0c0f; }
.color-rp { background: #26a17b; }
.color-np { background: #d0b3e1; }

.active-tab-bar {
    text-align: center;
    padding: 10px;
    color: #fff;
    font-weight: bold;
    font-size: 15px;
    margin: 0 10px 15px 10px;
}

/* =========================================
   6. БЛОК ПОЛЬЗОВАТЕЛЯ И БАЛАНСЫ
   ========================================= */
.hierarchy-block {
    padding: 15px 20px;
    background: #fff;
}

.referrer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
    margin-bottom: 10px;
}

.dots-btn {
    background: #ccc;
    color: #fff;
    border-radius: 10px;
    padding: 0 10px;
    font-weight: bold;
}

.user-row {
    display: flex;
    align-items: center;
    font-size: 16px;
}

.user-icon {
    color: #ca0c0f;
    font-size: 20px;
    margin-right: 10px;
}

.badges {
    margin-left: 10px;
    display: flex;
    gap: 5px;
}

.badge {
    background: #ca0c0f;
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
}

.btn-create-flow {
    background: linear-gradient(180deg, #FF4B33, #CA0C0F);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(202,12,15,0.4);
    font-size: 15px;
}

.grey-balances {
    background: #e6e6e6;
    margin-bottom: 20px;
}

.gb-row {
    display: flex;
    border-bottom: 1px solid #ccc;
    padding: 10px 20px;
    font-size: 12px;
}

.gb-left {
    flex: 1;
}

.gb-right {
    flex: 1;
    text-align: right;
    color: #333;
}

.gb-left b {
    font-size: 13px;
    color: #000;
}

.info-i {
    color: #ca0c0f;
    border: 1px solid #ca0c0f;
    border-radius: 50%;
    padding: 0 4px;
    font-size: 10px;
    cursor: pointer;
    margin-left: 3px;
}

/* =========================================
   7. ЛОТЕРЕЯ И QR
   ========================================= */
.lottery-block {
    text-align: center;
    padding: 20px;
}

.btn-lottery-outline {
    border: 2px solid #ca0c0f;
    color: #ca0c0f;
    background: transparent;
    padding: 10px 25px;
    border-radius: 30px;
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 20px;
    cursor: pointer;
}

.qr-code {
    width: 150px;
    height: 150px;
    border: 5px solid #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    display: block;
    margin: 0 auto;
}

/* =========================================
   8. КВИТАНЦИИ ПОТОКОВ
   ========================================= */
.receipt-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    margin-bottom: 25px;
    overflow: hidden;
}

.receipt-header {
    color: #fff;
    text-align: center;
    padding: 15px;
    font-size: 16px;
    font-weight: bold;
}

.receipt-body {
    padding: 10px 20px;
}

.r-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    align-items: center;
}

.r-row:last-child {
    border-bottom: none;
}

.r-row span {
    color: #666;
    font-weight: bold;
}

.r-row b {
    color: #000;
    font-weight: bold;
    font-size: 15px;
}

.icon-q {
    color: #ca0c0f;
    border: 1px solid #ca0c0f;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    margin-left: 5px;
}

.btn-claim-icon {
    border: 2px solid #e0b484;
    color: #e0b484;
    background: transparent;
    padding: 5px 25px;
    border-radius: 20px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
}

.btn-claim-icon.active {
    border-color: #f7931a;
    color: #f7931a;
}

.btn-claim-icon.disabled {
    border-color: #ddd;
    color: #ddd;
    cursor: not-allowed;
}

.receipt-footer {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafbfc;
    border-top: 1px solid #eee;
}

.btn-popolnit {
    border: 2px solid #f7931a;
    color: #f7931a;
    background: transparent;
    padding: 8px 25px;
    border-radius: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

/* =========================================
   9. КНОПКИ И ТАЙМЕРЫ 24 ЧАСА
   ========================================= */
.btn-red {
    background: linear-gradient(180deg, #FF4B33, #CA0C0F);
    border: none;
    color: #fff;
    padding: 15px;
    border-radius: 30px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(202,12,15,0.4), inset 0px -3px 5px rgba(0,0,0,0.2);
    transition: 0.2s;
}

.btn-green {
    background: linear-gradient(180deg, #01a001, #008700);
    border: none;
    color: #fff;
    padding: 15px;
    border-radius: 30px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,135,0,0.4);
    transition: 0.2s;
}

.w-100 {
    width: 100%;
}

.flow-timer {
    background: linear-gradient(180deg, #FF4B33, #CA0C0F);
    color: #fff;
    padding: 15px;
    border-radius: 30px;
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    box-shadow: inset 0 -3px 5px rgba(0,0,0,0.2), 0 4px 10px rgba(202,12,15,0.3);
    margin: 0;
    letter-spacing: 2px;
}

/* =========================================
   10. ФОРМЫ СОЗДАНИЯ ПОТОКОВ
   ========================================= */
.creation-form-box {
    border: 1px solid #f7931a;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 10px;
    background: #fff;
}

.radio-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    justify-content: center;
}

.radio-row label {
    font-weight: bold;
    font-size: 15px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.radio-row input {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    accent-color: #1487e8;
}

.input-label {
    font-size: 14px;
    color: #333;
    display: block;
    margin-bottom: 5px;
}

.input-group {
    display: flex;
    border: 1px solid #ccc;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.input-group input {
    flex: 1;
    border: none;
    padding: 12px 15px;
    font-size: 20px;
    outline: none;
}

.input-group span {
    padding: 12px 15px;
    font-weight: bold;
    font-size: 16px;
    background: #f8f8f8;
}

.calc-big-result {
    font-size: 32px;
    color: #333;
    font-weight: 300;
    margin-bottom: 10px;
}

.payment-buttons {
    padding: 0 10px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.btn-pay-kopilka {
    background: linear-gradient(180deg, #FF4B33, #CA0C0F);
    color: #fff;
    border: none;
    padding: 15px;
    border-radius: 30px;
    font-weight: bold;
    font-size: 16px;
    width: 80%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    position: relative;
    box-shadow: 0 4px 10px rgba(202,12,15,0.4);
}

.arrow-down {
    position: absolute;
    right: 20px;
    border-left: 1px solid rgba(255,255,255,0.3);
    padding-left: 15px;
}

/* =========================================
   11. ЭКРАН ПОДТВЕРЖДЕНИЯ ОПЛАТЫ
   ========================================= */
.back-btn {
    color: #ca0c0f;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 20px;
    display: inline-block;
}

.confirm-box {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 1px solid #eee;
}

.confirm-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    border-bottom: 1px dashed #ddd;
    padding-bottom: 10px;
    font-size: 16px;
}

/* =========================================
   12. УВЕДОМЛЕНИЯ (ТОСТЫ)
   ========================================= */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #fff;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    z-index: 9999;
    font-weight: bold;
    border-left: 5px solid;
}

/* =========================================
   13. МОБИЛЬНАЯ АДАПТАЦИЯ (МЕДИА-ЗАПРОСЫ)
   ========================================= */
@media screen and (max-width: 767px) {
    .auth-page {
        display: block;
        background: #f4f4f4;
    }
    .main-block {
        width: 100%;
        min-height: 100vh;
        border-radius: 0;
        box-shadow: none;
        display: block;
    }
    .red-bg {
        width: 100%;
        height: 260px;
        clip-path: polygon(0 0, 100% 0, 100% 60%, 0 100%);
    }
    .logo {
        top: 20px;
        right: 20px;
        font-size: 45px;
    }
    .photo {
        top: 120px;
        left: 30px;
        right: auto;
        margin-right: 0;
        width: 110px;
        height: 140px;
    }
    .certification {
        top: 290px;
        left: 30px;
        width: calc(100% - 60px);
        font-size: 15px;
    }
    .scr {
        top: 360px;
        left: 30px;
        width: calc(100% - 60px);
    }
}