/* Shared stylesheet for every user-facing server page (confirmation, manage,
   login, device limit, errors, uninstall). Same palette as canvashack.com:
   #131313 background, #e80031 red, #52d11c green. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: #131313;
  color: #f3f5fa;
  font-family: InterVariable, Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

/* ---------- layout ---------- */
.pg {
  max-width: 560px;
  margin: 0 auto;
  padding: 56px 20px 48px;
}

.pg-wide {
  max-width: 920px;
}

.pg-head {
  text-align: center;
  margin-bottom: 28px;
}

.pg-logo {
  height: 40px;
  width: auto;
  margin-bottom: 22px;
  user-select: none;
}

.pg-head h1 {
  margin: 0 0 10px;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.pg-head p {
  margin: 0 auto;
  max-width: 480px;
  color: #a6a6ad;
  font-size: 15.5px;
  line-height: 1.55;
}

.pg-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.pg-stack {
  display: grid;
  gap: 16px;
}

/* ---------- cards ---------- */
.pg-card {
  background: #171717;
  border: 1px solid #262626;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.pg-card h2 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.pg-card p {
  margin: 0 0 14px;
  color: #a6a6ad;
  font-size: 14.5px;
  line-height: 1.55;
}

.pg-card p:last-child {
  margin-bottom: 0;
}

.pg-card.center {
  text-align: center;
}

.pg-accent {
  border-color: #3a1620;
  background: linear-gradient(180deg, #1c1316 0%, #171717 60%);
}

/* status icon: inset-shadow disc + crisp SVG ring and mark */
.pg-icon {
  position: relative;
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #121212;
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.55),
    inset 0 -1px 0 rgba(255, 255, 255, 0.04),
    0 1px 0 rgba(255, 255, 255, 0.03);
}

.pg-icon::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.1;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}

.pg-icon svg {
  position: relative;
  width: 58px;
  height: 58px;
  overflow: visible;
  shape-rendering: geometricPrecision;
}

.pg-icon .ring {
  opacity: 0.55;
  stroke-dasharray: 182;
  stroke-dashoffset: 182;
  animation: pg-draw 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.pg-icon .mark {
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: pg-draw 0.45s cubic-bezier(0.4, 0, 0.2, 1) 0.2s forwards;
}

/* the dot fades in while the bar is still finishing, so it reads as one motion */
.pg-icon .mark-dot {
  opacity: 0;
  animation: pg-fade 0.2s ease-out 0.42s forwards;
}

@keyframes pg-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes pg-fade {
  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pg-icon .mark,
  .pg-icon .ring {
    animation: none;
    stroke-dashoffset: 0;
  }

  .pg-icon .mark-dot {
    animation: none;
    opacity: 1;
  }
}

.pg-icon.ok {
  color: #52d11c;
}

.pg-icon.err {
  color: #ff4d6a;
}

.pg-icon.warn {
  color: #f1c232;
}

/* key/value rows */
.pg-kv {
  display: grid;
  gap: 8px;
  margin: 16px 0;
  padding: 14px 16px;
  border: 1px solid #262626;
  border-radius: 12px;
  background: #121212;
  text-align: left;
}

.pg-kv div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}

.pg-kv span {
  color: #a6a6ad;
}

.pg-kv b {
  font-weight: 600;
  color: #fff;
  word-break: break-all;
  text-align: right;
}

.pg-email {
  display: inline-block;
  margin: 4px 0 0;
  padding: 10px 14px;
  border: 1px solid #262626;
  border-radius: 12px;
  background: #121212;
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  word-break: break-all;
}

/* numbered steps: red step badges with a connecting line */
.pg-steps {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0;
  text-align: left;
}

.pg-steps li {
  position: relative;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 0 0 16px;
  color: #d9d9de;
  font-size: 14.5px;
  line-height: 1.5;
}

.pg-steps li:last-child {
  padding-bottom: 0;
}

/* connector between badges */
.pg-steps li:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 30px;
  bottom: 2px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.03));
}

.pg-steps li i {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #3a3a3a 0%, #222 100%);
  color: #f3f5fa;
  font-size: 12.5px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: -0.02em;
  border: 1px solid #454545;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -8px 10px -6px rgba(0, 0, 0, 0.7),
    0 1px 2px rgba(0, 0, 0, 0.5);
  margin-top: -1px;
}

.pg-steps li span b {
  color: #fff;
  font-weight: 600;
}

/* ---------- buttons (same look as the site's pricing CTAs) ---------- */
.pg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 50px;
  padding: 0 22px;
  border-radius: 999px;
  font: inherit;
  font-size: 16px;
  line-height: 1;
  font-weight: 500;
  letter-spacing: -0.02em;
  text-decoration: none;
  user-select: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.pg-btn-primary {
  background: #e80031;
  color: #ffe9e9;
  border: 2px solid #a00d0d;
  box-shadow: inset 0 0 15px #6d0202a1, inset 0 -40px 40px -30px rgba(114, 4, 4, 0.959);
}

.pg-btn-primary:hover {
  background: #d4002e;
  border-color: #a10808;
  color: #ffd3d3e0;
  box-shadow: inset 0 0 15px #5c0202a1, inset 0 -40px 40px -30px rgba(97, 3, 3, 0.959);
}

.pg-btn-ghost {
  background: #252525f1;
  color: #a0a0a0;
  border: 2px solid #3f3f3f;
  box-shadow: inset 0 0 15px #131313, inset 0 -30px 30px -30px rgba(14, 14, 14, 0.8);
}

.pg-btn-ghost:hover {
  background: #202020f1;
  border-color: #3d3d3d;
  color: #8b8b8b;
  box-shadow: inset 0 0 15px #1a1a1a, inset 0 -30px 30px -30px rgba(12, 12, 12, 0.938);
}

.pg-btn-green {
  background: #52d11c;
  color: #0e2a05;
  border: 2px solid #2f8f0f;
  box-shadow: inset 0 0 15px rgba(30, 110, 10, 0.5), inset 0 -40px 40px -30px rgba(25, 100, 5, 0.6);
}

.pg-btn-green:hover {
  background: #47bd17;
}

.pg-btn:disabled {
  background: #2a2a2a;
  color: #6c6c74;
  border-color: #3a3a3a;
  box-shadow: inset 0 0 15px #131313;
  cursor: not-allowed;
}

.pg-btn-block {
  width: 100%;
}

.pg-btn-sm {
  height: 38px;
  padding: 0 16px;
  font-size: 13.5px;
}

.pg-btn-mini {
  height: 34px;
  padding: 0 14px;
  font-size: 13px;
  background: #252525f1;
  color: #d0d0d0;
  border: 2px solid #3f3f3f;
  box-shadow: inset 0 0 10px #131313;
}

.pg-btn-mini:hover {
  background: #202020f1;
}

.pg-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.pg-actions.left {
  justify-content: flex-start;
}

/* ---------- forms ---------- */
.pg-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  text-align: left;
}

.pg-field label,
.pg-label {
  color: #a6a6ad;
  font-size: 12.5px;
  font-weight: 500;
}

.pg-input,
.pg-textarea {
  width: 100%;
  padding: 0 14px;
  height: 50px;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  background: #121212;
  color: #f3f5fa;
  font: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s ease;
}

.pg-textarea {
  height: auto;
  padding: 12px 14px;
  line-height: 1.5;
  resize: vertical;
}

.pg-input:focus,
.pg-textarea:focus {
  border-color: #4a4a4a;
}

.pg-input::placeholder,
.pg-textarea::placeholder {
  color: #6c6c74;
}

.pg-hint {
  color: #7d7d85;
  font-size: 13px;
}

/* feedback line (manage.js sets .feedback-message.visible.error|success and .feedback.error|success) */
.feedback-message,
.feedback {
  min-height: 20px;
  margin-top: 10px;
  font-size: 13.5px;
  text-align: center;
}

.feedback-message.error,
.feedback.error {
  color: #ff8a9b;
}

.feedback-message.success,
.feedback.success {
  color: #7be495;
}

/* ---------- radio list (uninstall) ---------- */
.pg-reasons {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.pg-reason {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  background: #121212;
  color: #e6e6ea;
  font-size: 14.5px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.pg-reason:hover {
  border-color: #3a3a3a;
}

.pg-reason input {
  appearance: none;
  width: 18px;
  height: 18px;
  margin: 0;
  flex: none;
  border: 2px solid #4a4a4a;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.pg-reason input::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e80031;
  transform: scale(0);
  transition: transform 0.15s ease;
}

.pg-reason input:checked {
  border-color: #e80031;
}

.pg-reason input:checked::after {
  transform: scale(1);
}

.pg-reason:has(input:checked) {
  border-color: #e80031;
  background: #1c1215;
}

/* ---------- pills ---------- */
.pg-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid #3a3a3a;
  background: #262626;
  color: #d0d0d5;
  font-size: 12.5px;
  font-weight: 600;
  vertical-align: middle;
}

.pg-pill.ok {
  border-color: #1f5c33;
  background: #11291a;
  color: #7be495;
}

.pg-pill.bad {
  border-color: #6b1d2a;
  background: #2b1116;
  color: #ff8a9b;
}

/* ---------- manage page ---------- */
.mg-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.mg-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e80031;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  flex: none;
}

.mg-user {
  flex: 1;
  min-width: 0;
  color: #a6a6ad;
  font-size: 13.5px;
}

.mg-user span {
  display: block;
  color: #fff;
  font-weight: 600;
  font-size: 14.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* manage.js injects: h2 (status), hr, p (plan rows), hr.hr-solid, .manage-btn-cont with .btn.btn-primary buttons */
#planDetails h2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 500;
  color: #a6a6ad;
}

#planDetails h2 span {
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid #3a3a3a;
  background: #262626;
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
}

#planDetails h2 span[style] {
  /* manage.js colours "Active" inline; override with the green pill */
  color: #7be495 !important;
  border-color: #1f5c33;
  background: #11291a;
}

#planDetails hr {
  display: none;
}

#planDetails p {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 11px 0;
  border-top: 1px solid #242424;
  color: #a6a6ad;
  font-size: 14px;
}

#planDetails p span {
  color: #fff;
  font-weight: 600;
  text-align: right;
}

#planDetails p span i {
  margin-right: 7px;
  color: #a6a6ad;
}

#planDetails .manage-btn-cont {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #242424;
}

/* buttons manage.js renders */
.btn.btn-primary,
.delete-session,
.thh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  font: inherit;
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: -0.02em;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #252525f1;
  color: #d0d0d5;
  border: 2px solid #3f3f3f;
  box-shadow: inset 0 0 15px #131313, inset 0 -30px 30px -30px rgba(14, 14, 14, 0.8);
}

.btn.btn-primary:hover,
.delete-session:hover,
.thh-btn:hover {
  background: #202020f1;
  color: #fff;
}

.btn.btn-primary.upgrade,
.thh-btn-primary {
  background: #e80031;
  color: #ffe9e9;
  border-color: #a00d0d;
  box-shadow: inset 0 0 15px #6d0202a1, inset 0 -40px 40px -30px rgba(114, 4, 4, 0.959);
}

.btn.btn-primary.upgrade:hover,
.thh-btn-primary:hover {
  background: #d4002e;
  color: #ffd3d3e0;
}

.btn.btn-primary i,
.thh-btn i {
  font-size: 13px;
}

.delete-session {
  height: 34px;
  padding: 0 14px;
  font-size: 13px;
}

/* sessions table */
.mg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.mg-table th {
  padding: 0 0 10px;
  text-align: left;
  color: #7d7d85;
  font-size: 12.5px;
  font-weight: 500;
}

.mg-table td {
  padding: 12px 0;
  border-top: 1px solid #242424;
  color: #d9d9de;
  vertical-align: middle;
}

.mg-table td.device-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}

.mg-table td:last-child,
.mg-table th:last-child {
  text-align: right;
}

/* confirm modal (manage.js uses .thh-modal-* ids/classes) */
.thh-modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.7);
  z-index: 50;
}

.thh-modal-content {
  width: 100%;
  max-width: 420px;
  background: #171717;
  border: 1px solid #262626;
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

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

.thh-modal-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.thh-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #2e2e2e;
  background: #121212;
  color: #a6a6ad;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.thh-modal-body p {
  margin: 0 0 18px;
  color: #a6a6ad;
  font-size: 14.5px;
  line-height: 1.5;
}

.thh-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ---------- footer ---------- */
.pg-foot {
  margin-top: 32px;
  text-align: center;
  color: #6c6c74;
  font-size: 13px;
}

.pg-foot a {
  color: #a6a6ad;
  text-decoration: none;
}

.pg-foot a:hover {
  color: #fff;
}

@media (max-width: 760px) {
  .pg {
    padding: 36px 16px 40px;
  }

  .pg-head h1 {
    font-size: 27px;
  }

  .pg-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .pg-card {
    padding: 20px;
  }

  #planDetails .manage-btn-cont .btn {
    width: 100%;
  }
}
