/* ============================================================
   Secure Access — Cabinet (app) styles
   The cabinet renders inside a <= 520px column. Same markup
   in a phone (Telegram WebApp) and a browser window.
   ============================================================ */

/* ---- Showcase page chrome ---- */
.show-head { text-align: center; padding: 40px 24px 8px; max-width: 760px; margin: 0 auto; }
.show-head h1 { font-size: clamp(26px, 4vw, 38px); letter-spacing: -0.03em; }
.show-head p { color: var(--text-muted); font-size: 16px; margin: 14px 0 0; }

.statebar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
  padding: 16px 24px; margin-top: 22px;
  background: color-mix(in oklab, var(--bg) 75%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.statebar .label { color: var(--text-dim); font-size: 13px; margin-right: 2px; }
.segs { display: inline-flex; background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--r-pill); padding: 4px; gap: 2px; }
.segs button {
  appearance: none; border: 0; background: transparent; color: var(--text-muted);
  font-family: inherit; font-size: 13px; font-weight: 600; letter-spacing: -0.01em;
  padding: 8px 14px; border-radius: var(--r-pill); cursor: pointer; white-space: nowrap;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.segs button:hover { color: var(--text); }
.segs button[aria-selected="true"] { background: var(--brand-grad); color: #fff; box-shadow: var(--glow-brand); }

/* ---- Frame layout ---- */
.frames {
  display: flex; gap: 56px; justify-content: center; align-items: flex-start;
  padding: 44px 24px 100px; flex-wrap: wrap;
}
.frame-col { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.frame-cap { display: inline-flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 13.5px; font-weight: 600; }
.frame-cap svg { width: 16px; height: 16px; color: var(--brand); }

/* ---- Telegram phone frame ---- */
.tg-phone {
  position: relative; width: 380px; height: 800px; flex: none;
  background: linear-gradient(180deg, #1a1f2c, #0d1019);
  border: 1.5px solid #2a3043; border-radius: 48px; padding: 12px;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,.06);
}
.tg-screen { position: relative; width: 100%; height: 100%; background: var(--bg); border-radius: 38px; overflow: hidden; display: flex; flex-direction: column; }
.tg-statusbar { height: 44px; display: flex; align-items: center; justify-content: space-between; padding: 0 26px; font-size: 14px; font-weight: 600; flex: none; }
.tg-statusbar .tg-icons { display: flex; gap: 6px; align-items: center; color: var(--text-muted); }
.tg-bar {
  flex: none; display: flex; align-items: center; gap: 12px; padding: 8px 16px 12px;
  border-bottom: 1px solid var(--border-soft); background: var(--surface-1);
}
.tg-bar .tg-back { color: var(--text-muted); display: flex; }
.tg-bar .tg-title { font-weight: 600; font-size: 16px; letter-spacing: -0.01em; }
.tg-bar .tg-sub { font-size: 12px; color: var(--success); }
.tg-bar .tg-dots { margin-left: auto; color: var(--text-dim); }

/* ---- Browser window frame ---- */
.bw {
  width: 560px; max-width: 100%; flex: none;
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-lg);
}
.bw-bar { height: 46px; display: flex; align-items: center; gap: 14px; padding: 0 16px; background: #0d1019; border-bottom: 1px solid var(--border); }
.bw-dots { display: flex; gap: 8px; }
.bw-dots i { width: 12px; height: 12px; border-radius: 50%; display: block; }
.bw-dots i:nth-child(1){ background:#ff5f57; } .bw-dots i:nth-child(2){ background:#febc2e; } .bw-dots i:nth-child(3){ background:#28c840; }
.bw-url { flex: 1; height: 30px; display: flex; align-items: center; gap: 8px; padding: 0 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; color: var(--text-dim); font-size: 13px; font-family: var(--font-mono); }
.bw-url svg { width: 14px; height: 14px; color: var(--success); }
.bw-body { height: 720px; overflow-y: auto; background: var(--bg); }

/* ---- The cabinet column (shared) ---- */
.cab { width: 100%; max-width: 520px; margin: 0 auto; padding: 18px 16px 28px; display: flex; flex-direction: column; gap: 14px; min-height: 100%; }
.bw .cab { padding: 26px 24px 32px; }

/* cabinet header */
.cab-head { display: flex; align-items: center; justify-content: space-between; }
.cab-head .sa-word { font-size: 16px; }

/* status card */
.status-card { position: relative; overflow: hidden; }
.status-card .glow { position: absolute; inset: 0; background: radial-gradient(80% 120% at 100% 0%, color-mix(in oklab, var(--brand-a) 16%, transparent), transparent 60%); pointer-events: none; }
.status-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.status-state { font-size: 22px; font-weight: 680; letter-spacing: -0.025em; margin-top: 12px; display: flex; align-items: center; gap: 10px; }
.status-state .ss-icon { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-grad-soft); color: #cdd7ff; }
.status-rows { display: flex; flex-direction: column; gap: 0; margin-top: 16px; }
.status-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-top: 1px solid var(--border-soft); font-size: 14px; }
.status-row .k { color: var(--text-dim); }
.status-row .v { color: var(--text); font-weight: 500; display: inline-flex; align-items: center; gap: 8px; }

/* banner cards */
.banner { position: relative; overflow: hidden; }
.banner.trial { background: linear-gradient(135deg, color-mix(in oklab, var(--brand-a) 18%, var(--surface-1)), var(--surface-1)); border-color: color-mix(in oklab, var(--brand-a) 30%, var(--border)); }
.banner.expired { background: linear-gradient(135deg, color-mix(in oklab, var(--warning) 14%, var(--surface-1)), var(--surface-1)); border-color: color-mix(in oklab, var(--warning) 28%, var(--border)); }
.banner h3 { font-size: 18px; letter-spacing: -0.02em; display: flex; align-items: center; gap: 10px; }
.banner p { color: var(--text-muted); font-size: 14px; margin: 8px 0 16px; }

/* section title */
.cab-sec { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.cab-sec h2 { font-size: 14px; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; color: var(--text-dim); }
.cab-sec .count { font-size: 13px; color: var(--text-dim); font-family: var(--font-mono); }

/* device list */
.dev-list { display: flex; flex-direction: column; gap: 10px; }
.dev {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 14px; transition: border-color var(--t-base) var(--ease);
}
.dev:hover { border-color: color-mix(in oklab, var(--brand-a) 26%, var(--border)); }
.dev-top { display: flex; align-items: center; gap: 12px; }
.dev-top .tile { width: 42px; height: 42px; }
.dev-name { font-weight: 600; font-size: 15.5px; letter-spacing: -0.01em; }
.dev-meta { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; }
.dev-top .pill { margin-left: auto; }
.dev-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; align-items: center; }
.dev-smart { display: inline-flex; align-items: center; gap: 9px; padding: 7px 12px 7px 12px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface-2); font-size: 13px; font-weight: 600; color: var(--text-muted); cursor: pointer; transition: all var(--t-base) var(--ease); }
.dev-smart[data-on="true"] { background: var(--brand-grad-soft); border-color: color-mix(in oklab, var(--brand-a) 35%, transparent); color: #cdd7ff; }
.dev-smart svg { width: 16px; height: 16px; }
.dev-smart[data-on="true"] .bolt { color: var(--warning); }
.dev-actions .grow { flex: 1; }

/* empty state */
.empty { text-align: center; padding: 32px 20px; border: 1px dashed var(--border); border-radius: var(--r-lg); background: var(--surface-1); }
.empty .emoji { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 20px; display: flex; align-items: center; justify-content: center; background: var(--brand-grad-soft); color: #cdd7ff; }
.empty h3 { font-size: 17px; letter-spacing: -0.015em; }
.empty p { color: var(--text-muted); font-size: 14px; margin: 8px auto 18px; max-width: 30ch; }

/* connect grid */
.connect-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.connect-tile {
  display: flex; align-items: center; gap: 12px; padding: 14px; cursor: pointer;
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--r-md);
  transition: border-color var(--t-base) var(--ease), transform var(--t-base) var(--ease), background var(--t-base) var(--ease);
  font-weight: 600; font-size: 14.5px; color: var(--text); text-align: left;
}
.connect-tile:hover { border-color: color-mix(in oklab, var(--brand-a) 35%, var(--border)); transform: translateY(-2px); background: var(--surface-2); }
.connect-tile .tile { width: 38px; height: 38px; }
.connect-tile .tile svg { width: 19px; height: 19px; }

.limit-note { padding: 16px; background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--r-md); }
.limit-note p { color: var(--text-muted); font-size: 14px; margin: 0 0 14px; display: flex; gap: 10px; }
.limit-note svg { color: var(--warning); flex: none; }

/* footer actions */
.cab-foot { display: flex; gap: 10px; margin-top: 8px; }

/* login screen */
.login { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 60px 28px; gap: 0; min-height: 100%; justify-content: center; }
.login .mark-wrap { width: 76px; height: 76px; display: flex; align-items: center; justify-content: center; border-radius: 22px; background: var(--brand-grad-soft); border: 1px solid color-mix(in oklab, var(--brand-a) 25%, transparent); margin-bottom: 24px; }
.login h1 { font-size: 26px; letter-spacing: -0.03em; }
.login .lead { color: var(--text-muted); font-size: 15px; margin: 10px 0 30px; }
.tg-login-btn {
  display: inline-flex; align-items: center; gap: 10px; height: 50px; padding: 0 24px;
  background: #2aabee; color: #fff; border: 0; border-radius: var(--r-pill);
  font-family: inherit; font-size: 15.5px; font-weight: 600; cursor: pointer;
  box-shadow: 0 8px 30px rgba(42,171,238,.35); transition: transform var(--t-fast) var(--ease), box-shadow var(--t-base) var(--ease);
}
.tg-login-btn:hover { transform: translateY(-1px); box-shadow: 0 12px 38px rgba(42,171,238,.45); }
.tg-login-btn:active { transform: translateY(1px); }
.tg-login-btn svg { width: 22px; height: 22px; }
.login .fine { color: var(--text-dim); font-size: 13px; margin-top: 20px; display: inline-flex; align-items: center; gap: 7px; }
.login .fine svg { width: 15px; height: 15px; color: var(--success); }

/* email auth (tabs + form) */
.auth-tabs { display: flex; gap: 6px; width: 100%; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 4px; margin-bottom: 14px; }
.auth-tab { flex: 1; height: 38px; border: 0; background: transparent; color: var(--text-muted); font: inherit; font-weight: 600; font-size: 14px; border-radius: 9px; cursor: pointer; transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.auth-tab.is-active { background: var(--surface-3); color: var(--text); }
.auth-form { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.auth-form .input { width: 100%; text-align: left; }
.auth-err { color: var(--danger); font-size: 13px; text-align: left; }
.auth-hint { color: var(--text-dim); font-size: 12.5px; text-align: center; margin: 12px 2px 0; line-height: 1.5; }
.auth-or { display: flex; align-items: center; gap: 12px; width: 100%; color: var(--text-dim); font-size: 12.5px; margin: 18px 0 8px; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* link-telegram card (site-only accounts) */
.link-tg { text-align: left; margin-top: 14px; }
.link-tg .lt-h { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 15px; }
.link-tg .lt-h svg { color: var(--brand-a); }
.link-tg p { color: var(--text-muted); font-size: 13.5px; margin: 0 0 12px; }

/* toast */
.toast-host { position: absolute; left: 0; right: 0; bottom: 18px; display: flex; justify-content: center; pointer-events: none; z-index: 60; padding: 0 16px; }
.toast {
  display: flex; align-items: center; gap: 10px; max-width: 92%;
  background: color-mix(in oklab, var(--surface-3) 92%, transparent); backdrop-filter: blur(10px);
  border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px 16px;
  font-size: 13.5px; color: var(--text); box-shadow: var(--shadow-md);
  transform: translateY(20px); opacity: 0; transition: transform var(--t-base) var(--ease), opacity var(--t-base) var(--ease);
}
.toast.show { transform: none; opacity: 1; }
.toast svg { color: var(--brand); flex: none; width: 18px; height: 18px; }

/* skeleton blocks */
.sk-row { height: 14px; border-radius: 7px; }

@media (max-width: 900px) { .frames { gap: 36px; } .tg-phone { transform: scale(.92); transform-origin: top center; } }
@media (max-width: 560px) {
  .tg-phone { width: 340px; height: 720px; }
  .bw { display: none; }
  .frames { padding-bottom: 60px; }
}
