/* Roflan Airlines — клиентский кабинет. Токены совпадают с сайтом roflvpn.ru */
:root {
  --bg: #070B16; --bg-2: #0B101E; --card: #0F1526; --card-border: #222B45;
  --field: #151D33; --field-border: #2A3555; --line: #1A2238;
  --text: #EEF1F8; --muted: #A3ACC2; --soft: #C9D0E0;
  --accent: #FFC93C; --accent-hover: #FFE08A; --on-accent: #0A0E1A;
  --blue: #5AA9F0; --green: #4ADE80; --orange: #FF8A65; --red: #FF6B6B;
  --f-logo: 'Pixelify Sans', monospace; --f-head: 'Unbounded', sans-serif;
  --f-body: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif; --f-mono: 'JetBrains Mono', ui-monospace, monospace;
  --gutter: 24px; --radius: 20px;
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-family: var(--f-body); line-height: 1.4; -webkit-tap-highlight-color: transparent; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
img { max-width: 100%; }
button { font: inherit; color: inherit; }
.page { overflow-x: clip; min-height: 100vh; display: flex; flex-direction: column; }
.mono { font-family: var(--f-mono); }
.muted { color: var(--muted); }
.hidden { display: none !important; }
@media (max-width: 420px) { :root { --gutter: 16px; } }

/* загрузка */
.boot { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; color: var(--muted); }
.boot__face { animation: rl-bob 1.6s ease-in-out infinite; }
@keyframes rl-bob { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-10px) rotate(4deg); } }

/* кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 12px; border: 1px solid var(--field-border); background: var(--field); color: var(--text); font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer; transition: transform .15s ease, filter .15s ease, opacity .15s; white-space: nowrap; }
.btn:hover { color: var(--text); transform: translateY(-1px); filter: brightness(1.08); }
.btn:disabled { opacity: .5; cursor: default; transform: none; filter: none; }
.btn--accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.btn--accent:hover { color: var(--on-accent); }
.btn--ghost { background: transparent; }
.btn--danger { color: var(--orange); }
.btn--sm { min-height: 40px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn--icon { width: 44px; padding: 0; min-height: 44px; }
.btn--block { width: 100%; min-height: 52px; font-size: 16px; }
.btn .spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: rl-spin .7s linear infinite; }
@keyframes rl-spin { to { transform: rotate(360deg); } }

/* шапка */
.top { width: 100%; position: sticky; top: 0; z-index: 20; padding-top: var(--safe-top); background: rgba(7, 11, 22, .92); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top__in { max-width: 1120px; margin: 0 auto; padding: 12px var(--gutter); display: flex; align-items: center; gap: 10px; }
.brand { display: flex; flex: none; align-items: center; gap: 10px; margin-right: auto; color: var(--text); text-decoration: none; }
.brand:hover { color: var(--text); }
.brand img { width: 36px; height: 36px; }
.brand span { font-family: var(--f-logo); font-size: 20px; font-weight: 700; letter-spacing: .08em; white-space: nowrap; }
.top__user { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; color: var(--muted); }
.admin-btn { border-color: rgba(255, 201, 60, .45); color: var(--accent); }
@media (max-width: 640px) {
  .top__user { display: none; }
  .admin-btn .label, .logout-btn .label { display: none; }
  .admin-btn, .logout-btn { width: 44px; padding: 0; }
}
@media (max-width: 380px) { .brand span { font-size: 16px; } .brand img { width: 30px; height: 30px; } }

/* вкладки */
.tabs { width: 100%; max-width: 1120px; margin: 0 auto; padding: 16px var(--gutter) 0; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--field-border); color: var(--text); text-decoration: none; font-weight: 600; font-size: 15px; }
.tab:hover { color: var(--text); background: var(--field); }
.tab[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* сетка */
.main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 24px var(--gutter) 64px; display: flex; flex-direction: column; gap: 20px; }
.h1 { margin: 0; font-family: var(--f-head); font-weight: 700; font-size: clamp(24px, 4vw, 32px); line-height: 1.15; }
.row { display: flex; flex-wrap: wrap; gap: 20px; }
.card { min-width: 0; padding: 28px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--card-border); display: flex; flex-direction: column; gap: 20px; }
.card--wide { flex: 999 1 560px; }
.card--side { flex: 1 1 320px; }
.card__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.card h2 { margin: 0; font-size: 20px; }
.card p { margin: 0; }
.hint { font-size: 13px; color: var(--muted); line-height: 1.5; }
@media (max-width: 720px) { .main { padding-top: 18px; gap: 16px; } .row { gap: 16px; } .card { padding: 22px 18px; gap: 18px; } }

/* статусы */
.badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font-size: 14px; font-weight: 600; }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.badge--ok { background: rgba(74, 222, 128, .12); color: var(--green); }
.badge--warn { background: rgba(255, 201, 60, .12); color: var(--accent); }
.badge--bad { background: rgba(255, 138, 101, .12); color: var(--orange); }
.badge--ok::before { animation: rl-pulse 2.2s ease-out infinite; }
@keyframes rl-pulse { 0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, .55); } 80%, 100% { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); } }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; }
.stat { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.stat__k { font-size: 13px; color: var(--muted); letter-spacing: .04em; }
.stat__v { font-family: var(--f-mono); font-weight: 700; font-size: 20px; overflow-wrap: anywhere; }
.stat__v--accent { color: var(--accent); }
.progress { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress > div { height: 100%; border-radius: 999px; background: var(--accent); transition: width .6s ease; }

/* ключ */
.key { display: flex; flex-wrap: wrap; gap: 20px; padding-top: 22px; border-top: 1px dashed var(--field-border); }
.key__main { flex: 999 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.key__label { font-size: 14px; font-weight: 600; }
.field { width: 100%; min-width: 0; min-height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--field-border); background: var(--bg); color: var(--text); font-family: var(--f-mono); font-size: 14px; }
.field:focus { outline: none; border-color: var(--accent); }
textarea.field, input.field--text { font-family: var(--f-body); font-size: 16px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.qr { flex: 0 0 auto; width: 160px; height: 160px; padding: 10px; border-radius: 16px; background: #EEF1F8; display: flex; align-items: center; justify-content: center; cursor: zoom-in; border: 0; }
.qr svg, .qr img { width: 100%; height: 100%; display: block; }
@media (max-width: 520px) { .key__main .actions .btn { flex: 1 1 auto; } .qr { margin: 0 auto; } }

/* тарифы продления */
.plans { display: flex; flex-direction: column; gap: 12px; }
.plan { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 72px; padding: 14px 18px; border-radius: 14px; text-align: left; color: var(--text); background: var(--bg); border: 2px solid var(--card-border); cursor: pointer; transition: border-color .15s, background .15s; }
.plan[aria-pressed="true"] { background: var(--field); border-color: var(--accent); }
.plan__t { display: flex; flex-direction: column; gap: 4px; }
.plan__t b { font-size: 16px; font-weight: 600; }
.plan__t small { font-size: 13px; color: var(--muted); }
.plan__p { font-family: var(--f-head); font-weight: 700; font-size: 22px; white-space: nowrap; }
.balance-line { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--muted); }
.balance-line b { color: var(--text); font-family: var(--f-mono); }

/* устройства */
.devices { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.device { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); }
.device__ic { flex: none; width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--field); color: var(--blue); }
.device__t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.device__t b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.device__t small { color: var(--muted); font-size: 13px; }
.empty { padding: 22px; border-radius: 14px; border: 1px dashed var(--field-border); color: var(--muted); text-align: center; font-size: 15px; }

/* инструкции */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--field-border); background: transparent; color: var(--text); font-weight: 600; font-size: 15px; cursor: pointer; }
.pill[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.steps { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 14px; }
.step { padding: 20px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.step__n { font-family: var(--f-mono); font-weight: 700; font-size: 24px; color: var(--accent); }
.step p { line-height: 1.5; }
.step .btn { align-self: flex-start; }

/* поддержка */
.help { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 28px; }
.help__t { display: flex; align-items: center; gap: 16px; }
.help__t img { width: 52px; height: 52px; border-radius: 50%; }
.help__t div { display: flex; flex-direction: column; gap: 4px; }
.help h2 { font-size: 18px; }

/* баланс */
.big-money { font-family: var(--f-head); font-weight: 700; font-size: clamp(36px, 7vw, 48px); line-height: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--field-border); background: var(--bg); color: var(--text); font-family: var(--f-mono); font-weight: 700; cursor: pointer; }
.chip[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.method { min-height: 56px; padding: 10px 14px; border-radius: 12px; border: 2px solid var(--card-border); background: var(--bg); color: var(--text); font-weight: 600; text-align: left; cursor: pointer; }
.method[aria-pressed="true"] { border-color: var(--accent); background: var(--field); }
.tx { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.tx li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.tx li:last-child { border-bottom: 0; }
.tx b { font-family: var(--f-mono); white-space: nowrap; }
.plus { color: var(--green); }
.minus { color: var(--soft); }
.inline-form { display: flex; gap: 10px; }
.inline-form .field { flex: 1; }
@media (max-width: 420px) { .inline-form { flex-direction: column; } }

/* вход */
.login { flex: 1; display: flex; align-items: center; justify-content: center; padding: calc(40px + var(--safe-top)) var(--gutter) calc(40px + var(--safe-bottom)); }
.login__card { width: 100%; max-width: 440px; padding: 36px 28px; border-radius: 24px; background: var(--card); border: 1px solid var(--card-border); display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; }
.login__card img.face { width: 88px; height: 88px; animation: rl-bob 3s ease-in-out infinite; }
.login__logo { font-family: var(--f-logo); font-size: 24px; letter-spacing: .08em; }
.login__card p { margin: 0; color: var(--muted); line-height: 1.5; }
.tg-widget { min-height: 48px; display: flex; justify-content: center; }
.divider { display: flex; align-items: center; gap: 12px; width: 100%; color: var(--muted); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.consent { display: flex; flex-direction: column; gap: 12px; width: 100%; text-align: left; padding: 16px; border-radius: 14px; background: var(--bg); border: 1px solid var(--field-border); }
.consent label { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; cursor: pointer; }
.consent input { width: 20px; height: 20px; flex: none; margin: 0; accent-color: var(--accent); }
.legal-links { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; font-size: 13px; }
.legal-links a { color: var(--muted); }

/* подвал */
.foot { width: 100%; border-top: 1px solid var(--line); }
.foot__in { max-width: 1120px; margin: 0 auto; padding: 22px var(--gutter) calc(22px + var(--safe-bottom)); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); }
.foot a { color: var(--muted); }

/* модалка и тосты */
dialog.modal { width: min(440px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--card-border); border-radius: 20px; background: var(--card); color: var(--text); }
dialog.modal::backdrop { background: rgba(3, 5, 12, .72); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.modal__in { padding: 26px 24px; display: flex; flex-direction: column; gap: 16px; }
.modal__in h3 { margin: 0; font-size: 19px; }
.modal__in p { margin: 0; color: var(--soft); line-height: 1.5; }
.modal__actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.modal__qr { background: #EEF1F8; border-radius: 16px; padding: 14px; }
.toasts { position: fixed; z-index: 100; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.toast { padding: 14px 16px; border-radius: 14px; background: var(--field); border: 1px solid var(--field-border); box-shadow: 0 12px 30px rgba(0, 0, 0, .4); font-size: 15px; animation: rl-toast .25s ease-out; }
.toast--ok { border-color: rgba(74, 222, 128, .5); }
.toast--err { border-color: rgba(255, 138, 101, .6); }
@keyframes rl-toast { from { opacity: 0; transform: translateY(10px); } }

.skeleton { border-radius: var(--radius); background: linear-gradient(90deg, var(--card) 25%, #141B30 50%, var(--card) 75%); background-size: 200% 100%; animation: rl-sk 1.2s linear infinite; border: 1px solid var(--card-border); }
@keyframes rl-sk { to { background-position: -200% 0; } }

/* появление блоков */
.fade-in > * { animation: rl-in .5s cubic-bezier(.2, .7, .2, 1) both; }
.fade-in > *:nth-child(2) { animation-delay: .06s; }
.fade-in > *:nth-child(3) { animation-delay: .12s; }
.fade-in > *:nth-child(4) { animation-delay: .18s; }
.fade-in > *:nth-child(5) { animation-delay: .24s; }
@keyframes rl-in { from { opacity: 0; transform: translateY(16px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 720px) {
  /* ряд платформ листается внутри карточки (padding карточки 18px), края мягко гаснут */
  .pills[role="tablist"] {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
    margin: 0 -18px; padding: 2px 18px; scroll-padding: 0 18px; scroll-behavior: smooth;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 32px), transparent);
            mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 32px), transparent);
  }
  .pills[role="tablist"] .pill { min-height: 40px; padding: 0 14px; font-size: 14px; }
  .pills[role="tablist"]::-webkit-scrollbar { display: none; }
  .pills[role="tablist"] .pill { flex: none; }
}
