:root{
    --bg:#07111f;
    --bg2:#0d1727;
    --panel:rgba(16,24,39,.78);
    --panel-2:rgba(15,23,42,.92);
    --stroke:rgba(255,255,255,.08);
    --stroke-strong:rgba(255,255,255,.12);
    --text:#edf2ff;
    --muted:#9fb0d0;
    --primary:#6ea8ff;
    --primary-2:#8b5cf6;
    --success:#22c55e;
    --danger:#ef4444;
    --shadow:0 18px 60px rgba(0,0,0,.35);
    --radius:22px;
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
html{scroll-behavior:smooth}

body{
    font-family:Inter, Segoe UI, Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(110,168,255,.13), transparent 22%),
        radial-gradient(circle at bottom right, rgba(139,92,246,.14), transparent 24%),
        linear-gradient(180deg, #07111f 0%, #091423 100%);
    color:var(--text);
    min-height:100vh;
}

img{
    max-width:100%;
    height:auto;
    display:block;
}

a{
    color:inherit;
    text-decoration:none;
}

button,
input,
textarea,
select{
    font:inherit;
}

.container{
    width:min(1180px, calc(100% - 32px));
    margin:0 auto;
}

.main{
    padding:40px 0 60px;
}

.bg-orb{
    position:fixed;
    width:400px;
    height:400px;
    border-radius:50%;
    filter:blur(80px);
    z-index:-1;
    opacity:.22;
    pointer-events:none;
}

.orb-1{top:-110px;left:-80px;background:#3b82f6}
.orb-2{right:-120px;bottom:-120px;background:#7c3aed}

/* HEADER */

.header{
    position:sticky;
    top:0;
    z-index:30;
    backdrop-filter:blur(16px);
    background:rgba(5,10,19,.62);
    border-bottom:1px solid var(--stroke);
}

.nav{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    min-height:78px;
}

.logo{
    font-size:24px;
    font-weight:800;
    letter-spacing:.6px;
    color:#f4f7ff;
    flex-shrink:0;
}

.nav-toggle{
    display:none;
    width:46px;
    height:46px;
    border-radius:14px;
    border:1px solid var(--stroke);
    background:rgba(255,255,255,.04);
    padding:0;
    cursor:pointer;
    align-items:center;
    justify-content:center;
    flex-direction:column;
    gap:5px;
}

.nav-toggle span{
    width:18px;
    height:2px;
    background:#eaf1ff;
    border-radius:999px;
    display:block;
}

.nav-panel{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;
    flex:1;
}

.nav-links{
    display:flex;
    gap:18px;
    flex-wrap:wrap;
    color:var(--muted);
}

.nav-links a{
    transition:.18s ease;
}

.nav-links a:hover{
    color:var(--text);
}

.nav-actions{
    display:flex;
    align-items:center;
    gap:10px;
    flex-wrap:wrap;
}

.nav-inline-form{
    display:inline;
}

/* COMMON */

.card{
    background:linear-gradient(180deg, rgba(18,27,45,.92), rgba(10,17,29,.92));
    border:1px solid var(--stroke);
    border-radius:var(--radius);
    box-shadow:var(--shadow);
    padding:24px;
}

.hero{
    padding:38px;
}

.hero-grid{
    display:grid;
    grid-template-columns:1.25fr .9fr;
    gap:24px;
    align-items:center;
}

.hero h1{
    font-size:48px;
    margin:14px 0 14px;
    line-height:1.05;
}

.lead{
    color:var(--muted);
    font-size:18px;
    line-height:1.7;
    max-width:700px;
}

.badge{
    display:inline-flex;
    align-items:center;
    gap:8px;
    border:1px solid rgba(110,168,255,.28);
    background:rgba(110,168,255,.12);
    padding:8px 12px;
    border-radius:999px;
    color:#dce9ff;
    font-size:13px;
    font-weight:700;
}

.hero-actions{
    display:flex;
    gap:12px;
    margin-top:24px;
    flex-wrap:wrap;
}

.btn{
    border:none;
    outline:none;
    cursor:pointer;
    border-radius:14px;
    padding:12px 18px;
    font-weight:700;
    transition:.2s ease;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:46px;
}

.btn:hover{
    transform:translateY(-1px);
}

.btn:disabled{
    opacity:.7;
    cursor:default;
    transform:none;
}

.btn-primary{
    color:white;
    background:linear-gradient(135deg, var(--primary), var(--primary-2));
    box-shadow:0 12px 28px rgba(110,168,255,.24);
}

.btn-ghost{
    color:var(--text);
    background:rgba(255,255,255,.04);
    border:1px solid var(--stroke);
}

.btn-danger{
    color:white;
    background:linear-gradient(135deg, #ef4444, #b91c1c);
}

.btn-block{
    width:100%;
}

/* HOME */

.home-hero{
    position:relative;
    overflow:hidden;
}

.home-hero::before{
    content:"";
    position:absolute;
    inset:0;
    background:
        radial-gradient(circle at top right, rgba(110,168,255,.08), transparent 22%),
        radial-gradient(circle at bottom left, rgba(139,92,246,.09), transparent 24%);
    pointer-events:none;
}

.hero-copy,
.hero-stats{
    position:relative;
    z-index:1;
}

.stats{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:14px;
}

.stat-card{
    padding:18px;
    border-radius:18px;
    background:rgba(255,255,255,.03);
    border:1px solid var(--stroke);
    min-height:126px;
}

.stat-title{
    font-size:13px;
    color:var(--muted);
    margin-bottom:8px;
    text-transform:uppercase;
    letter-spacing:.06em;
}

.stat-value{
    font-size:20px;
    font-weight:800;
    margin-bottom:8px;
}

.stat-sub{
    color:var(--muted);
    font-size:13px;
    line-height:1.55;
}

.section-block{
    margin-top:18px;
}

.section-head{
    margin-bottom:16px;
}

.section-head h2{
    margin:0 0 8px;
    font-size:30px;
}

.section-head--compact h2{
    font-size:28px;
}

.public-grid{
    display:grid;
    grid-template-columns:repeat(3, minmax(0, 1fr));
    gap:18px;
}

.public-card{
    padding:0;
    overflow:hidden;
}

.public-card__image{
    aspect-ratio:16 / 9;
    overflow:hidden;
    border-bottom:1px solid var(--stroke);
    background:rgba(255,255,255,.03);
}

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

.public-card__body{
    padding:20px;
}

.public-card h3{
    margin:0 0 10px;
    font-size:22px;
}

.public-card__subtitle{
    margin-bottom:10px;
    color:#dce8ff;
    font-weight:700;
}

.public-card p{
    margin:0;
    color:var(--muted);
    line-height:1.7;
}

.public-card__actions{
    margin-top:16px;
}

.faq-card{
    margin-top:18px;
}

.faq-list{
    display:grid;
    gap:14px;
}

.faq-item{
    padding:18px;
    border-radius:18px;
    background:rgba(255,255,255,.03);
    border:1px solid rgba(255,255,255,.06);
}

.faq-item__question{
    font-size:18px;
    font-weight:800;
    margin-bottom:10px;
}

.faq-item__answer{
    color:var(--muted);
    line-height:1.75;
}

/* AUTH / FORMS */

.auth-wrap{
    display:flex;
    justify-content:center;
    padding:30px 0;
}

.auth-card{
    width:min(100%, 520px);
}

.auth-card h1{
    margin-top:0;
    margin-bottom:8px;
}

.form{
    display:grid;
    gap:14px;
    margin-top:18px;
}

.form-group{
    display:grid;
    gap:8px;
}

.form-group label{
    font-weight:600;
    color:#dbe6ff;
}

.form-group input,
.form-group select,
.form-group textarea{
    width:100%;
    min-height:50px;
    border-radius:14px;
    border:1px solid var(--stroke);
    background:rgba(255,255,255,.04);
    color:var(--text);
    padding:0 14px;
    outline:none;
}

.form-group textarea{
    min-height:130px;
    padding:14px;
    resize:vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus{
    border-color:rgba(110,168,255,.45);
    box-shadow:0 0 0 4px rgba(110,168,255,.12);
}

.form-footer{
    margin-top:16px;
    color:var(--muted);
}

.form-footer a{
    color:#dfe7ff;
    text-decoration:underline;
}

/* ALERTS */

.alert{
    padding:14px 16px;
    border-radius:16px;
    margin-bottom:18px;
    border:1px solid var(--stroke);
}

.alert-success{
    background:rgba(34,197,94,.12);
    color:#c9f7d9;
}

.alert-error{
    background:rgba(239,68,68,.12);
    color:#ffd4d4;
}

/* PAGES */

.page-head{
    margin-bottom:20px;
}

.page-head h1{
    margin:12px 0 8px;
    font-size:36px;
}

.muted{
    color:var(--muted);
}

.dashboard-grid{
    display:grid;
    grid-template-columns:repeat(4, 1fr);
    gap:16px;
    margin-bottom:18px;
}

.card-label{
    color:var(--muted);
    font-size:13px;
    margin-bottom:10px;
}

.card-value{
    font-size:22px;
    font-weight:800;
}

.big-balance{
    font-size:40px;
    font-weight:900;
    line-height:1;
}

.content-grid{
    display:grid;
    grid-template-columns:1.1fr .9fr;
    gap:16px;
}

.cabinet-grid{
    margin-bottom:18px;
}

.profile-list{
    display:grid;
    gap:12px;
    color:#dfe7fb;
}

.pretty-list{
    margin:0;
    padding-left:18px;
    color:#dfe7fb;
    line-height:1.9;
}

.table-wrap{
    overflow:auto;
}

.table{
    width:100%;
    border-collapse:collapse;
}

.table th,
.table td{
    text-align:left;
    padding:14px 12px;
    border-bottom:1px solid rgba(255,255,255,.06);
}

.table th{
    font-size:13px;
    color:var(--muted);
    font-weight:700;
}

.uuid{
    word-break:break-all;
    font-family:Consolas, monospace;
    font-size:14px;
}

.amount-plus{
    color:#86efac;
    font-weight:700;
}

.amount-minus{
    color:#fca5a5;
    font-weight:700;
}

.form-row{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:12px;
}

.admin-balance-grid{
    display:grid;
    grid-template-columns:repeat(2, 1fr);
    gap:16px;
}

.user-balance-card{
    border:1px solid var(--stroke);
    background:rgba(255,255,255,.03);
    border-radius:18px;
    padding:18px;
}

.user-balance-head{
    display:flex;
    justify-content:space-between;
    gap:14px;
    align-items:flex-start;
    margin-bottom:8px;
}

.user-login{
    font-size:18px;
    font-weight:800;
}

.user-balance-value{
    font-size:22px;
    font-weight:900;
}

.user-mini{
    margin-bottom:14px;
}

.admin-balance-form{
    margin-top:0;
}

/* HELPERS */

code{
    display:inline-block;
    padding:4px 8px;
    border-radius:10px;
    background:rgba(255,255,255,.04);
    border:1px solid rgba(255,255,255,.06);
    color:#dce9ff;
    font-family:Consolas, Monaco, monospace;
    font-size:13px;
    word-break:break-word;
}

input[type="file"]{
    padding:12px 14px !important;
    height:auto !important;
    line-height:1.4;
}

.preview-card{
    border:1px solid var(--stroke);
    background:rgba(255,255,255,.03);
    border-radius:18px;
    padding:16px;
}

.preview-card__label{
    font-size:13px;
    color:var(--muted);
    margin-bottom:10px;
}

.preview-image{
    width:100%;
    aspect-ratio:16 / 10;
    border-radius:16px;
    overflow:hidden;
    border:1px solid rgba(255,255,255,.06);
    background:
        radial-gradient(circle at top right, rgba(0,255,174,.08), transparent 30%),
        linear-gradient(180deg, rgba(28,39,64,.95), rgba(17,24,39,.95));
    display:flex;
    align-items:center;
    justify-content:center;
}

.preview-image img{
    width:100%;
    height:100%;
    object-fit:contain;
    display:none;
}

.preview-image.is-ready img{
    display:block;
}

.preview-image__empty{
    color:var(--muted);
    font-size:14px;
    text-align:center;
    padding:20px;
}

/* MOBILE */

@media (max-width: 980px){
    .hero-grid,
    .content-grid,
    .dashboard-grid,
    .admin-balance-grid,
    .public-grid{
        grid-template-columns:1fr;
    }

    .form-row{
        grid-template-columns:1fr;
    }

    .nav{
        min-height:72px;
    }

    .nav-toggle{
        display:flex;
    }

    .nav-panel{
        position:absolute;
        left:16px;
        right:16px;
        top:calc(100% + 10px);
        display:none;
        flex-direction:column;
        align-items:stretch;
        padding:16px;
        border:1px solid var(--stroke-strong);
        border-radius:20px;
        background:rgba(8,14,26,.96);
        box-shadow:var(--shadow);
    }

    body.nav-open .nav-panel{
        display:flex;
    }

    .nav-links{
        flex-direction:column;
        gap:12px;
    }

    .nav-actions{
        margin-top:14px;
        flex-direction:column;
        align-items:stretch;
    }

    .nav-actions .btn,
    .nav-actions form,
    .nav-actions form .btn{
        width:100%;
    }

    .hero h1{
        font-size:36px;
    }
}

@media (max-width: 640px){
    .container{
        width:min(100% - 20px, 1180px);
    }

    .main{
        padding:24px 0 42px;
    }

    .card,
    .hero{
        padding:18px;
    }

    .hero h1{
        font-size:30px;
    }

    .lead{
        font-size:15px;
    }

    .hero-actions{
        flex-direction:column;
    }

    .hero-actions .btn{
        width:100%;
    }

    .stats{
        grid-template-columns:1fr;
    }

    .section-head h2,
    .page-head h1{
        font-size:28px;
    }
}
