/* HyperTERM by hyperNET — design system */

:root {
  --ht-bg: #070b12;
  --ht-bg-elev: #0c121c;
  --ht-surface: #101825;
  --ht-surface-2: #16202f;
  --ht-border: #1e2a3c;
  --ht-border-strong: #2b3a52;
  --ht-text: #e6edf7;
  --ht-text-dim: #8fa1bb;
  --ht-text-faint: #63748f;
  --ht-brand: #12b8ff;
  --ht-brand-deep: #0b7fd4;
  --ht-brand-soft: rgba(18, 184, 255, 0.12);
  --ht-ok: #2fd97b;
  --ht-warn: #f5b73d;
  --ht-err: #ff5f6d;
  --ht-radius: 14px;
  --ht-radius-sm: 9px;
  --ht-mono: "JetBrains Mono", "SFMono-Regular", "Menlo", "Consolas", monospace;
  --ht-sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --ht-shadow: 0 18px 50px rgba(2, 6, 14, 0.6);
  --ht-topbar-h: 60px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--ht-bg);
  color: var(--ht-text);
  font-family: var(--ht-sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ht-brand); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--ht-brand);
  outline-offset: 2px;
}

.ht-hidden { display: none !important; }
.ht-sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------------- brand ---------------- */

.ht-brand { display: flex; align-items: center; gap: 10px; }
.ht-brand img { height: 30px; width: auto; display: block; }
.ht-brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.ht-brand-name {
  font-size: 15px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
}
.ht-brand-name span { color: var(--ht-brand); }
.ht-brand-sub { font-size: 10px; color: var(--ht-text-faint); letter-spacing: 0.22em; text-transform: uppercase; }

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

.ht-auth-shell {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 32px 18px;
  background:
    radial-gradient(900px 480px at 15% -10%, rgba(18, 184, 255, 0.13), transparent 65%),
    radial-gradient(700px 420px at 100% 110%, rgba(11, 127, 212, 0.12), transparent 60%),
    var(--ht-bg);
}

.ht-auth-card {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(180deg, var(--ht-surface), var(--ht-bg-elev));
  border: 1px solid var(--ht-border);
  border-radius: 20px;
  box-shadow: var(--ht-shadow);
  padding: 32px 28px 26px;
}

.ht-auth-logo { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-bottom: 22px; }
.ht-auth-logo img { width: 78px; height: auto; }
.ht-auth-logo h1 { margin: 0; font-size: 26px; letter-spacing: 0.06em; }
.ht-auth-logo h1 b { color: var(--ht-brand); font-weight: 800; }
.ht-auth-logo p { margin: 0; font-size: 12px; color: var(--ht-text-faint); letter-spacing: 0.18em; text-transform: uppercase; }

.ht-field { margin-bottom: 15px; }
.ht-field label {
  display: block; margin-bottom: 6px; font-size: 12px; font-weight: 600;
  color: var(--ht-text-dim); letter-spacing: 0.06em; text-transform: uppercase;
}
.ht-input, .ht-select, .ht-textarea {
  width: 100%;
  background: #0a1017;
  border: 1px solid var(--ht-border-strong);
  color: var(--ht-text);
  border-radius: var(--ht-radius-sm);
  padding: 11px 12px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.ht-textarea { font-family: var(--ht-mono); font-size: 12.5px; min-height: 132px; resize: vertical; }
.ht-input:focus, .ht-select:focus, .ht-textarea:focus {
  border-color: var(--ht-brand);
  box-shadow: 0 0 0 3px var(--ht-brand-soft);
  outline: none;
}
.ht-hint { margin: 6px 0 0; font-size: 11.5px; color: var(--ht-text-faint); }

.ht-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--ht-radius-sm);
  padding: 11px 16px;
  font-size: 14px; font-weight: 600; font-family: inherit;
  cursor: pointer;
  transition: transform .12s ease, background .16s ease, border-color .16s ease, opacity .16s ease;
}
.ht-btn:active { transform: translateY(1px); }
.ht-btn[disabled] { opacity: .55; cursor: not-allowed; }
.ht-btn-primary { background: linear-gradient(180deg, var(--ht-brand), var(--ht-brand-deep)); color: #04121d; }
.ht-btn-primary:hover:not([disabled]) { filter: brightness(1.07); }
.ht-btn-ghost { background: var(--ht-surface-2); border-color: var(--ht-border-strong); color: var(--ht-text); }
.ht-btn-ghost:hover:not([disabled]) { border-color: var(--ht-brand); }
.ht-btn-danger { background: rgba(255, 95, 109, .12); border-color: rgba(255, 95, 109, .5); color: #ffb3b9; }
.ht-btn-danger:hover:not([disabled]) { background: rgba(255, 95, 109, .2); }
.ht-btn-block { width: 100%; }
.ht-btn-sm { padding: 7px 11px; font-size: 12.5px; }

.ht-divider {
  display: flex; align-items: center; gap: 12px; margin: 18px 0;
  color: var(--ht-text-faint); font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
}
.ht-divider::before, .ht-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--ht-border);
}

.ht-google { background: #fff; color: #1f2328; border-color: #fff; }
.ht-google:hover:not([disabled]) { background: #eef2f7; }
.ht-google svg { width: 17px; height: 17px; }

.ht-alert {
  border-radius: var(--ht-radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 14px;
  border: 1px solid transparent;
  line-height: 1.45;
}
.ht-alert-error { background: rgba(255, 95, 109, .1); border-color: rgba(255, 95, 109, .45); color: #ffb8bd; }
.ht-alert-ok { background: rgba(47, 217, 123, .1); border-color: rgba(47, 217, 123, .4); color: #a9f0c8; }
.ht-alert-warn { background: rgba(245, 183, 61, .1); border-color: rgba(245, 183, 61, .4); color: #f8d99b; }

.ht-auth-footer { margin-top: 18px; text-align: center; font-size: 13px; color: var(--ht-text-dim); }

/* ---------------- app shell ---------------- */

.ht-app { display: flex; flex-direction: column; height: 100%; }

.ht-topbar {
  height: var(--ht-topbar-h);
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
  background: rgba(9, 14, 22, .92);
  border-bottom: 1px solid var(--ht-border);
  backdrop-filter: blur(8px);
}
.ht-topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.ht-topbar-right { display: flex; align-items: center; gap: 10px; }

.ht-icon-btn {
  background: transparent; border: 1px solid var(--ht-border-strong); color: var(--ht-text-dim);
  width: 34px; height: 34px; border-radius: var(--ht-radius-sm);
  display: grid; place-items: center; cursor: pointer; font-size: 15px;
}
.ht-icon-btn:hover { color: var(--ht-text); border-color: var(--ht-brand); }

.ht-account { position: relative; }
.ht-account-btn {
  display: flex; align-items: center; gap: 9px;
  background: var(--ht-surface-2); border: 1px solid var(--ht-border-strong);
  color: var(--ht-text); border-radius: 999px; padding: 6px 12px 6px 6px;
  cursor: pointer; font-family: inherit; font-size: 13px;
}
.ht-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(140deg, var(--ht-brand), var(--ht-brand-deep));
  color: #04121d; font-weight: 700; font-size: 12px;
  display: grid; place-items: center;
}
.ht-menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 230px; background: var(--ht-surface); border: 1px solid var(--ht-border-strong);
  border-radius: var(--ht-radius); box-shadow: var(--ht-shadow); padding: 8px; z-index: 60;
}
.ht-menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--ht-border); margin-bottom: 6px; }
.ht-menu-head strong { display: block; font-size: 14px; }
.ht-menu-head span { font-size: 11.5px; color: var(--ht-text-faint); }
.ht-menu-item {
  display: block; width: 100%; text-align: left;
  background: transparent; border: 0; color: var(--ht-text);
  padding: 9px 10px; border-radius: var(--ht-radius-sm); font-size: 13px;
  cursor: pointer; font-family: inherit;
}
.ht-menu-item:hover { background: var(--ht-surface-2); }
.ht-menu-item.ht-danger { color: #ffb3b9; }

/* ---------------- dashboard ---------------- */

.ht-main { flex: 1 1 auto; overflow-y: auto; padding: 26px 18px 60px; }
.ht-container { max-width: 1080px; margin: 0 auto; }

.ht-page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 20px;
}
.ht-page-head h2 { margin: 0 0 4px; font-size: 22px; letter-spacing: .02em; }
.ht-page-head p { margin: 0; color: var(--ht-text-dim); font-size: 13px; }

.ht-toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.ht-toolbar .ht-input { max-width: 300px; }
.ht-toolbar .ht-select { max-width: 190px; }

.ht-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

.ht-card {
  background: linear-gradient(180deg, var(--ht-surface), var(--ht-bg-elev));
  border: 1px solid var(--ht-border);
  border-radius: var(--ht-radius);
  padding: 16px;
  transition: border-color .16s ease, transform .16s ease;
}
.ht-card:hover { border-color: var(--ht-border-strong); transform: translateY(-2px); }
.ht-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ht-card-title { display: flex; align-items: center; gap: 9px; font-size: 15.5px; font-weight: 650; }
.ht-card-target { margin: 10px 0 4px; font-family: var(--ht-mono); font-size: 13px; color: var(--ht-brand); word-break: break-all; }
.ht-card-meta { font-size: 11.5px; color: var(--ht-text-faint); letter-spacing: .1em; text-transform: uppercase; }
.ht-card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

.ht-tag {
  font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  border: 1px solid var(--ht-border-strong); border-radius: 999px;
  padding: 3px 9px; color: var(--ht-text-dim);
}

.ht-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ht-text-faint); flex: 0 0 auto; }
.ht-dot.ok { background: var(--ht-ok); box-shadow: 0 0 0 4px rgba(47, 217, 123, .16); }
.ht-dot.warn { background: var(--ht-warn); box-shadow: 0 0 0 4px rgba(245, 183, 61, .16); }
.ht-dot.err { background: var(--ht-err); box-shadow: 0 0 0 4px rgba(255, 95, 109, .16); }
.ht-dot.idle { background: var(--ht-text-faint); }

.ht-empty {
  border: 1px dashed var(--ht-border-strong);
  border-radius: var(--ht-radius);
  padding: 44px 22px; text-align: center; color: var(--ht-text-dim);
}
.ht-empty img { width: 62px; opacity: .85; margin-bottom: 14px; }
.ht-empty h3 { margin: 0 0 6px; color: var(--ht-text); font-size: 17px; }
.ht-empty p { margin: 0 0 18px; font-size: 13.5px; }

/* ---------------- modal ---------------- */

.ht-modal-backdrop {
  position: fixed; inset: 0; background: rgba(3, 6, 12, .72);
  backdrop-filter: blur(4px);
  display: grid; place-items: center; padding: 20px; z-index: 100;
  animation: ht-fade .16s ease;
}
@keyframes ht-fade { from { opacity: 0; } to { opacity: 1; } }
.ht-modal {
  width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto;
  background: linear-gradient(180deg, var(--ht-surface), var(--ht-bg-elev));
  border: 1px solid var(--ht-border-strong);
  border-radius: 18px; box-shadow: var(--ht-shadow);
  padding: 22px;
}
.ht-modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.ht-modal-head h3 { margin: 0; font-size: 18px; }
.ht-row { display: grid; grid-template-columns: 1fr 130px; gap: 12px; }
.ht-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ---------------- terminal page ---------------- */

.ht-term-layout { flex: 1 1 auto; display: flex; min-height: 0; }

.ht-sidebar {
  width: 254px; flex: 0 0 auto;
  border-right: 1px solid var(--ht-border);
  background: var(--ht-bg-elev);
  display: flex; flex-direction: column; min-height: 0;
}
.ht-sidebar.collapsed { display: none; }
.ht-sidebar-head {
  padding: 14px 14px 10px; display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--ht-text-faint);
}
.ht-sidebar-list { overflow-y: auto; padding: 4px 10px 14px; }
.ht-sidebar-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  background: transparent; border: 1px solid transparent; color: var(--ht-text-dim);
  padding: 9px 10px; border-radius: var(--ht-radius-sm); cursor: pointer;
  font-family: inherit; font-size: 13.5px; text-align: left; margin-bottom: 4px;
}
.ht-sidebar-item:hover { background: var(--ht-surface); color: var(--ht-text); }
.ht-sidebar-item.active { background: var(--ht-brand-soft); border-color: rgba(18, 184, 255, .35); color: var(--ht-text); }
.ht-sidebar-item span.name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ht-term-main { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.ht-term-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--ht-border); background: var(--ht-bg-elev);
  flex-wrap: wrap;
}
.ht-term-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ht-term-title h2 { margin: 0; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ht-status { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ht-text-dim); }
.ht-controls { display: flex; gap: 7px; flex-wrap: wrap; }

.ht-term-wrap {
  flex: 1 1 auto; min-height: 0; position: relative;
  background: #050a10; padding: 10px 12px;
}
#terminal { width: 100%; height: 100%; }

.ht-term-foot {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 8px 16px; border-top: 1px solid var(--ht-border);
  background: var(--ht-bg-elev);
  font-family: var(--ht-mono); font-size: 11.5px; color: var(--ht-text-faint);
}
.ht-term-foot .sep { color: var(--ht-border-strong); }

.ht-searchbar {
  position: absolute; top: 12px; right: 18px; z-index: 20;
  display: flex; gap: 6px; align-items: center;
  background: var(--ht-surface); border: 1px solid var(--ht-border-strong);
  border-radius: var(--ht-radius-sm); padding: 6px;
  box-shadow: var(--ht-shadow);
}
.ht-searchbar .ht-input { width: 180px; padding: 6px 9px; font-size: 13px; }

.ht-toast-stack { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.ht-toast {
  background: var(--ht-surface); border: 1px solid var(--ht-border-strong);
  border-left: 3px solid var(--ht-brand);
  border-radius: var(--ht-radius-sm); padding: 10px 14px; font-size: 13px;
  box-shadow: var(--ht-shadow); max-width: 320px;
}
.ht-toast.err { border-left-color: var(--ht-err); }
.ht-toast.ok { border-left-color: var(--ht-ok); }

/* ---------------- landing ---------------- */

.ht-hero {
  min-height: 100%; display: grid; place-items: center; padding: 60px 20px;
  background:
    radial-gradient(900px 500px at 20% -10%, rgba(18, 184, 255, .14), transparent 65%),
    var(--ht-bg);
  text-align: center;
}
.ht-hero img { width: 108px; margin-bottom: 20px; }
.ht-hero h1 { margin: 0 0 10px; font-size: clamp(30px, 6vw, 48px); letter-spacing: .04em; }
.ht-hero h1 b { color: var(--ht-brand); }
.ht-hero p { margin: 0 auto 26px; max-width: 560px; color: var(--ht-text-dim); font-size: 15px; line-height: 1.6; }
.ht-hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.ht-feature-grid {
  margin-top: 46px; display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  max-width: 900px; text-align: left;
}
.ht-feature-grid .ht-card h4 { margin: 0 0 6px; font-size: 14.5px; }
.ht-feature-grid .ht-card p { margin: 0; font-size: 13px; color: var(--ht-text-dim); line-height: 1.55; }

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

@media (max-width: 860px) {
  .ht-sidebar { position: absolute; z-index: 50; top: var(--ht-topbar-h); bottom: 0; left: 0; box-shadow: var(--ht-shadow); }
  .ht-sidebar.collapsed { display: none; }
  .ht-row { grid-template-columns: 1fr; }
  .ht-term-head { padding: 10px 12px; }
  .ht-controls .label { display: none; }
}

@media (max-width: 560px) {
  .ht-brand-sub { display: none; }
  .ht-main { padding: 18px 12px 44px; }
  .ht-toolbar .ht-input, .ht-toolbar .ht-select { max-width: none; width: 100%; }
  .ht-term-foot { font-size: 10.5px; gap: 8px; }
}
