/* style.css — личный кабинет VillaNet */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #e4effa;
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
}

a {
    text-decoration: none;
}

/* ========== Страница входа ========== */
.lk-auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lk-auth-container {
    width: 100%;
    max-width: 420px;
}

.lk-auth-card {
    background: #ffffff;
    border-radius: 28px;
    box-shadow: 0 20px 35px -8px rgba(28, 65, 112, 0.15);
    padding: 40px 35px;
    text-align: center;
    border: 1px solid rgba(70, 130, 200, 0.2);
}

.lk-auth-logo {
    display: block;
    margin-bottom: 20px;
}

.lk-auth-logo img {
    height: 50px;
    width: auto;
}

.lk-auth-card h1 {
    font-size: 1.5rem;
    color: #123456;
    margin-bottom: 8px;
}

.lk-auth-desc {
    font-size: 0.9rem;
    color: #5f8bb3;
    margin-bottom: 24px;
    line-height: 1.4;
}

.lk-auth-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b13e3e;
    padding: 12px 16px;
    border-radius: 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
}

.lk-auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.lk-auth-form .lk-btn {
    width: 100%;
    justify-content: center;
    padding: 16px 24px;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 12px rgba(29, 95, 158, 0.3);
    transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
}

.lk-auth-form .lk-btn:hover {
    box-shadow: 0 6px 18px rgba(29, 95, 158, 0.4);
}

.lk-field {
    position: relative;
}

.lk-field i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #8ba9cc;
    font-size: 1rem;
}

.lk-field input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    border: 1px solid #bdd6f2;
    border-radius: 30px;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    background: #f8fcff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.lk-field input:focus {
    border-color: #1d5f9e;
    box-shadow: 0 0 0 3px rgba(29, 95, 158, 0.1);
}

.lk-auth-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: center;
}

.lk-auth-links a {
    color: #1d5f9e;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.lk-auth-links a:hover {
    color: #123456;
}

.lk-auth-back {
    color: #5f8bb3 !important;
    font-size: 0.85rem !important;
}

.lk-auth-back:hover {
    color: #123456 !important;
}

/* ========== Кабинет ========== */
.lk-app {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
}

.lk-header {
    background: #ffffff;
    border-radius: 28px;
    box-shadow: 0 20px 35px -8px rgba(28, 65, 112, 0.15);
    border: 1px solid rgba(70, 130, 200, 0.2);
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.lk-header-logo img {
    height: 40px;
    width: auto;
}

.lk-header-user {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #1d4a77;
    font-weight: 500;
    font-size: 0.95rem;
}

.lk-header-user i {
    font-size: 1.4rem;
    color: #1d5f9e;
}

.lk-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lk-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    font-family: 'Inter', sans-serif;
    transition: background 0.2s, transform 0.1s;
    text-decoration: none;
}

.lk-btn:active {
    transform: scale(0.98);
}

.lk-btn-primary {
    background: #1d5f9e;
    color: white;
}

.lk-btn-primary:hover {
    background: #154a7a;
}

.lk-btn-outline {
    background: transparent;
    color: #1d5f9e;
    border: 1px solid #1d5f9e;
}

.lk-btn-outline:hover {
    background: #e3f0ff;
}

.lk-btn-danger {
    background: #EF4444;
    color: white;
}

.lk-btn-danger:hover {
    background: #DC2626;
}

/* ========== Карточки ========== */
.lk-dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.lk-card {
    background: #ffffff;
    border-radius: 28px;
    box-shadow: 0 20px 35px -8px rgba(28, 65, 112, 0.15);
    border: 1px solid rgba(70, 130, 200, 0.2);
    padding: 28px 30px;
}

.lk-card-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #f2f8ff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    font-size: 1.3rem;
    color: #1d5f9e;
}

.lk-card-label {
    font-size: 0.8rem;
    color: #8ba9cc;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.lk-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: #123456;
    margin-bottom: 4px;
}

.balance-positive {
    color: #10B981;
}

.balance-negative {
    color: #EF4444;
}

.lk-card-sub {
    font-size: 0.85rem;
    color: #1d4a77;
    margin-top: 8px;
    line-height: 1.5;
}

.lk-card-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.lk-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed #e0ecff;
    font-size: 0.9rem;
}

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

.lk-detail-label {
    color: #5f8bb3;
}

.lk-detail-value {
    color: #1d4a77;
    font-weight: 500;
    text-align: right;
}

/* ========== Кнопки действий ========== */
.lk-pending {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 16px;
    padding: 14px 20px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #92400e;
    font-size: 0.9rem;
    line-height: 1.5;
}

.lk-pending i {
    font-size: 1.3rem;
    color: #f59e0b;
    flex-shrink: 0;
}

.lk-pending p {
    margin: 2px 0;
}

.lk-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.lk-action-btn {
    padding: 18px 12px;
    font-size: 1rem;
    justify-content: center;
    width: 100%;
}

.lk-btn-warning {
    background: #f59e0b;
    color: #fff;
    border: none;
}

.lk-btn-warning:hover {
    background: #d97706;
}

.lk-credit-active {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 18px 12px;
    font-size: 1rem;
    font-weight: 600;
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
    border-radius: 12px;
    width: 100%;
}

/* ========== Модалка: закрыть ========== */
.lk-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #aaa;
    line-height: 1;
}

.lk-modal-close:hover {
    color: #333;
}

/* ========== Модалка: оплата ========== */
.lk-modal {
    position: relative;
}

.lk-modal-amounts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 8px;
}

.lk-amount-chip {
    background: #f2f8ff;
    border: 2px solid #bdd6f2;
    border-radius: 30px;
    padding: 10px 20px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1d4a77;
    transition: all 0.2s;
    display: inline-block;
}

.lk-amount-chip:hover {
    border-color: #1d5f9e;
    background: #e3f0ff;
}

.lk-amount-chip.selected {
    border-color: #1d5f9e;
    background: #1d5f9e;
    color: white;
}

.lk-custom-amount {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.lk-custom-amount input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #bdd6f2;
    border-radius: 30px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    background: #f8fcff;
    outline: none;
}

.lk-custom-amount input:focus {
    border-color: #1d5f9e;
    box-shadow: 0 0 0 3px rgba(29, 95, 158, 0.1);
}

.lk-pay-action-btn {
    width: 100%;
    justify-content: center;
    margin-top: 16px;
    padding: 16px 24px;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 16px rgba(29, 95, 158, 0.35);
    transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
}
.lk-pay-action-btn:hover {
    box-shadow: 0 6px 22px rgba(29, 95, 158, 0.45);
}

/* ========== Модалка: тарифы ========== */
.lk-tariffs-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lk-tariff-card {
    background: #f8fcff;
    border: 2px solid #bdd6f2;
    border-radius: 16px;
    padding: 14px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: all 0.2s;
}

.lk-tariff-card:hover {
    border-color: #1d5f9e;
    background: #e3f0ff;
}

.lk-tariff-name {
    font-weight: 600;
    color: #123456;
    font-size: 0.95rem;
    min-width: 100px;
    text-align: left;
}

.lk-tariff-speed {
    color: #5f8bb3;
    font-size: 0.85rem;
}

.lk-tariff-price {
    font-weight: 700;
    color: #1d5f9e;
    font-size: 1rem;
    white-space: nowrap;
}

/* ========== Footer ========== */
.lk-footer {
    text-align: center;
    color: #6f8db0;
    font-size: 0.85rem;
    padding: 10px 0 20px;
}

.lk-footer a {
    color: #1d5f9e;
}

/* ========== Модальное окно ========== */
.lk-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.lk-modal-overlay.active {
    display: flex;
}

.lk-modal {
    background: #ffffff;
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 24px 48px rgba(18, 52, 86, 0.25), 0 0 0 1px rgba(29, 95, 158, 0.1);
    position: relative;
}

.lk-modal-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.lk-modal-icon.success {
    color: #10B981;
}

.lk-modal h3 {
    color: #123456;
    margin-bottom: 8px;
}

.lk-modal p {
    color: #1d4a77;
    font-size: 0.9rem;
    margin-bottom: 16px;
    line-height: 1.4;
}

/* ========== Статус ========== */
.lk-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.85rem;
}

.lk-status-active {
    background: #d1fae5;
    color: #065f46;
}

.lk-status-overdue {
    background: #fef3c7;
    color: #92400e;
}

.lk-status-blocked {
    background: #fee2e2;
    color: #991b1b;
}

/* ========== История операций ========== */
.lk-operations {
    background: #ffffff;
    border-radius: 28px;
    box-shadow: 0 20px 35px -8px rgba(28, 65, 112, 0.15);
    border: 1px solid rgba(70, 130, 200, 0.2);
    padding: 28px 30px;
    margin-bottom: 20px;
}

.lk-operations h3 {
    font-size: 1.1rem;
    color: #123456;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lk-operations h3 i {
    color: #1d5f9e;
}

.lk-operations-list {
    display: flex;
    flex-direction: column;
}

.lk-op-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid #eef4fc;
}

.lk-op-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.lk-op-row:first-child {
    padding-top: 0;
}

.lk-op-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.lk-op-credit {
    background: #d1fae5;
    color: #065f46;
}

.lk-op-debit {
    background: #fee2e2;
    color: #991b1b;
}

.lk-op-info {
    flex: 1;
    min-width: 0;
}

.lk-op-desc {
    font-size: 0.9rem;
    font-weight: 500;
    color: #1d4a77;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lk-op-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.78rem;
    color: #8ba9cc;
}

.lk-op-card {
    background: #f2f8ff;
    color: #5f8bb3;
    padding: 1px 8px;
    border-radius: 10px;
}

.lk-op-amount {
    font-weight: 700;
    font-size: 0.95rem;
    white-space: nowrap;
}
.lk-op-amount.lk-op-credit { color: #10B981; background: none; }
.lk-op-amount.lk-op-debit { color: #EF4444; background: none; }

/* ========== Адаптив ========== */
@media (max-width: 700px) {
    .lk-dashboard {
        grid-template-columns: 1fr;
    }

    .lk-actions {
        grid-template-columns: 1fr;
    }

    .lk-header {
        padding: 16px 20px;
    }

    .lk-card {
        padding: 20px;
    }
}

@media (max-width: 600px) {
    .lk-auth-card {
        padding: 30px 20px;
    }

    .lk-card-value {
        font-size: 1.6rem;
    }

    .lk-payment-amounts {
        gap: 8px;
    }

    .lk-amount-chip {
        padding: 8px 14px;
        font-size: 0.85rem;
    }
}

/* ========== Виджет ЮKassa: страховочный фон ========== */
.lk-widget-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: transparent;
    z-index: 9998;
}
.lk-widget-backdrop.active {
    display: block;
}

/* ========== Пагинация операций ========== */
.lk-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
}

.lk-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid #bdd6f2;
    color: #1d5f9e;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
    cursor: pointer;
}

.lk-page-btn:hover {
    background: #e3f0ff;
    border-color: #1d5f9e;
}

.lk-page-btn-disabled {
    color: #bdd6f2;
    border-color: #e4effa;
    cursor: default;
    pointer-events: none;
}

.lk-page-info {
    font-size: 0.85rem;
    color: #5f8bb3;
    font-weight: 500;
}

/* ========== Модалка: паспортные данные ========== */
.lk-passport-warning {
    max-width: 640px !important;
    text-align: left;
}

.lk-passport-modal {
    max-width: 780px !important;
    width: 600px;
    text-align: left;
    padding: 34px 36px;
}

.lk-passport-input {
    width: 100%;
    padding: 16px 20px !important;
    border: 1px solid #bdd6f2;
    border-radius: 30px;
    font-size: 1.05rem !important;
    font-family: 'Inter', sans-serif;
    background: #f8fcff;
    outline: none;
    box-sizing: border-box;
}

.lk-passport-input:focus {
    border-color: #1d5f9e;
    box-shadow: 0 0 0 3px rgba(29, 95, 158, 0.1);
}

.lk-passport-input.lk-passport-error {
    border-color: #EF4444;
}

.lk-passport-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.lk-date-row {
    flex-wrap: nowrap;
    align-items: center;
}

.lk-date-label {
    min-width: 110px;
    font-size: 14px;
    white-space: nowrap;
    color: #1d4a77;
}

.lk-date-input {
    flex: 1;
    min-width: 0;
}

.lk-passport-footer {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 4px;
}

.lk-passport-consent {
    font-size: 12px;
    line-height: 1.3;
    color: #5f8bb3;
}

.lk-photo-row {
    flex-wrap: nowrap;
}

.lk-photo-field {
    flex: 1;
    min-width: 0;
}

.lk-photo-btn {
    width: 100%;
    justify-content: center;
    padding: 10px 12px;
    font-size: 0.85rem;
}

.lk-photo-required {
    border-style: dashed;
    color: #1d5f9e;
    border-color: #1d5f9e;
}

.lk-photo-preview {
    margin-top: 6px;
    position: relative;
    display: inline-block;
}

.lk-photo-thumb {
    max-width: 100%;
    max-height: 90px;
    border-radius: 10px;
    border: 2px solid #bdd6f2;
    display: block;
}

.lk-photo-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    background: #EF4444;
    color: #fff;
    border-radius: 50%;
    font-size: 14px;
    line-height: 20px;
    text-align: center;
    cursor: pointer;
    font-weight: 700;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.lk-photo-remove:hover {
    background: #DC2626;
}

/* Dadata suggestions */
.lk-dadata-suggestions {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    margin-top: 2px !important;
    background: #fff;
    border: 2px solid #1d5f9e;
    border-radius: 0 0 12px 12px;
    max-height: 220px;
    overflow-y: auto;
    box-sizing: border-box;
    z-index: 9999;
    box-shadow: 0 8px 24px rgba(18, 52, 86, 0.25);
    display: none;
}

.lk-dadata-suggestions.active {
    display: block;
}

.lk-dadata-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
    color: #1d4a77;
    border-bottom: 1px solid #eef4fc;
}

.lk-dadata-item:hover {
    background: #e3f0ff;
    color: #123456;
}

.lk-dadata-item:last-child {
    border-bottom: none;
}

@media (max-width: 600px) {
    .lk-passport-row {
        flex-direction: column;
        gap: 10px;
    }
    .lk-date-row {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
    }
    .lk-photo-row {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
    }
    .lk-date-label {
        min-width: 90px;
        font-size: 13px;
    }
    .lk-passport-modal {
        padding: 20px 16px;
        width: 90%;
    }
    .lk-passport-warning {
        padding: 20px 16px;
    }
    .lk-passport-input {
        padding: 12px 16px;
        font-size: 0.95rem;
    }
    .lk-photo-btn {
        font-size: 0.8rem;
        padding: 8px 6px;
    }
}
