/* Signal Tools Co. — account area shared styles.
   Matches the marketing site chrome: DM Sans, teal accent, dark panel,
   ambient glow + noise overlay, fadeUp entrance. Load DM Sans in each page head. */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0e0e11;
  --bg-card: #151518;
  --teal: #5ce0c0;
  --teal-hover: #4fd4b4;
  --teal-dim: rgba(92, 224, 192, 0.12);
  --teal-glow: rgba(92, 224, 192, 0.06);
  --teal-focus: rgba(92, 224, 192, 0.3);
  --white: #ffffff;
  --gray: rgba(255, 255, 255, 0.5);
  --gray-light: rgba(255, 255, 255, 0.7);
  --border: rgba(255, 255, 255, 0.06);
  --error: #e05c5c;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--white);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Ambient radial glow */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 600px 400px at 50% 40%, var(--teal-glow), transparent),
    radial-gradient(ellipse 800px 600px at 50% 50%, rgba(92, 224, 192, 0.02), transparent);
  pointer-events: none;
  z-index: 0;
}

/* Noise texture overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

.page {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 24px;
  width: 100%;
  max-width: 480px;
}

/* Logo mark */
.logo-mark {
  width: 88px;
  height: 88px;
  margin-bottom: 28px;
  opacity: 0;
  animation: fadeUp 1s ease-out 0.1s forwards;
}

/* Brand wordmark */
.brand {
  margin-bottom: 40px;
  opacity: 0;
  animation: fadeUp 0.8s ease-out 0.25s forwards;
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
}

.brand-signal {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 5px;
  color: var(--white);
  display: block;
  line-height: 1.1;
  text-align: center;
}

.brand-tools {
  font-size: 15px;
  font-weight: 500;
  color: var(--teal);
  display: flex;
  justify-content: space-between;
  line-height: 1.6;
  letter-spacing: 1px;
}

.brand-tools span { display: inline-block; }

/* Card / panel */
.card {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 36px 32px;
  opacity: 0;
  animation: fadeUp 0.8s ease-out 0.4s forwards;
}

.card-heading {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.3px;
  margin-bottom: 8px;
  text-align: center;
}

.card-sub {
  font-size: 14px;
  font-weight: 400;
  color: var(--gray-light);
  line-height: 1.6;
  text-align: center;
  margin-bottom: 28px;
}

/* Form */
.field { margin-bottom: 16px; text-align: left; }

.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-light);
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}

.field input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--white);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.field input::placeholder { color: rgba(255, 255, 255, 0.25); }
.field input:focus { border-color: var(--teal-focus); }
.field input.invalid { border-color: var(--error); }

/* Primary button */
.btn {
  width: 100%;
  margin-top: 8px;
  padding: 14px 28px;
  background: var(--teal);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}

.btn:hover { background: var(--teal-hover); }
.btn:disabled { opacity: 0.55; cursor: default; }

/* Inline error + helper text */
.error-text {
  color: var(--error);
  font-size: 13px;
  line-height: 1.5;
  margin-top: 4px;
  min-height: 18px;
}

.helper-text {
  color: var(--gray);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
  margin-top: 18px;
}

.helper-text a { color: var(--teal); text-decoration: none; }
.helper-text a:hover { color: var(--teal-hover); }

/* Consent row (signup) — unchecked, unbundled */
.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 0 16px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--gray-light);
  cursor: pointer;
}
.consent input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  accent-color: var(--teal);
  cursor: pointer;
}
.consent a { color: var(--teal); text-decoration: none; }
.consent a:hover { color: var(--teal-hover); }

/* Verify page states */
.verify-status { text-align: center; }
.verify-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--teal-dim);
  border: 1px solid rgba(92, 224, 192, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}
.verify-icon svg { width: 28px; height: 28px; }

.spinner {
  width: 32px;
  height: 32px;
  margin: 0 auto 20px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Standalone notice (e.g. invalid link) */
.notice {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 36px 32px;
  text-align: center;
  opacity: 0;
  animation: fadeUp 0.8s ease-out 0.4s forwards;
}

.notice-badge {
  display: inline-block;
  padding: 8px 24px;
  border-radius: 100px;
  background: var(--teal-dim);
  border: 1px solid rgba(92, 224, 192, 0.2);
  color: var(--teal);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.notice p {
  font-size: 15px;
  color: var(--gray-light);
  line-height: 1.7;
}

/* Footer */
.footer {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.2);
  letter-spacing: 1px;
  margin-top: 40px;
  text-align: center;
  opacity: 0;
  animation: fadeUp 0.8s ease-out 0.6s forwards;
}

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

@media (max-width: 600px) {
  .brand-signal { font-size: 26px; letter-spacing: 4px; }
  .brand-tools { font-size: 13px; }
  .card, .notice { padding: 28px 22px; }
  .card-heading { font-size: 20px; }
}

/* ---- Authenticated app shell (dashboard) ---- */
/* The dashboard is top-aligned, not vertically centered like the auth cards. */
body.app-body { justify-content: flex-start; }

.app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 820px;
  padding: 28px 24px 64px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 24px;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--border);
}

.app-brand { display: flex; align-items: center; gap: 14px; }
.app-brand .logo-mark { width: 40px; height: 40px; margin: 0; animation: none; opacity: 1; }
.app-brand .brand { margin: 0; animation: none; opacity: 1; }
.app-brand .brand-signal { font-size: 18px; letter-spacing: 3px; }
.app-brand .brand-tools { font-size: 9px; letter-spacing: 1px; }

.linkbtn {
  background: none;
  border: none;
  color: var(--gray-light);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.3px;
  cursor: pointer;
  padding: 6px 4px;
  transition: color 0.2s;
}
.linkbtn:hover { color: var(--teal); }

.greeting { margin-bottom: 28px; opacity: 0; animation: fadeUp 0.6s ease-out 0.1s forwards; }
.greeting .label { font-size: 13px; color: var(--gray); letter-spacing: 0.3px; }
.greeting .email { font-size: 20px; font-weight: 600; color: var(--white); margin-top: 2px; word-break: break-word; }

.section { margin-bottom: 32px; opacity: 0; animation: fadeUp 0.6s ease-out 0.2s forwards; }
.section + .section { animation-delay: 0.3s; }
.section-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gray);
  margin-bottom: 14px;
}

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 24px;
}
.panel + .panel { margin-top: 12px; }

.ent-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.ent-name { font-size: 18px; font-weight: 600; color: var(--white); }

.pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 100px;
  background: var(--teal-dim);
  border: 1px solid rgba(92, 224, 192, 0.25);
  color: var(--teal);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.ent-meta { font-size: 14px; color: var(--gray-light); line-height: 1.6; }
.ent-meta .soon { color: var(--teal); font-weight: 500; }

.empty-note { font-size: 14px; color: var(--gray); line-height: 1.6; }

/* Downloads */
.dl-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.dl-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.dl-card.primary { border-color: rgba(92, 224, 192, 0.25); }
.dl-info { min-width: 0; }
.dl-name { font-size: 16px; font-weight: 600; color: var(--white); margin-bottom: 4px; }
.dl-sub { font-size: 13px; color: var(--gray); line-height: 1.5; }
.dl-btn {
  flex: 0 0 auto;
  padding: 11px 22px;
  background: var(--teal);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}
.dl-btn:hover { background: var(--teal-hover); }
.dl-btn.secondary { background: transparent; color: var(--teal); border: 1px solid rgba(92, 224, 192, 0.3); }
.dl-btn.secondary:hover { background: var(--teal-dim); }
.dl-btn:disabled { opacity: 0.5; cursor: default; }

.dl-status { font-size: 13px; color: var(--gray-light); line-height: 1.6; margin-top: 12px; min-height: 18px; }
.dl-status.ok { color: var(--teal); }

/* Inline banner (transient errors / retry) */
.banner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 24px;
  text-align: center;
}
.banner p { font-size: 14px; color: var(--gray-light); line-height: 1.6; margin-bottom: 14px; }

/* Loading skeleton */
.sk { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; position: relative; }
.sk::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.04), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.3s ease-in-out infinite;
}
.sk-line { height: 14px; margin: 14px 22px; border-radius: 6px; background: rgba(255, 255, 255, 0.05); }
.sk-block { height: 120px; }
@keyframes shimmer { to { transform: translateX(100%); } }

.hidden { display: none !important; }

@media (max-width: 600px) {
  .dl-card { flex-direction: column; align-items: stretch; }
  .dl-btn { width: 100%; }
  .greeting .email { font-size: 18px; }
}

/* Spacing between the separate top-of-dashboard slots (#bundle-card, the
   single-card Activator/Rack grids, #plugins): each host self-spaces with its
   own margin-top, independent of sibling adjacency, so a label or any element
   between slots can't break the spacing the way the + combinator did. */
#activator-row, #rack-row, #plugins { margin-top: 12px; }
#bundle-card:not(:empty) { margin-bottom: 12px; }
