:root {
    --bg: #0f1116;
    --panel: #161a21;
    --panel-2: #151a20;
    --text: #e7ebf3;
    --text-dim: #9aa5b1;
    --accent: #3b82f6;
    --accent-2: #2dd4bf;
    --stroke: #212734;
    --success: #22c55e;
    --warning: #f59e0b;
    --muted: #1b212c;
    --btn: #1f2633;
    --btn-hover: #253042;
    --shadow: 0 8px 30px rgba(0, 0, 0, .35);
    --radius: 12px;
}

* {
    box-sizing: border-box
}

html, body {
    height: 100%
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
}


.wrapper {
    width: 530px;
    margin: 32px auto 80px;
}

/* Topbar */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.brand {
    font-weight: 700;
    letter-spacing: .3px;
}

.nav {
    display: flex;
    gap: 14px;
    align-items: center;
}

.nav a {
    color: var(--text-dim);
    text-decoration: none;
    transition: .15s ease color;
}

.nav a:hover {
    color: var(--text);
}

.nav a.active {
    color: #fff;
}

.icon-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px dashed var(--stroke);
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: default;
    opacity: .7;
}

/* Cards */
.card {
    background: linear-gradient(180deg, var(--panel), var(--panel-2));
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
}
.card__green{
    background: #2A4E46;
    border-color: #567D79;
}
.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* было 1fr 1fr */
    gap: 14px 18px;
}

.item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: var(--muted);
    border: 1px solid var(--stroke);
    border-radius: 10px;
}

.icon {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 1px dashed #2a3241;
    flex: 0 0 20px;
    /* сюда потом подставишь свою иконку */
}

.label {
    color: var(--text-dim);
    font-size: 12px;
}

.value {
    color: var(--text);
    font-weight: 600;
    margin-top: 2px;
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--muted);
    border: 1px solid var(--stroke);
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.dot.green {
    background: rgb(84, 229, 80);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, .12);
}
.dot.red {
    background: rgb(229, 80, 80);
    box-shadow: 0 0 0 3px rgba(197, 34, 34, 0.12);
}
/* Connect block */
.sub {
    margin-top: 14px;
}

.sub .title {
    color: var(--text);
    font-weight: 700;
    margin-bottom: 8px;
}

.sub .hint {
    color: var(--text-dim);
    font-size: 12px;
    margin-top: -2px;
    margin-bottom: 12px;
}

.input-row {
    display: flex;
    gap: 8px;
    align-items: center;
    background: var(--muted);
    border: 1px solid var(--stroke);
    border-radius: 10px;
    padding: 8px;
    margin-bottom: 10px;
}

.input-row input {
    flex: 1;
    background: transparent;
    border: 0;
    outline: 0;
    color: var(--text);
    font-size: 13px;
}

.btn {
    border: 1px solid var(--stroke);
    background: var(--btn);
    color: var(--text);
    padding: 8px 12px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 12px;
    cursor: default; /* без JS */
    transition: .15s ease background-color, .15s ease transform;
    text-decoration: none;

}

.btn:hover {
    cursor: pointer;
    background: var(--btn-hover);
}

.btn.primary {
    background: var(--accent);
    border-color: transparent;
}

.btn.primary:hover {
    filter: brightness(1.05);
}

.note {
    margin-left: 10px;
    color: #f98080;
    font-size: 11px;
    white-space: nowrap;
}

.stack {
    display: flex;
    gap: 14px;
}

.stack > .col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.toast {
    transition: opacity .2s ease;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .5);
    z-index: 1000;
}

.modal {
    background: #12151c;
    color: #e7ebf3;
    border: 1px solid #222a36;
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .35);
    padding: 18px;
    width: min(92vw, 380px);
}

.modal .title {
    font-weight: 700;
    margin-bottom: 8px
}

.modal .close {
    appearance: none;
    border: 0;
    background: transparent;
    color: #9aa3b2;
    float: right;
    cursor: pointer;
    font-size: 18px;
}

.qr-box {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background: #0f131a;
    border: 1px solid #222a36;
    border-radius: 12px;
}

.qr-box img {
    display: block;
    max-width: 100%;
    height: auto
}

.muted {
    color: #9aa3b2;
    font-size: 12px
}

.muted>*{
    word-break: break-all;
    white-space: normal;
    overflow-wrap: anywhere;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}
.invoice-timer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 96px;
    padding: 6px 10px;
    border-radius: 8px;
    background: #1b212c;
    color: #e6e6e6;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}
.invoice-timer.expired {
    background: rgba(255, 80, 80, 0.12);
    color: #ff8080;
}

.card-title {
    font-weight: 700;
    color: var(--text-dim);
}

.amount {
    font-size: 28px;
    font-weight: 800;
    margin-top: 2px;
}

.right-actions {
    display: flex;
    gap: 8px;
}

.alert {
    margin-top: 12px;
    background: #3b1e1e;
    border: 1px solid #6b2b2b;
    color: #ffd7d7;
    padding: 10px 12px;
    border-radius: 10px;
}

.section {
    margin-top: 16px;
}

.label {
    color: var(--text-dim);
    font-size: 12px;
    margin-bottom: 8px;
}

/* Custom select */
.select {
    position: relative;
    user-select: none;
    border: 1px solid var(--stroke);
    background: var(--muted);
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sel-main {
    display: flex;
    flex-direction: column;
}

.sel-top {
    font-weight: 600;
}

.sel-sub {
    color: var(--text-dim);
    font-size: 12px;
}

.chev {
    width: 16px;
    height: 16px;
    opacity: .7;
}

.menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 10;
    background: linear-gradient(180deg, var(--panel), var(--panel-2));
    border: 1px solid var(--stroke);
    border-radius: 12px;
    padding: 6px;
    box-shadow: var(--shadow);
    display: none;
}

.menu.open {
    display: block;
}

.opt {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
}

.opt:hover {
    background: rgba(255, 255, 255, .04);
}

.actions {
    margin-top: 12px;
}

.btn.outline {
    background: transparent;
    border: 1px solid var(--stroke);
    color: var(--text);
}

.btn:disabled {
    cursor: not-allowed;
    background-color: gray;
}

.input {
    width: 100%;
    height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--stroke);
    border-radius: 10px;
    background: var(--muted);
    color: var(--text);
    outline: none;
}

.input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(86, 178, 255, .15);
}

.input-error {
    border-color: #6b2b2b;
}

.field-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn-square {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--stroke);
    border-radius: 10px;
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
}

.icon-btn-square:hover {
    color: var(--text);
}
.invites-list{ display:flex; flex-direction:column; gap:10px; }
.invite-row{
    display:flex; align-items:center; gap:10px;
    background: var(--muted);
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    padding: 10px 12px;
}
.invite-link{ flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--text); }
.invite-note{ margin-left:8px; font-size:12px; color:var(--text-dim);}
.invite-row.used{ opacity:.6; }
.copy-btn{ white-space:nowrap; }
.invite-hero{
    min-height: calc(100vh - 120px);
    display:flex; align-items:center; justify-content:center;
    text-align:center; padding:40px 16px;
}
.invite-box{ max-width:640px; margin:0 auto; }
.invite-title{ font-size:32px; font-weight:800; margin:0 0 10px; }
.invite-sub{ color:var(--text-dim); margin-bottom:24px; }
.inline-form{ display:flex; gap:10px; justify-content:center; }
.inline-form .input{ width:420px; max-width:70vw; }
.hint{ color:var(--text-dim); margin-top:10px; }
.features{ display:flex; gap:22px; justify-content:center; margin-top:28px; flex-wrap:wrap; }
.feature{ display:flex; align-items:center; gap:8px; color:var(--text-dim); }
.feature svg{ width:18px; height:18px; color:var(--accent-2); }

/* локальные добивки под аккордеон */
.accordion{ display:flex; flex-direction:column; gap:10px; }
.acc-item{
    background: var(--panel);
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    overflow: hidden;
}
.acc-item.open{ border-color: var(--accent-2); }
.acc-header{
    display:flex; align-items:center; justify-content:space-between; gap:10px;
    padding: 12px 14px; cursor:pointer;
}
.acc-title{ font-weight:600; }
.acc-sub{ color: var(--text-dim); font-size:12px; }
.acc-toggle{ width:18px; height:18px; opacity:.8; flex:0 0 auto; }
.acc-body{
    padding: 12px 14px 14px;
    border-top: 1px solid var(--stroke);
    background: var(--muted);
    display: none;
}
.acc-item.open .acc-body{ display:block; }
.download-btn{ margin:6px 0 10px; }
.steps{ color: var(--text-dim); line-height:1.55; }
.steps h5{ margin:10px 0 6px; color: var(--text); font-size:14px; }
.steps p{ margin:0 0 10px; }
.steps code{ background:#0f131a; border:1px solid var(--stroke); padding:2px 6px; border-radius:8px; }
.notification.success {
    background-color: #d4edda;
    color: #155724;
    padding: 12px 18px;
    border-radius: 6px;
    border: 1px solid #c3e6cb;
    margin-bottom: 20px;
    font-size: 15px;
}
.qr-inline{width:100%;max-width:none;margin-top:14px}
.qr-inline img{display:block;width:100%;height:auto}


/* Стиль футера-переключалки (тёмная тема, как на скрине) */
#lang-switcher{
    margin: 0 auto;
    width: 250px;
    justify-content: center;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: rgba(18, 22, 28, 0.85); /* полупрозрачный дарк */
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.35);
    font: 500 14px/1.2 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    color: #cbd5e1;                /* светло-серый */
    z-index: 9999;
    user-select: none;
}

#lang-switcher .label{
    opacity: .8;
    margin: 0;
}

#lang-switcher .sep{
    opacity: .4;
}

#lang-switcher .lang-btn{
    appearance: none;
    border: 0;
    background: transparent;
    color: #e2e8f0;
    font: inherit;
    padding: 4px 6px;
    border-radius: 6px;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, transform .04s ease;
}

#lang-switcher .lang-btn:hover{
    background: rgba(255,255,255,0.06);
}

#lang-switcher .lang-btn[aria-pressed="true"]{
    background: rgba(59,130,246,.15);   /* активное состояние */
    color: #93c5fd;
    outline: 1px solid rgba(59,130,246,.35);
}

@media (max-width: 480px){
    #lang-switcher{
        bottom: 16px;
        font-size: 13px;
        padding: 6px 10px;
    }
}

@media (max-width: 560px) {
    .wrapper {
        width: 100%;
        padding: 0 16px;
    }

    .grid {
        grid-template-columns:1fr;
    }

    .stack {
        flex-direction: column;
    }
    .invite-title{ font-size:26px; }
    .inline-form{ flex-direction:column; align-items:stretch; }
    .inline-form .input{ width:100%; max-width:100%; }
}

.loader {
    position: relative;
    width: 108px;
    display: flex;
    justify-content: space-between;
}
.loader::after , .loader::before  {
    content: '';
    display: inline-block;
    width: 48px;
    height: 48px;
    background-color: #FFF;
    background-image:  radial-gradient(circle 14px, #0d161b 100%, transparent 0);
    background-repeat: no-repeat;
    border-radius: 50%;
    animation: eyeMove 10s infinite , blink 10s infinite;
}
@keyframes eyeMove {
    0%  , 10% {     background-position: 0px 0px}
    13%  , 40% {     background-position: -15px 0px}
    43%  , 70% {     background-position: 15px 0px}
    73%  , 90% {     background-position: 0px 15px}
    93%  , 100% {     background-position: 0px 0px}
}
@keyframes blink {
    0%  , 10% , 12% , 20%, 22%, 40%, 42% , 60%, 62%,  70%, 72% , 90%, 92%, 98% , 100%
    { height: 48px}
    11% , 21% ,41% , 61% , 71% , 91% , 99%
    { height: 18px}
}
@media (max-width: 840px) {
    .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .grid { grid-template-columns: 1fr; }
}