@charset "UTF-8";

:root {
    --bg-color: #0F0F11;
    --card-bg: rgba(28, 28, 30, 0.6);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-main: #FFFFFF;
    --text-muted: #8E8E93;
    --accent: #FFCC00;
    /* Таксомоторный желтый 🚕 */
    --accent-glow: rgba(255, 204, 0, 0.12);
    --success: #32D74B;
    --danger: #FF453A;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --safe-bottom: env(safe-area-inset-bottom, 20px);
}

/* Светлая тема */
:root[data-theme="light"] {
    --bg-color: #F2F2F7;
    --card-bg: rgba(255, 255, 255, 0.7);
    --card-border: rgba(0, 0, 0, 0.08);
    --text-main: #000000;
    --text-muted: #8A8A8E;
    --accent-glow: rgba(255, 204, 0, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-family);
    line-height: 1.5;
    min-height: 100vh;
    padding-bottom: var(--safe-bottom);
}

.container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Шапка с профилем */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.greeting h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.greeting p {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.logout-link {
    color: var(--danger);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}

.logout-link:active {
    opacity: 0.7;
}

.theme-toggle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 22px;
    transition: transform 0.2s, background 0.3s;
    outline: none;
    flex-shrink: 0;
    color: var(--text-main);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.theme-toggle:active {
    transform: scale(0.92);
}

/* Карточка баланса */
.balance-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 20px 20px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.balance-card::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -40px;
    width: 200px;
    height: 200px;
    background: var(--accent-glow);
    border-radius: 50%;
    filter: blur(50px);
    z-index: 0;
    pointer-events: none;
}

.balance-label {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
}

.balance-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.balance-amount {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    flex-shrink: 0;
}

.balance-amount.income { color: var(--success); }
.balance-amount.expense { color: var(--danger); }

.balance-btns {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.btn-mini {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 6px 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
    transition: background 0.2s;
}

.btn-mini:active {
    background: rgba(255,255,255,0.05);
}

.btn-mini.primary {
    background: #2FBF71;
    color: #fff;
    border: none;
}

.btn-mini.primary:hover {
    background: #27A863;
}

[data-theme="dark"] .btn-mini.primary {
    box-shadow: 0 0 10px rgba(47, 191, 113, 0.2);
}

.btn-withdraw:active {
    opacity: 0.8;
    transform: scale(0.98);
}

.car-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
}

.car-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.car-model {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.car-number-badge {
    display: inline-block;
    background: #000;
    color: #fff;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

[data-theme="light"] .car-number-badge {
    background: #F2F2F7;
    color: #000;
    border: 1px solid rgba(0,0,0,0.05);
}

.car-mileage-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--text-main);
    font-weight: 500;
}

.car-status-compact {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    margin-top: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.active { background: var(--success); box-shadow: 0 0 8px var(--success); }
.status-dot.blocked { background: var(--danger); box-shadow: 0 0 8px var(--danger); }

/* Универсальная инфо-карточка */
.info-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 12px;
}

.info-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--card-border);
}

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

.info-label {
    font-size: 14px;
    color: var(--text-main);
    font-weight: 500;
}

.info-value {
    font-size: 14px;
    font-weight: 600;
    text-align: right;
}

.info-value.success { color: var(--success); }
.info-value.warning { color: #ff9f43; }
.info-value.danger { color: var(--danger); }

.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
}

.status-active {
    background: rgba(40, 199, 111, 0.1);
    color: #28c76f;
    border: 1px solid rgba(40, 199, 111, 0.2);
}

.status-blocked {
    background: rgba(234, 84, 85, 0.1);
    color: #ea5455;
    border: 1px solid rgba(234, 84, 85, 0.2);
}

.status-reason {
    font-size: 11px;
    color: #ea5455;
    margin-top: 4px;
    font-weight: 500;
}

.insurance-list {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-top: 1px solid var(--card-border);
    padding-top: 10px;
}

.insurance-item {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    margin-bottom: 2px;
}

.ins-label {
    color: var(--text-muted);
    font-weight: 500;
}

.ins-date {
    color: var(--text-main);
    font-weight: 600;
}

.ins-date.expired {
    color: #ea5455;
}

.ins-date.warning {
    color: #ff9f43;
}

.card-section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 12px 0 8px;
    display: block;
}

.service-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}

.service-item {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    margin-bottom: 2px;
}

.service-label {
    color: var(--text-muted);
    font-weight: 500;
}

.service-value {
    color: var(--text-main);
    font-weight: 600;
}

.service-value.expired {
    color: #ea5455;
}

.service-value.warning {
    color: #ff9f43;
}

/* История транзакций */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
}

.transactions-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.transaction-item {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mini-header {
    display: flex;
    gap: 8px;
    padding: 2px 14px 4px;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.tx-col-balance {
    flex: 0 0 80px;
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
}

.tx-col-balance.income {
    color: var(--success);
}

.tx-col-balance.expense {
    color: var(--danger);
}

.tx-col-balance.neutral {
    color: var(--text-main);
}

.tx-col-amount {
    flex: 0 0 80px;
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
}

.tx-col-amount.income {
    color: var(--success);
}

.tx-col-amount.expense {
    color: var(--danger);
}

.tx-col-desc {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tx-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    word-break: break-word;
}

.tx-date {
    font-size: 11px;
    color: var(--text-muted);
}

.form-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 32px 24px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.login-icon {
    font-size: 48px;
    background: rgba(255, 255, 255, 0.05);
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--card-border);
    margin: 0 auto 20px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
}

.input-control {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 16px;
    color: var(--text-main);
    font-size: 16px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    text-align: center;
}

.input-control:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.1);
}

.btn-primary {
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: 14px;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}

.btn-primary:active {
    opacity: 0.8;
    transform: scale(0.98);
}

.error-msg {
    color: var(--danger);
    font-size: 14px;
    background: rgba(255, 69, 58, 0.1);
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
}
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 0 16px;
    height: 44px;
    border-radius: 22px;
    background: #F2F2F7;
    color: #1C1C1E;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    transform: translateY(20px) scale(0.8);
}

@media (min-width: 680px) {
    .back-to-top {
        right: calc(50% - 300px - 60px); /* 300px (половина контейнера) + 60px отступ */
    }
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

[data-theme="dark"] .back-to-top {
    background: #2C2C2E;
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.back-to-top:active {
    transform: scale(0.92);
}

/* --- Разблокировка авто на сутки --- */
.btn-unlock {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 12px 16px;
    border: none;
    border-radius: 12px;
    background: var(--accent);
    color: #1C1C1E;
    font-family: var(--font-family);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn-unlock:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.unlock-note {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--accent-glow);
    color: var(--text-main);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
}

/* Модалка подтверждения */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    width: 100%;
    max-width: 360px;
    background: var(--bg-color);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    transform: translateY(12px) scale(0.98);
    transition: transform 0.2s ease;
}

.modal-overlay.visible .modal-card {
    transform: translateY(0) scale(1);
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 10px;
}

.modal-text {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 20px;
}

.modal-text strong {
    color: var(--text-main);
}

.modal-btns {
    display: flex;
    gap: 10px;
}

.modal-btns .btn-mini {
    flex: 1;
    padding: 11px;
    font-size: 14px;
    text-align: center;
    cursor: pointer;
}
