:root{
  --bg0:#050810;
  --bg1:#070b16;
  --card:rgba(255,255,255,.06);
  --card2:rgba(255,255,255,.08);
  --stroke:rgba(255,255,255,.12);
  --text:rgba(255,255,255,.92);
  --muted:rgba(255,255,255,.64);
  --muted2:rgba(255,255,255,.48);
  --brand:#7c3aed;        /* violet */
  --brand2:#22d3ee;       /* cyan */
  --ok:#22c55e;
  --warn:#f59e0b;
  --danger:#ef4444;
  --shadow: 0 18px 60px rgba(0,0,0,.45);
  --radius: 18px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color:var(--text);
  background:
    radial-gradient(1200px 600px at 15% 10%, rgba(124,58,237,.35), transparent 60%),
    radial-gradient(900px 500px at 85% 15%, rgba(34,211,238,.20), transparent 60%),
    radial-gradient(700px 500px at 55% 85%, rgba(124,58,237,.18), transparent 60%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  overflow-x:hidden;
}

a{color:inherit; text-decoration:none}
a:hover{opacity:.95; text-decoration:underline}
small{color:var(--muted2)}

.container{
  width:min(980px, 100%);
  margin:0 auto;
  padding: 28px 18px 64px;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding: 10px 6px 26px;
}

.brand{
  display:flex; align-items:center; gap:12px;
}
.logo{
  width:42px;height:42px;border-radius:14px;
  background:
    radial-gradient(18px 18px at 30% 30%, rgba(255,255,255,.25), transparent 60%),
    linear-gradient(135deg, var(--brand), var(--brand2));
  box-shadow: 0 10px 28px rgba(124,58,237,.25);
}
.brand h1{
  font-size:16px; margin:0; letter-spacing:.2px;
}
.brand p{
  margin:2px 0 0; font-size:12px; color:var(--muted);
}

.pill{
  display:inline-flex; align-items:center; gap:8px;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.05);
  color:var(--muted);
  font-size:12px;
}

.grid{
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap:18px;
}
@media (max-width: 900px){
  .grid{grid-template-columns:1fr}
}

.card{
  background: var(--card);
  border:1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow:hidden;
}
.card .head{
  padding: 18px 18px 0;
}
.card .body{
  padding: 18px;
}

.title{
  margin:0;
  font-size: 26px;
  letter-spacing: .2px;
  line-height: 1.15;
}
.subtitle{
  margin:10px 0 0;
  color:var(--muted);
  font-size: 14px;
  line-height:1.5;
}

.kpi{
  display:flex; flex-wrap:wrap;
  gap:10px;
  margin-top:16px;
}
.kpi .item{
  flex: 1 1 220px;
  padding: 14px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
}
.kpi .label{color:var(--muted); font-size:12px}
.kpi .value{margin-top:6px; font-size:16px; font-weight:600}

.divider{
  height:1px;
  background: rgba(255,255,255,.10);
  margin: 14px 0;
}

.btnrow{display:flex; flex-wrap:wrap; gap:10px; margin-top:14px}
.btn{
  appearance:none;
  border:none;
  cursor:pointer;
  padding: 12px 14px;
  border-radius: 14px;
  font-weight: 650;
  letter-spacing: .2px;
  color: rgba(255,255,255,.92);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
}
.btn:hover{transform: translateY(-1px); background: rgba(255,255,255,.10)}
.btn:active{transform: translateY(0px)}
.btn.primary{
  background: linear-gradient(135deg, rgba(124,58,237,.95), rgba(34,211,238,.70));
  border: 1px solid rgba(255,255,255,.15);
}
.btn.primary:hover{filter: brightness(1.03)}
.btn.ghost{
  background: transparent;
}
.btn.danger{
  background: rgba(239,68,68,.18);
  border-color: rgba(239,68,68,.30);
}
.btn.small{padding:9px 12px; border-radius:12px; font-weight:600; font-size:13px}

.form{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.input{
  width:100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.20);
  color: var(--text);
  outline:none;
}
.input::placeholder{color: rgba(255,255,255,.35)}
.input:focus{
  border-color: rgba(34,211,238,.45);
  box-shadow: 0 0 0 3px rgba(34,211,238,.14);
}

.note{
  padding: 12px 14px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  color: var(--muted);
  font-size: 13px;
  line-height:1.5;
}

.badge{
  display:inline-flex; align-items:center; gap:8px;
  padding:8px 10px;
  border-radius: 999px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: var(--muted);
  font-size: 12px;
}
.badge.ok{border-color: rgba(34,197,94,.35); background: rgba(34,197,94,.12); color: rgba(255,255,255,.85)}
.badge.warn{border-color: rgba(245,158,11,.35); background: rgba(245,158,11,.12); color: rgba(255,255,255,.85)}
.badge.danger{border-color: rgba(239,68,68,.35); background: rgba(239,68,68,.12); color: rgba(255,255,255,.85)}

.footer{
  margin-top: 22px;
  color: var(--muted2);
  font-size: 12px;
  text-align:center;
}

pre.code{
  white-space: pre-wrap;
  word-break: break-word;
  padding: 12px 14px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.22);
  color: rgba(255,255,255,.84);
  font-size: 12px;
  line-height:1.45;
}


/* =========================
   Premium UI add-ons
   ========================= */

body.premium{
  position:relative;
}

/* animated glow background + subtle noise */
.bgfx{
  position:fixed;
  inset:-40px;
  pointer-events:none;
  z-index:-1;
  background:
    radial-gradient(900px 500px at 20% 20%, rgba(124,58,237,.22), transparent 55%),
    radial-gradient(900px 500px at 80% 30%, rgba(34,211,238,.16), transparent 55%),
    radial-gradient(900px 500px at 45% 85%, rgba(124,58,237,.14), transparent 60%),
    linear-gradient(120deg, rgba(124,58,237,.10), rgba(34,211,238,.08), rgba(124,58,237,.10));
  background-size: 100% 100%, 100% 100%, 100% 100%, 200% 200%;
  animation: bgmove 16s ease infinite;
  filter: saturate(1.05);
}

.bgfx::after{
  content:"";
  position:absolute;
  inset:0;
  background-image:
    radial-gradient(rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 3px 3px;
  opacity:.08;
  mix-blend-mode: overlay;
}

@keyframes bgmove{
  0%{ background-position: 0 0, 0 0, 0 0, 0% 50%; }
  50%{ background-position: 0 0, 0 0, 0 0, 100% 50%; }
  100%{ background-position: 0 0, 0 0, 0 0, 0% 50%; }
}

/* Card glow rim */
.card.glow{ position:relative; }
.card.glow::before{
  content:"";
  position:absolute;
  inset:-1px;
  border-radius: calc(var(--radius) + 2px);
  background: linear-gradient(135deg, rgba(124,58,237,.55), rgba(34,211,238,.35), rgba(124,58,237,.25));
  opacity:.28;
  filter: blur(10px);
  pointer-events:none;
}
.card.glow::after{
  content:"";
  position:absolute;
  inset:0;
  border-radius: var(--radius);
  border:1px solid rgba(255,255,255,.10);
  pointer-events:none;
}

.headrow{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.statuswrap{ display:flex; align-items:center; padding-top:2px; }

.dot{
  width:8px; height:8px;
  border-radius:999px;
  display:inline-block;
  box-shadow: 0 0 0 4px rgba(255,255,255,.05);
}
.dot.ok{ background: var(--ok); box-shadow: 0 0 0 4px rgba(34,197,94,.12), 0 0 18px rgba(34,197,94,.25); }
.dot.danger{ background: var(--danger); box-shadow: 0 0 0 4px rgba(239,68,68,.12), 0 0 18px rgba(239,68,68,.22); }

.kpi .mini{
  margin-top:8px;
  color: var(--muted2);
  font-size: 12px;
}

.kpi .item.kpi-strong{
  background:
    radial-gradient(240px 120px at 20% 20%, rgba(124,58,237,.18), transparent 55%),
    rgba(255,255,255,.04);
}

.countdown{
  font-variant-numeric: tabular-nums;
  letter-spacing:.3px;
}

.chips{ display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.chip{
  appearance:none;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.86);
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 12px;
  cursor:pointer;
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
}
.chip:hover{ transform: translateY(-1px); background: rgba(255,255,255,.08); }
.chip:active{ transform: translateY(0px); }

.meter{
  height:10px;
  border-radius:999px;
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
  overflow:hidden;
  margin-bottom: 14px;
}
.meterbar{
  height:100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(34,211,238,.80), rgba(124,58,237,.80));
  box-shadow: 0 0 18px rgba(34,211,238,.18);
  transition: width .5s ease;
}

.payform .btnrow{ margin-top: 6px; }

.btn.big{
  padding: 13px 14px;
  border-radius: 16px;
  min-width: 240px;
  position:relative;
  overflow:hidden;
}

.btn.big .btnicon{ margin-right:8px; }

.btn.big .btnsub{
  display:block;
  margin-top:6px;
  font-size:12px;
  font-weight:600;
  color: rgba(255,255,255,.70);
}

.btn.primary.big{
  box-shadow: 0 16px 40px rgba(124,58,237,.18);
}

/* shimmer on hover */
.btn.big::before{
  content:"";
  position:absolute;
  top:-40%;
  left:-60%;
  width: 60%;
  height: 180%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.16), transparent);
  transform: rotate(18deg);
  opacity:0;
}
.btn.big:hover::before{
  opacity:1;
  animation: shimmer .85s ease;
}

@keyframes shimmer{
  from{ left:-60%; }
  to{ left:120%; }
}

.note-compact{
  background:
    radial-gradient(240px 140px at 15% 20%, rgba(34,211,238,.12), transparent 55%),
    rgba(255,255,255,.05);
}

.notegrid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.noteitem{ display:flex; gap:10px; align-items:flex-start; }
.noteicon{ width:34px; height:34px; border-radius:12px; display:flex; align-items:center; justify-content:center;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
}
.notetitle{ font-weight:700; color: rgba(255,255,255,.90); font-size:13px; }
.notetext{ color: var(--muted); font-size:13px; line-height:1.4; margin-top:2px; }

.infolist{ display:flex; flex-direction:column; gap:10px; }
.inforow{
  display:flex;
  gap:10px;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  transition: transform .10s ease, background .15s ease, border-color .15s ease;
}
.inforow:hover{ transform: translateY(-1px); background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); }

.infoicon{
  width:36px; height:36px;
  border-radius: 14px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
}
.infotitle{ font-weight:750; font-size:13px; color: rgba(255,255,255,.92); }
.infodesc{ margin-top:2px; font-size:13px; color: var(--muted); line-height:1.35; }

.idbox, .linkbox{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding: 12px 12px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
}

.mono{
  margin-top:6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  color: rgba(255,255,255,.78);
  word-break: break-all;
}

.iconbtn{
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.86);
  cursor:pointer;
  transition: transform .08s ease, background .15s ease;
}
.iconbtn:hover{ transform: translateY(-1px); background: rgba(255,255,255,.09); }
.iconbtn:active{ transform: translateY(0px); }

.toast{
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(10px);
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(10,12,22,.70);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: rgba(255,255,255,.90);
  font-size: 13px;
  opacity: 0;
  pointer-events:none;
  transition: opacity .18s ease, transform .18s ease;
  box-shadow: 0 18px 60px rgba(0,0,0,.45);
}
.toast.show{
  opacity: 1;
  transform: translateX(-50%) translateY(0px);
}

/* urgency states */
body.urgent .meterbar{
  background: linear-gradient(90deg, rgba(245,158,11,.85), rgba(239,68,68,.75));
  box-shadow: 0 0 18px rgba(245,158,11,.18);
}
body.expired .meterbar{ width: 0% !important; }
body.expired .countdown{ color: rgba(239,68,68,.95); }

@media (max-width: 520px){
  .btn.big{ min-width: 100%; }
  .headrow{ flex-direction:column; }
  .statuswrap{ padding-top: 0; }
}
/* Дополнительные стили для кабинета */
.user-info {
  margin: 16px 0 12px;
  padding: 12px 16px;
  background: rgba(124, 92, 255, 0.08);
  border-radius: 16px;
  border: 1px solid rgba(124, 92, 255, 0.15);
  transition: all 0.3s ease;
  animation: slideIn 0.5s ease-out;
}

.user-info:hover {
  background: rgba(124, 92, 255, 0.12);
  border-color: rgba(124, 92, 255, 0.3);
  box-shadow: 0 8px 20px -8px rgba(124, 92, 255, 0.3);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #7c5cff, #2dd4bf);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 18px;
  box-shadow: 0 8px 16px -4px rgba(124, 92, 255, 0.4);
}

.iconbtn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.iconbtn:hover {
  background: rgba(124, 92, 255, 0.2);
  border-color: rgba(124, 92, 255, 0.4);
  color: white;
  transform: translateY(-2px);
}

.iconbtn:active {
  transform: translateY(0);
}

#subscriptionUrl {
  transition: border-color 0.2s ease;
  flex: 1;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 8px 12px;
  color: rgba(255,255,255,0.9);
  font-size: 13px;
  font-family: monospace;
}

#subscriptionUrl:focus {
  outline: none;
  border-color: #7c5cff;
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.2);
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(124, 92, 255, 0.3);
  color: white;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  z-index: 1000;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast::before {
  content: '✓';
  margin-right: 8px;
  color: #51cf66;
}

.countdown-urgent { color: #ff6b6b; }
.countdown-warning { color: #ffd93d; }
.countdown-good { color: #51cf66; }
.countdown-expired { color: #868e96; text-decoration: line-through; }

.payment-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.payment-modal {
  background: linear-gradient(135deg, #1a1b2e, #141524);
  border: 1px solid rgba(124, 92, 255, 0.3);
  border-radius: 24px;
  padding: 32px;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(124, 92, 255, 0.1);
  border-top-color: #7c5cff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.user-greeting {
  background: rgba(124, 92, 255, 0.15);
  border-color: rgba(124, 92, 255, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Улучшения для meter bar */
.meterbar {
  transition: width 0.5s ease-out;
  background: linear-gradient(90deg, #7c5cff, #2dd4bf);
  position: relative;
  overflow: hidden;
}

.meterbar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, 
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.3) 50%,
    rgba(255,255,255,0) 100%);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Улучшения для кнопок */
.btn {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(124, 92, 255, 0.4);
}

.btn:active {
  transform: translateY(0);
}

.chip {
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.chip:hover {
  background: rgba(124, 92, 255, 0.15);
  border-color: #7c5cff;
}

/* Улучшения для badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
}

.badge.ok {
  background: rgba(81, 207, 102, 0.1);
  color: #51cf66;
  border: 1px solid rgba(81, 207, 102, 0.2);
}

.badge.danger {
  background: rgba(255, 107, 107, 0.1);
  color: #ff6b6b;
  border: 1px solid rgba(255, 107, 107, 0.2);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.dot.ok {
  background: #51cf66;
  box-shadow: 0 0 0 0 rgba(81, 207, 102, 0.5);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(81, 207, 102, 0.5); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(81, 207, 102, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(81, 207, 102, 0); }
}