/* ============================================================
   DIGIX AI v4 — home.css
   Styles for both Home states:
   - Disconnected: command-grid / hc-panel / flow / security-list
     (unchanged from the original build).
   - Connected: masthead / deck / card (Glass Deck).
   Uses the app's existing color variables throughout (defined in
   styles.css) rather than introducing new ones, so nothing here
   shifts the palette anywhere else in the app.
   ============================================================ */

/* ---------- shared: disconnected-state layout ----------
   Desktop: boot + flow stacked in the left column, login card
   filling the right column (spans both rows).
   Mobile: single column, ordered boot -> login -> flow, so the
   login card isn't buried below the connect-flow steps. */
.command-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  grid-template-areas:
    "boot  login"
    "flow  login";
  gap: 16px;
}
@media (max-width: 900px) {
  .command-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "boot"
      "login"
      "flow";
  }
}
.area-boot { grid-area: boot; }
.area-login { grid-area: login; }
.area-flow { grid-area: flow; }

.hc-panel {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 22px;
}

.hc-panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.hc-panel-title h3 {
  font-family: var(--display);
  font-size: 13.5px;
  letter-spacing: .3px;
}
.hc-panel-title .badge {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--text-faint);
  border: 1px solid var(--border-soft);
  padding: 3px 8px;
  border-radius: 4px;
}

/* terminal boot log (disconnected state) */
.boot-terminal {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--green-dim);
  line-height: 1.9;
  min-height: 90px;
}
.boot-cursor {
  display: inline-block;
  width: 7px;
  height: 13px;
  background: var(--green);
  margin-left: 2px;
  animation: boot-blink 1s steps(1) infinite;
  vertical-align: middle;
}
@keyframes boot-blink { 50% { opacity: 0; } }

/* "what happens after you connect" flow */
.flow {
  display: flex;
  flex-direction: column;
  margin-top: 6px;
}
.flow-step {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 4px;
}
.flow-step .idx {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  flex-shrink: 0;
}
.flow-step .body h4 {
  font-family: var(--display);
  font-size: 12.5px;
  color: var(--text);
  margin-bottom: 3px;
}
.flow-step .body p {
  font-size: 11.5px;
  color: var(--text-dim);
  line-height: 1.5;
}
.flow-connector {
  width: 1px;
  height: 16px;
  background: var(--border-soft);
  margin-left: 17px;
}

/* security checklist inside the login card */
.security-list {
  list-style: none;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.security-list li {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 11.5px;
  color: var(--text-dim);
  text-align: left;
  line-height: 1.5;
}
.security-list .check {
  color: var(--green);
  flex-shrink: 0;
  margin-top: 1px;
}

/* ---------- connected-state: Glass Deck ---------- */
.blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  z-index: 0;
  pointer-events: none;
}
.blob.b1 {
  width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(75,224,255,.14), transparent 70%);
  top: -220px; right: -140px;
}
.blob.b2 {
  width: 460px; height: 460px;
  background: radial-gradient(circle, rgba(57,255,136,.1), transparent 70%);
  bottom: -200px; left: -140px;
}

.masthead {
  position: relative;
  z-index: 2;
  margin-bottom: 34px;
  max-width: 520px;
}
.masthead .eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  margin-bottom: 10px;
}
.masthead h1 {
  font-family: var(--display);
  font-size: clamp(24px, 3.4vw, 32px);
  line-height: 1.3;
  font-weight: 700;
}

.deck {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}
.card {
  grid-column: span 4;
  background: rgba(10,20,16,.55);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
@media (max-width: 900px) { .card { grid-column: span 6; } }
@media (max-width: 600px) { .card { grid-column: span 12; } }
.card.wide { grid-column: span 8; }
@media (max-width: 900px) { .card.wide { grid-column: span 12; } }

.card .tag {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--text-faint);
  letter-spacing: 1px;
  margin-bottom: 10px;
}
.card h3 {
  font-family: var(--display);
  font-size: 13.5px;
  margin-bottom: 8px;
}
.card p {
  font-size: 11.5px;
  color: var(--text-dim);
  line-height: 1.6;
}

.boot-card { display: flex; flex-direction: column; }
.boot-body {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 2;
  color: var(--green-dim);
  min-height: 130px;
  flex: 1;
}

.action-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 14px;
}
.action-list a {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 12px 14px;
  border-radius: 9px;
  background: rgba(255,255,255,.02);
  border: 1px solid var(--border-soft);
  color: var(--text);
  text-decoration: none;
}
.action-list a:hover { border-color: var(--green-dim); }

/* ---------- shared: full multi-column footer ---------- */
.app-footer {
  position: relative;
  z-index: 2;
  align-self: stretch;
  width: 100%;
  box-sizing: border-box;
  border-top: 1px solid var(--border-soft);
  background: var(--panel);
  padding: 40px 0 24px;
  margin-top: 50px;
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 30px;
  padding-bottom: 26px;
}
@media (max-width: 760px) {
  .foot-grid { grid-template-columns: 1fr 1fr; }
}
.foot-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.foot-brand span {
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}
.foot-brand span b {
  color: var(--green);
}
.foot-brand-desc {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--text-faint);
  max-width: 280px;
  line-height: 1.6;
  margin-top: 10px;
}
.foot-grid h4 {
  font-family: var(--display);
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--text-faint);
  text-transform: uppercase;
  margin-bottom: 12px;
}
.foot-grid a.link {
  display: block;
  font-family: var(--display);
  font-size: 11.5px;
  color: var(--text);
  text-decoration: none;
  margin-bottom: 9px;
}
.foot-grid a.link:hover {
  color: var(--green);
}
.foot-bottom {
  border-top: 1px solid var(--green-dim);
  padding-top: 18px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--text-faint);
}

/* ============================================================
   Hardening pass additions: accessibility, banners, skeleton,
   consent checkbox, focus states, reduced motion.
   ============================================================ */

/* screen-reader-only utility */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* banners: error / warning, shared shape */
.home-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--sans);
  font-size: 13px;
  padding: 13px 18px;
  border-radius: 10px;
  margin-bottom: 20px;
}
.home-banner a { color: inherit; text-decoration: underline; }
.home-banner.banner-error {
  background: rgba(255, 92, 92, .08);
  border: 1px solid rgba(255, 92, 92, .35);
  color: #FF9B9B;
}
.home-banner.banner-warn {
  background: rgba(255, 194, 75, .08);
  border: 1px solid rgba(255, 194, 75, .35);
  color: #FFD98F;
}
.banner-dismiss {
  background: none;
  border: none;
  color: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  flex-shrink: 0;
}

/* consent checkbox row, sits above the login button */
.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  text-align: left;
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 14px;
  cursor: pointer;
}
.consent-row input[type="checkbox"] {
  margin-top: 2px;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  accent-color: var(--green);
  cursor: pointer;
}
.consent-row a { color: var(--text); }
.consent-row a:hover { color: var(--green); }

/* disabled state for the login button while consent is unchecked */
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: .45;
  cursor: not-allowed;
}
.btn:disabled:hover,
.btn[aria-disabled="true"]:hover {
  box-shadow: none;
}

/* loading skeleton */
.home-skeleton {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.sk-block {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  height: 90px;
  flex: 1;
  animation: sk-pulse 1.4s ease-in-out infinite;
}
.sk-wide { height: 160px; }
.sk-row { display: flex; gap: 16px; }
@keyframes sk-pulse {
  0%, 100% { opacity: .5; }
  50% { opacity: .9; }
}

/* visible focus states for keyboard navigation */
.btn:focus-visible,
.action-list a:focus-visible,
.foot-grid a.link:focus-visible,
.market-row a:focus-visible,
.consent-row input:focus-visible,
.banner-dismiss:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

/* respect reduced-motion preference across all of Home */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
