/* EVM VPN Portal UI Kit (MVP) */

:root{
  --bg0:#05070b;
  --bg1:#070b12;
  --card:rgba(12,18,30,.72);
  --card2:rgba(12,18,30,.92);
  --stroke:rgba(130,170,255,.18);
  --stroke2:rgba(130,170,255,.28);
  --text:#eaf1ff;
  --muted:rgba(234,241,255,.72);
  --muted2:rgba(234,241,255,.55);

  --a:#62d4ff;
  --b:#7c5cff;
  --c:#35ffa6;

  --danger:#ff4d6d;
  --ok:#3cffb2;
  --warn:#ffd166;

  --shadow:0 14px 60px rgba(0,0,0,.55);
  --radius:18px;
  --radius2:14px;
  --focus:0 0 0 4px rgba(98,212,255,.18);
}

*{ box-sizing:border-box; }

html,body{
  height:100%;
  margin:0;
}

body{
  font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Arial;
  color:var(--text);
  background:none;
  position:relative;
  overflow-x:hidden;
}

body::before{
  content:"";
  position:fixed;
  inset:0;
  z-index:-1;
  background:
    radial-gradient(900px 420px at 50% -80px, rgba(98,212,255,.20), transparent 55%),
    radial-gradient(700px 520px at 82% 15%, rgba(124,92,255,.22), transparent 60%),
    radial-gradient(560px 420px at 18% 22%, rgba(53,255,166,.10), transparent 60%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
}

html{ background:var(--bg0); }

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

img{ max-width:100%; }

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

.fade-in{ animation:rise .45s cubic-bezier(.2,.8,.2,1) both; }
@keyframes rise{
  from{ opacity:0; transform:translateY(10px); }
  to{ opacity:1; transform:translateY(0); }
}

/* ---------- auth ---------- */

.auth{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:32px 16px;
}

.auth-card{
  width:min(520px, 100%);
  background:var(--card);
  border:1px solid var(--stroke);
  border-radius:calc(var(--radius) + 6px);
  box-shadow:var(--shadow);
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
  padding:28px;
  position:relative;
  overflow:hidden;
}

.auth-card:before{
  content:"";
  position:absolute;
  inset:-2px;
  background:
    radial-gradient(520px 220px at 18% 6%, rgba(98,212,255,.20), transparent 60%),
    radial-gradient(420px 260px at 86% 10%, rgba(124,92,255,.20), transparent 60%);
  opacity:.95;
  pointer-events:none;
}

.auth-inner{ position:relative; }

.brand{
  display:flex;
  align-items:center;
  justify-content:center;
  margin-bottom:18px;
}

.brand img{
  width:min(360px, 78%);
  height:auto;
  display:block;
  filter:drop-shadow(0 12px 30px rgba(0,0,0,.55));
}

.h1{
  margin:0 0 6px 0;
  font-size:22px;
  letter-spacing:.2px;
  text-align:center;
}

.p{
  margin:0 0 18px 0;
  color:var(--muted);
  font-size:13.5px;
  line-height:1.4;
  text-align:center;
}

.form{
  display:grid;
  gap:12px;
}

.field{
  display:grid;
  gap:7px;
}

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

.input,
.textarea{
  width:100%;
  border-radius:14px;
  border:1px solid var(--stroke2);
  background:rgba(5,8,14,.45);
  color:var(--text);
  padding:12px 14px;
  outline:none;
  transition:transform .15s ease, border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.textarea{
  min-height:130px;
  resize:vertical;
  line-height:1.5;
}

.input::placeholder,
.textarea::placeholder{ color:rgba(234,241,255,.35); }

.input:focus,
.textarea:focus{
  border-color:rgba(98,212,255,.55);
  box-shadow:var(--focus);
  background:rgba(5,8,14,.62);
}

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

.btn{
  position:relative;
  isolation:isolate;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  min-height:44px;
  border-radius:14px;
  padding:12px 16px;
  border:1px solid rgba(98,212,255,.30);
  background:
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,0)),
    linear-gradient(135deg, rgba(98,212,255,.24), rgba(124,92,255,.18));
  color:var(--text);
  cursor:pointer;
  user-select:none;
  font-weight:650;
  letter-spacing:.2px;
  box-shadow:0 10px 30px rgba(0,0,0,.22);
  transition:transform .14s ease, box-shadow .14s ease, border-color .14s ease, filter .14s ease, background .14s ease;
}

.btn::after{
  content:"";
  position:absolute;
  inset:1px;
  border-radius:inherit;
  background:linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,0));
  opacity:.55;
  z-index:-1;
}

.btn:hover{
  transform:translateY(-1px);
  border-color:rgba(98,212,255,.55);
  box-shadow:0 16px 40px rgba(0,0,0,.35);
}

.btn:active{ transform:translateY(0); filter:brightness(.97); }
.btn:disabled{ opacity:.65; cursor:not-allowed; transform:none; box-shadow:none; }

.btn.secondary,
.btn.ghost{
  background:rgba(5,8,14,.45);
  border-color:var(--stroke2);
  font-weight:600;
}

.btn.secondary:hover,
.btn.ghost:hover{ border-color:rgba(234,241,255,.25); }

.btn.ghost{
  box-shadow:none;
}

.btn.small{
  min-height:40px;
  padding:10px 13px;
  border-radius:12px;
  font-size:13px;
  font-weight:650;
}

.btn.wide{ width:100%; }

.btn.danger{
  border-color:rgba(255,77,109,.40);
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,0)),
    linear-gradient(135deg, rgba(255,77,109,.16), rgba(255,77,109,.10));
}

.btn.danger:hover{ border-color:rgba(255,77,109,.60); }

.help{
  color:var(--muted2);
  font-size:12.5px;
  line-height:1.4;
}

.alert{
  border-radius:14px;
  padding:11px 12px;
  border:1px solid rgba(255,77,109,.38);
  background:rgba(255,77,109,.10);
  color:rgba(255,223,228,.95);
  font-size:13px;
}

.alert.ok{
  border-color:rgba(60,255,178,.30);
  background:rgba(60,255,178,.10);
  color:rgba(225,255,244,.92);
}

.alert.warn{
  border-color:rgba(255,209,102,.28);
  background:rgba(255,209,102,.10);
  color:rgba(255,240,205,.95);
}

.small-link{
  display:flex;
  justify-content:center;
  margin-top:14px;
  color:var(--muted2);
  font-size:13px;
}

.small-link a{
  color:rgba(98,212,255,.92);
  text-decoration:none;
}

.small-link a:hover{ text-decoration:underline; }

/* ---------- app pages ---------- */

.page{ padding:26px 0 44px; }

.header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:16px;
}

.title{
  margin:0;
  font-size:20px;
  letter-spacing:.2px;
}

.sub{
  color:var(--muted);
  font-size:13px;
  margin-top:3px;
}

.card{
  background:var(--card2);
  border:1px solid var(--stroke);
  border-radius:var(--radius);
  box-shadow:0 18px 60px rgba(0,0,0,.45);
  padding:18px;
}

.grid{
  display:grid;
  gap:14px;
}

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

@media (min-width:920px){
  .grid.two{ grid-template-columns:.9fr 1.1fr; }
}

.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--stroke2);
  background:rgba(5,8,14,.35);
  color:var(--muted);
  font-size:12.5px;
}

.codebox{
  width:100%;
  min-height:120px;
  border-radius:var(--radius2);
  border:1px solid var(--stroke2);
  background:rgba(5,8,14,.35);
  color:var(--text);
  padding:12px;
  font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size:12.5px;
  line-height:1.45;
  outline:none;
  resize:vertical;
}

.codebox:focus{ box-shadow:var(--focus); border-color:rgba(98,212,255,.55); }

.toolbar{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:12px;
}

.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  overflow:hidden;
  border-radius:var(--radius);
  border:1px solid var(--stroke);
}

.table th,
.table td{
  padding:12px;
  text-align:left;
  font-size:13.5px;
  vertical-align:top;
  border-bottom:1px solid rgba(130,170,255,.12);
}

.table th{
  color:rgba(234,241,255,.86);
  background:rgba(5,8,14,.40);
  font-weight:700;
  font-size:12.5px;
  letter-spacing:.25px;
}

.table tr:last-child td{ border-bottom:none; }

.kbd{
  font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size:12px;
  color:rgba(234,241,255,.88);
  background:rgba(5,8,14,.35);
  border:1px solid rgba(130,170,255,.18);
  padding:2px 7px;
  border-radius:999px;
}

.hr{ height:1px; background:rgba(130,170,255,.14); border:0; margin:14px 0; }

.pill-row{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.meta-chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid var(--stroke2);
  background:rgba(255,255,255,.03);
  color:var(--muted);
  font-size:12.5px;
}

.copy-hint{
  margin-top:10px;
  font-size:12px;
  color:var(--muted2);
  line-height:1.45;
}

.status-box{
  display:none;
  margin-top:12px;
  padding:11px 12px;
  border-radius:12px;
  border:1px solid var(--stroke2);
  background:rgba(255,255,255,.03);
  font-size:13px;
  line-height:1.5;
}

.status-box.show{ display:block; }
.status-box.ok{
  border-color:rgba(60,255,178,.25);
  background:rgba(60,255,178,.08);
  color:rgba(225,255,244,.92);
}
.status-box.warn{
  border-color:rgba(255,209,102,.30);
  background:rgba(255,209,102,.10);
  color:rgba(255,240,205,.95);
}
.status-box.error{
  border-color:rgba(255,77,109,.30);
  background:rgba(255,77,109,.10);
  color:rgba(255,223,228,.95);
}

/* ---------- cabinet ---------- */

.cabinet-shell{
  display:grid;
  gap:14px;
}

.cabinet-hero{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  flex-wrap:wrap;
}

.cabinet-user{
  display:grid;
  gap:6px;
}

.connect-section-title{
  margin-top:14px;
  margin-bottom:8px;
  font-size:15px;
  font-weight:700;
  color:var(--text);
}

.connect-section-desc,
.subtle-note{
  margin-top:8px;
  font-size:12.8px;
  color:var(--muted);
  line-height:1.55;
}

.hint-box{
  margin-top:10px;
  padding:12px 13px;
  border-radius:12px;
  background:rgba(60,255,178,.06);
  border:1px solid rgba(60,255,178,.18);
  font-size:13px;
  line-height:1.55;
}

.copy-row{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:10px;
}

.qr-box{
  display:flex;
  justify-content:center;
  margin:20px 0;
}

.qr-box img{
  width:220px;
  height:220px;
  border-radius:20px;
  padding:12px;
  background:rgba(255,255,255,.96);
  box-shadow:0 20px 50px rgba(0,0,0,.35);
  opacity:0;
  transform:translateY(10px) scale(.96);
  animation:qrFade .65s cubic-bezier(.2,.8,.2,1) forwards, qrPulse 5.2s ease-in-out .85s infinite;
}

@keyframes qrFade{
  to{
    opacity:1;
    transform:translateY(0) scale(1);
  }
}

@keyframes qrPulse{
  0%,100%{ box-shadow:0 20px 50px rgba(0,0,0,.35), 0 0 0 0 rgba(98,212,255,.08); }
  50%{ box-shadow:0 20px 50px rgba(0,0,0,.35), 0 0 0 8px rgba(98,212,255,0); }
}

.accordion{
  margin-top:16px;
  border:1px solid var(--stroke);
  border-radius:14px;
  background:rgba(255,255,255,.02);
  overflow:hidden;
}

.accordion-btn{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 16px;
  border:0;
  background:transparent;
  color:var(--text);
  cursor:pointer;
  text-align:left;
  font-size:14px;
  font-weight:650;
}

.accordion-btn:hover{ background:rgba(255,255,255,.02); }

.accordion-btn .accordion-arrow{
  transition:transform .2s ease;
  font-size:14px;
  color:var(--muted);
  flex:0 0 auto;
}

.accordion.open .accordion-btn .accordion-arrow{ transform:rotate(180deg); }

.accordion-content{
  display:none;
  padding:0 16px 16px;
  border-top:1px solid var(--stroke);
}

.accordion.open .accordion-content{ display:block; }

.server-box{
  margin-top:14px;
  padding:14px;
  border:1px solid var(--stroke);
  border-radius:14px;
  background:linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
}

.server-title{
  font-size:14px;
  font-weight:700;
  margin-bottom:6px;
}

.tabs{
  display:flex;
  gap:10px;
  margin-top:15px;
  margin-bottom:15px;
  flex-wrap:wrap;
}

.tab-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:40px;
  padding:9px 14px;
  border:1px solid var(--stroke);
  border-radius:999px;
  background:rgba(255,255,255,.03);
  cursor:pointer;
  font-size:13px;
  color:var(--muted);
  transition:all .2s ease;
}

.tab-btn:hover{
  border-color:rgba(98,212,255,.35);
  color:var(--text);
}

.tab-btn.active{
  border-color:rgba(98,212,255,.55);
  color:var(--text);
  background:linear-gradient(135deg, rgba(98,212,255,.16), rgba(124,92,255,.16));
  box-shadow:0 10px 24px rgba(0,0,0,.16);
}

.tab-content{
  display:none;
  font-size:14px;
  line-height:1.6;
  animation:guideFade .25s ease;
}

.tab-content.active{ display:block; }

@keyframes guideFade{
  from{ opacity:0; transform:translateY(4px); }
  to{ opacity:1; transform:translateY(0); }
}

.guide-header{
  display:grid;
  gap:10px;
}

.guide-app-card{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  padding:14px;
  border-radius:14px;
  border:1px solid var(--stroke);
  background:rgba(255,255,255,.03);
}

.guide-app-meta{
  display:grid;
  gap:5px;
}

.guide-app-title{
  font-size:14px;
  font-weight:700;
}

.guide-steps{
  margin:14px 0 0;
  padding:0;
  list-style:none;
  display:grid;
  gap:10px;
}

.guide-step{
  display:grid;
  grid-template-columns:28px minmax(0, 1fr);
  gap:12px;
  align-items:flex-start;
  padding:12px 0;
  border-bottom:1px solid rgba(130,170,255,.10);
}

.guide-step:last-child{ border-bottom:none; }

.guide-step-num{
  display:flex;
  align-items:center;
  justify-content:center;
  width:28px;
  height:28px;
  border-radius:999px;
  border:1px solid rgba(98,212,255,.28);
  background:rgba(98,212,255,.10);
  font-size:12px;
  font-weight:700;
  color:var(--text);
}

.guide-step-text{ min-width:0; }

.guide-shot-list{
  display:grid;
  gap:10px;
  margin-top:14px;
}

.guide-shot{
  border:1px solid var(--stroke);
  border-radius:14px;
  background:rgba(255,255,255,.02);
  overflow:hidden;
}

.guide-shot summary{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:13px 14px;
  cursor:pointer;
  list-style:none;
  font-size:13px;
  font-weight:650;
}

.guide-shot summary::-webkit-details-marker{ display:none; }

.guide-shot summary::after{
  content:"▼";
  color:var(--muted);
  font-size:12px;
  transition:transform .2s ease;
}

.guide-shot[open] summary::after{ transform:rotate(180deg); }

.guide-shot-body{
  padding:0 14px 14px;
  border-top:1px solid rgba(130,170,255,.10);
}

.guide-shot-image{
  display:block;
  width:100%;
  margin-top:14px;
  border-radius:12px;
  border:1px solid rgba(130,170,255,.16);
  background:rgba(5,8,14,.35);
}

.support-card{
  display:grid;
  gap:14px;
}

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

.support-form{
  display:grid;
  gap:12px;
}

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

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

.telegram-promo-inline {
  margin-bottom: 18px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-8px);
  transition: max-height .28s ease, opacity .28s ease, transform .28s ease, margin-bottom .28s ease;
}

.telegram-promo-inline.show {
  max-height: 320px;
  opacity: 1;
  transform: translateY(0);
}

.telegram-promo-inline.is-closing {
  margin-bottom: 0;
  max-height: 0;
  opacity: 0;
  transform: translateY(-8px);
}

.telegram-promo-card {
  border: 1px solid rgb(37 99 235 / 22%);
  background: linear-gradient(135deg, rgb(37 99 235 / 10%), rgb(59 130 246 / 4%));
  box-shadow: 0 10px 30px rgb(37 99 235 / 10%);
}

.telegram-promo-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.telegram-promo-title {
  margin-top: 12px;
}

.telegram-promo-text {
  margin-top: 16px;
}

.telegram-promo-actions {
  margin-top: 16px;
}

.telegram-promo-close {
  appearance: none;
  border: 1px solid rgb(15 23 42 / 10%);
  background: rgb(255 255 255 / 72%);
  color: rgb(15 23 42 / 72%);
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}

.telegram-promo-close:hover {
  background: rgb(255 255 255 / 96%);
  color: rgb(15 23 42 / 96%);
  border-color: rgb(15 23 42 / 16%);
  transform: translateY(-1px);
}

.telegram-promo-close:active {
  transform: translateY(0);
}

@media (max-width: 640px) {
  .telegram-promo-inline.show {
    max-height: 420px;
  }

  .telegram-promo-head {
    gap: 12px;
  }

  .telegram-promo-close {
    width: 34px;
    height: 34px;
    min-width: 34px;
  }
}

@media (min-width:760px){
  .support-grid{ grid-template-columns:280px minmax(0, 1fr); }
}

/* ---------- toast ---------- */

.toast{
  position:fixed;
  left:50%;
  bottom:18px;
  transform:translateX(-50%);
  background:rgba(12,18,30,.92);
  border:1px solid rgba(130,170,255,.20);
  color:rgba(234,241,255,.92);
  border-radius:999px;
  padding:10px 14px;
  box-shadow:0 18px 60px rgba(0,0,0,.45);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  opacity:0;
  pointer-events:none;
  z-index:1000;
}

.toast.show{ animation:toastIn .2s ease both; }

@keyframes toastIn{
  from{ opacity:0; transform:translateX(-50%) translateY(6px); }
  to{ opacity:1; transform:translateX(-50%) translateY(0); }
}

.toast.hide{ animation:toastOut .2s ease both; }

@keyframes toastOut{
  from{ opacity:1; transform:translateX(-50%) translateY(0); }
  to{ opacity:0; transform:translateX(-50%) translateY(6px); }
}

/* ---------- inline edit ---------- */

.inline-edit{
  display:flex;
  align-items:center;
  gap:10px;
}

.icon-btn{
  width:34px;
  height:34px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:12px;
  border:1px solid var(--stroke2);
  background:rgba(5,8,14,.45);
  color:var(--text);
  cursor:pointer;
  transition:transform .14s ease, border-color .14s ease, filter .14s ease;
  flex:0 0 auto;
}

.icon-btn:hover{ transform:translateY(-1px); border-color:rgba(98,212,255,.55); }
.icon-btn:active{ transform:translateY(0); filter:brightness(.96); }

.inline-edit .input{
  padding:10px 12px;
  border-radius:12px;
}

.inline-edit .mini-btn{
  width:34px;
  height:34px;
  border-radius:12px;
}

/* ---------- responsive ---------- */

@media (max-width:920px){
  .header,
  .cabinet-hero,
  .guide-app-card,
  .support-head{
    align-items:stretch;
  }
}

@media (max-width:640px){
  .container{ width:min(1120px, calc(100% - 24px)); }
  .page{ padding:20px 0 34px; }
  .card{ padding:16px; }
  .cabinet-shell .row,
  .cabinet-shell .copy-row,
  .support-actions{ flex-direction:column; align-items:stretch; }
  .cabinet-shell .btn,
  .cabinet-shell .btn.small,
  .support-actions .btn{ width:100%; }
  .tabs{ gap:8px; }
  .tab-btn{ flex:1 1 calc(50% - 8px); }
  .guide-step{ grid-template-columns:24px minmax(0, 1fr); gap:10px; }
  .guide-step-num{ width:24px; height:24px; font-size:11px; }
  .qr-box img{ width:min(220px, 100%); height:auto; }
}
