/* PudgeVPN — cabinet styles (extends styles.css tokens) */

.app-body { min-height: 100dvh; }
.app-main { padding-block: 40px 80px; max-width: 880px; }
.app-center { display: grid; place-items: center; min-height: 50vh; }

/* Spinner */
.spinner {
  width: 38px; height: 38px; border-radius: 50%;
  border: 3px solid var(--color-border-strong); border-top-color: var(--color-accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } }

/* ── Auth ─────────────────────────────────────────────────── */
.auth { display: grid; place-items: center; padding-top: 24px; }
.auth__card {
  width: 100%; max-width: 420px;
  background: var(--color-card); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow-card);
}
.auth__title { font-size: 1.6rem; font-weight: 700; }
.auth__sub { color: var(--color-muted-foreground); margin: 8px 0 22px; font-size: 0.95rem; }

.tabs { display: flex; gap: 4px; background: rgba(255,255,255,0.04); border-radius: 10px; padding: 4px; margin-bottom: 22px; }
.tab {
  flex: 1; padding: 9px; border: none; background: transparent; color: var(--color-muted-foreground);
  border-radius: 7px; font-weight: 600; font-size: 0.92rem; transition: all .18s var(--ease);
}
.tab.is-active { background: var(--color-primary); color: #fff; }

.auth__form { display: grid; gap: 16px; }
.field { display: grid; gap: 7px; }
.field__label { font-size: 0.85rem; font-weight: 500; color: var(--color-muted-foreground); }
.input {
  width: 100%; padding: 12px 14px; font-size: 0.98rem;
  background: var(--color-background); color: var(--color-foreground);
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm);
  transition: border-color .18s var(--ease);
}
.input:focus-visible { outline: none; border-color: var(--color-accent); }
.auth__msg { margin-top: 16px; font-size: 0.9rem; min-height: 1.2em; }
.auth__msg.is-error { color: #FCA5A5; }
.auth__msg.is-ok { color: #86EFAC; }

/* ── Dashboard ────────────────────────────────────────────── */
.dash__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.dash__title { font-size: 1.7rem; font-weight: 700; }
.dash__email { color: var(--color-muted-foreground); font-size: 0.95rem; margin-top: 4px; }
.dash__card { margin-bottom: 28px; }
.dash__h2 { font-size: 1.25rem; font-weight: 600; margin-bottom: 6px; }
.dash__hint { color: var(--color-muted-foreground); font-size: 0.92rem; margin-bottom: 18px; }

.status-pill {
  padding: 6px 14px; border-radius: 999px; font-size: 0.82rem; font-weight: 600;
  background: rgba(34,197,94,0.12); color: #86EFAC; border: 1px solid rgba(34,197,94,0.3);
  text-transform: capitalize;
}
.status-pill.is-expired, .status-pill.is-suspended { background: rgba(220,38,38,0.12); color: #FCA5A5; border-color: rgba(220,38,38,0.3); }

.sub-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.sub-label { display: block; font-size: 0.8rem; color: var(--color-muted-foreground); margin-bottom: 5px; }
.sub-value { font-size: 1.1rem; font-weight: 600; }
.traffic-bar { margin-top: 18px; height: 8px; background: rgba(255,255,255,0.06); border-radius: 999px; overflow: hidden; }
.traffic-bar__fill { display: block; height: 100%; width: 0; background: var(--color-accent); border-radius: 999px; transition: width .5s var(--ease); }

/* ── Config cards ─────────────────────────────────────────── */
.cfg {
  background: var(--color-card); border: 1px solid var(--color-border);
  border-radius: var(--radius); padding: 22px; margin-bottom: 16px;
  display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center;
}
.cfg__title { font-size: 1.05rem; font-weight: 600; margin-bottom: 4px; }
.cfg__tag { font-size: 0.8rem; color: var(--color-muted-foreground); margin-bottom: 14px; }
.cfg__uri {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.78rem;
  color: #CBD5E1; background: var(--color-background); border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); padding: 10px 12px; word-break: break-all; max-height: 64px; overflow: hidden;
  margin-bottom: 12px;
}
.cfg__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cfg__qr { background: #fff; padding: 8px; border-radius: 12px; line-height: 0; }
.cfg__qr canvas, .cfg__qr img { display: block; width: 116px; height: 116px; }

.btn--sm { padding: 8px 14px; font-size: 0.85rem; }

.dash__sub-import { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 8px; }

/* ── Toast ────────────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(10px);
  background: var(--color-primary); color: #fff; padding: 12px 20px; border-radius: 10px;
  border: 1px solid var(--color-border-strong); box-shadow: var(--shadow-card);
  font-size: 0.9rem; font-weight: 500; opacity: 0; transition: opacity .25s var(--ease), transform .25s var(--ease); z-index: 200;
}
.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 620px) {
  .sub-grid { grid-template-columns: 1fr; gap: 12px; }
  .cfg { grid-template-columns: 1fr; }
  .cfg__qr { justify-self: start; }
}
