/* Чока Лока — Веб-ЛК. Бренд: Rubik, красный градиент. */

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
[v-cloak] { display: none; }
html, body { height: 100%; }
body {
    font-family: 'Rubik', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #f5f5f5;
    background: radial-gradient(ellipse at top, #4a1a20 0%, #1a0d10 100%);
    min-height: 100vh;
    padding-bottom: 40px;
    font-size: 16px;
    line-height: 1.4;
}

#app { max-width: 480px; margin: 0 auto; padding: 0 16px; }

/* ---------- HEADER ---------- */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 4px 16px;
}
.logo { font-size: 20px; font-weight: 700; color: #ffcccb; }
.btn-icon {
    background: rgba(255,255,255,0.08);
    border: none;
    color: #fff;
    width: 40px; height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: background .15s;
}
.btn-icon:active, .btn-icon:hover { background: rgba(255,255,255,0.15); }
.btn-icon.danger { color: #ff6b6b; }

.menu-drawer {
    background: rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 8px;
    margin-bottom: 12px;
    backdrop-filter: blur(10px);
}
.menu-item {
    padding: 14px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: background .15s;
    font-size: 15px;
}
.menu-item:active, .menu-item:hover { background: rgba(255,255,255,0.08); }
.menu-item.danger { color: #ff8080; margin-top: 4px; border-top: 1px solid rgba(255,255,255,0.08); }

/* ---------- CARDS ---------- */
.card {
    background: rgba(255,255,255,0.06);
    border-radius: 20px;
    padding: 24px 20px;
    margin-bottom: 16px;
    backdrop-filter: blur(10px);
    position: relative;
}
.auth-card { padding: 32px 24px; margin-top: 20px; }
.brand-hero { text-align: center; margin-bottom: 24px; }
.brand-emoji { font-size: 56px; margin-bottom: 12px; }
.brand-hero h1 { font-size: 22px; font-weight: 600; margin-bottom: 8px; color: #fff; }
.brand-hero .muted { font-size: 14px; }

h2 { font-size: 20px; font-weight: 600; margin-bottom: 8px; color: #fff; }
.muted { color: rgba(255,255,255,0.65); font-size: 14px; margin-bottom: 16px; }
.muted.small { font-size: 13px; margin-bottom: 12px; }
.hint { text-align: center; color: rgba(255,255,255,0.55); font-size: 13px; margin-top: 12px; }
.hint a { color: #ffcccb; text-decoration: none; }

.err {
    background: rgba(255,80,80,0.15);
    color: #ff9999;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
    margin-top: 12px;
}

/* ---------- INPUTS ---------- */
.label {
    display: block;
    font-size: 13px;
    color: rgba(255,255,255,0.65);
    margin: 14px 0 6px;
    font-weight: 500;
}
.input {
    width: 100%;
    background: rgba(0,0,0,0.25);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 16px;
    color: #fff;
    font-family: inherit;
    outline: none;
    transition: border-color .15s;
}
.input:focus { border-color: #ffcccb; }
.input::placeholder { color: rgba(255,255,255,0.35); }
.phone-input { font-size: 18px; letter-spacing: 0.5px; }
.code-input {
    font-size: 32px;
    letter-spacing: 12px;
    text-align: center;
    font-weight: 600;
    margin-top: 8px;
}
input[type="date"].input { color-scheme: dark; }

/* ---------- BUTTONS ---------- */
.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
    box-shadow: 0 4px 12px rgba(192,57,43,0.3);
    transition: transform .1s, box-shadow .1s;
    font-family: inherit;
}
.btn-primary:active { transform: translateY(1px); box-shadow: 0 2px 6px rgba(192,57,43,0.3); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }

.btn-secondary {
    width: 100%;
    background: transparent;
    color: #ffcccb;
    border: 2px dashed rgba(255,204,203,0.4);
    border-radius: 12px;
    padding: 12px;
    font-size: 15px;
    cursor: pointer;
    margin-top: 8px;
    font-family: inherit;
}
.btn-secondary:hover { background: rgba(255,204,203,0.08); }

.btn-outline {
    background: rgba(255,255,255,0.1);
    color: #fff;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-outline:hover { background: rgba(255,255,255,0.16); }

.btn-danger {
    width: 100%;
    background: transparent;
    color: #ff6b6b;
    border: 2px solid rgba(255,107,107,0.4);
    border-radius: 12px;
    padding: 14px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
}
.btn-back {
    background: none;
    border: none;
    color: #ffcccb;
    font-size: 15px;
    cursor: pointer;
    padding: 0 0 12px 0;
    font-family: inherit;
}

/* ---------- КАБИНЕТ ---------- */
.hero-card {
    background: linear-gradient(135deg, #c0392b 0%, #8b2a1f 100%);
    border-radius: 20px;
    padding: 24px 20px;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(192,57,43,0.25);
}
.hero-hi { font-size: 16px; opacity: 0.85; }
.hero-balance {
    font-size: 44px;
    font-weight: 700;
    margin-top: 4px;
    letter-spacing: -1px;
}
.hero-balance .unit {
    font-size: 16px;
    font-weight: 400;
    opacity: 0.75;
    margin-left: 6px;
    letter-spacing: 0;
}
.hero-level {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    background: rgba(0,0,0,0.2);
    padding: 8px 12px;
    border-radius: 10px;
    width: fit-content;
    font-size: 14px;
}
.lvl-cashback { opacity: 0.85; font-size: 13px; margin-left: 4px; }
.lvl-progress { margin-top: 14px; }
.lvl-bar {
    background: rgba(0,0,0,0.25);
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
}
.lvl-fill {
    background: linear-gradient(90deg, #f39c12, #f1c40f);
    height: 100%;
    transition: width .5s;
}
.lvl-hint { font-size: 12px; opacity: 0.75; margin-top: 6px; }

.tile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.tile {
    background: rgba(255,255,255,0.07);
    border-radius: 16px;
    padding: 20px 12px;
    text-align: center;
    cursor: pointer;
    transition: background .15s, transform .1s;
    position: relative;
}
.tile:active { transform: scale(0.98); background: rgba(255,255,255,0.12); }
.tile-emoji { font-size: 32px; margin-bottom: 8px; }
.tile-label { font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.9); }
.tile-badge {
    position: absolute;
    top: 8px; right: 8px;
    background: #e74c3c;
    color: #fff;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 600;
}

.messenger-hint {
    background: rgba(255,255,255,0.05);
    border-radius: 14px;
    padding: 16px;
    margin-top: 16px;
    text-align: center;
}
.mh-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.mh-text { font-size: 13px; color: rgba(255,255,255,0.6); margin-bottom: 12px; }
.mh-buttons { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.mh-buttons a { flex: 1 1 140px; min-width: 140px; }

/* ---------- ONBOARD ---------- */
.onboard-block {
    background: rgba(255,255,255,0.05);
    border-radius: 14px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}
.onboard-title { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.onboard-text { font-size: 14px; color: rgba(255,255,255,0.7); margin-bottom: 16px; line-height: 1.4; }
.onboard-buttons { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.onboard-buttons .btn-primary,
.onboard-buttons .btn-outline { width: 100%; text-align: center; display: inline-block; text-decoration: none; }

/* ---------- QR ---------- */
.qr-card { text-align: center; }
.qr-img {
    width: 100%;
    max-width: 300px;
    aspect-ratio: 1;
    background: #fff;
    padding: 16px;
    border-radius: 20px;
    margin: 16px auto;
    display: block;
}
.balance-inline {
    background: rgba(255,255,255,0.06);
    padding: 12px;
    border-radius: 12px;
    font-size: 15px;
    text-align: center;
}

/* ---------- Дети ---------- */
.section-header {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.55);
    margin: 20px 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}
.child-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
}
.child-inputs { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.child-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.05);
    padding: 14px;
    border-radius: 12px;
    margin-bottom: 8px;
}
.child-name { font-weight: 600; font-size: 15px; }
.child-bd { font-size: 13px; color: rgba(255,255,255,0.6); margin-top: 2px; }
.add-child-form { margin-top: 24px; }
.add-child-form .input { margin-top: 8px; }

/* ---------- Согласие ---------- */
.consent-block { margin: 20px 0 10px; }
.checkbox { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 13px; line-height: 1.5; }
.checkbox input {
    margin-top: 3px;
    width: 20px; height: 20px;
    accent-color: #e74c3c;
    flex-shrink: 0;
    cursor: pointer;
}
.checkbox a { color: #ffcccb; text-decoration: underline; }

/* ---------- История ---------- */
.tx-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.tx-title { font-weight: 500; font-size: 14px; }
.tx-date { font-size: 12px; color: rgba(255,255,255,0.5); margin-top: 2px; }
.tx-pending { font-size: 12px; color: #f1c40f; margin-top: 2px; }
.tx-amount { font-size: 17px; font-weight: 600; }
.tx-amount.plus { color: #2ecc71; }
.tx-amount.minus { color: #ff6b6b; }

/* ---------- Referral ---------- */
.ref-box {
    background: rgba(255,255,255,0.05);
    padding: 16px;
    border-radius: 14px;
    margin: 16px 0;
}
.ref-label { font-size: 12px; color: rgba(255,255,255,0.55); margin-bottom: 6px; }
.ref-url {
    background: rgba(0,0,0,0.3);
    padding: 12px;
    border-radius: 10px;
    font-size: 13px;
    word-break: break-all;
    margin-bottom: 12px;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
}
.copied {
    color: #2ecc71;
    font-size: 13px;
    text-align: center;
    margin-top: 8px;
}
.ref-stats {
    text-align: center;
    padding: 14px;
    background: rgba(255,255,255,0.04);
    border-radius: 12px;
    font-size: 15px;
}

/* ---------- Инфо ---------- */
.info-links { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.info-link {
    background: rgba(255,255,255,0.06);
    color: #fff;
    text-decoration: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.info-link:hover { background: rgba(255,255,255,0.1); }
.danger-zone {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* ---------- Boot ---------- */
.boot { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,0.6); }
.boot-spinner {
    width: 40px; height: 40px;
    border: 4px solid rgba(255,255,255,0.2);
    border-top-color: #ffcccb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- iPhone-safe ---------- */
@supports (padding: max(0px)) {
    body { padding-bottom: max(40px, env(safe-area-inset-bottom)); }
    .header { padding-top: max(20px, env(safe-area-inset-top)); }
}

@media (max-width: 380px) {
    .brand-emoji { font-size: 44px; }
    .hero-balance { font-size: 36px; }
    .tile-emoji { font-size: 26px; }
    #app { padding: 0 12px; }
}
