/* Torvo Flow — scaffolding styles.
   Follows Torvo Light Theme tokens from /opt/torvo/design/torvo_light_theme.html.
   This file is intentionally minimal for v0.1.0; Tier 5 expands with the
   approved dashboard + phone mockups. */

:root {
  --bg: #F4F6F9;
  --surface: #FFFFFF;
  --surface2: #F0F2F5;
  --border: #DDE1E9;
  --text: #1A2033;
  --text2: #4A5568;
  --text3: #8A94A6;
  --red: #C0392B;
  --red-light: #FDECE8;
  --amber: #B7770D;
  --amber-light: #FEF3C7;
  --blue: #1D4ED8;
  --green: #1A7A4A;
  --sidebar-bg: #1A2033;
  --sidebar-text: #E8ECF4;
  --sidebar-accent: #E23744;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

/* Pilot banner ---------------------------------------------------------- */
.pilot-banner {
  background: #FEF3C7;
  color: #7C4A06;
  border-bottom: 1px solid #FDE68A;
  font-size: 11px;
  letter-spacing: 0.08em;
  font-weight: 700;
  text-align: center;
  padding: 6px 14px;
  text-transform: uppercase;
}

/* BUILD · INTERNAL badge (v0.1.1) --------------------------------------- */
.build-banner {
  background: #E23744;
  color: #FFFFFF;
  border-bottom: 1px solid #B4232E;
  font-size: 11px;
  letter-spacing: 0.12em;
  font-weight: 800;
  text-align: center;
  padding: 6px 14px;
  text-transform: uppercase;
}

/* Login --------------------------------------------------------------- */
.flow-login-wrap {
  min-height: calc(100vh - 40px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}
.flow-login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 1px 3px rgba(26,32,51,0.08);
}
.flow-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}
.flow-brand-mark {
  width: 40px; height: 40px;
  background: var(--red);
  color: #fff;
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 20px;
  display: grid;
  place-items: center;
  border-radius: 10px;
}
.flow-brand-text {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: var(--text);
  font-size: 18px;
}
.flow-tagline {
  color: var(--text2);
  font-size: 14px;
  margin-bottom: 24px;
}
.flow-form { display: flex; flex-direction: column; gap: 14px; }
.flow-label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.flow-input {
  font-family: inherit;
  font-size: 15px;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}
.flow-input:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(226,55,68,0.08);
}
.flow-btn-primary {
  margin-top: 6px;
  background: var(--red);
  color: #fff;
  border: 0;
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 18px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(192,57,43,0.18);
}
.flow-btn-primary:hover { filter: brightness(1.05); }
.flow-btn-secondary {
  display: inline-block;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 14px;
  text-decoration: none;
  font-weight: 500;
}
.flow-btn-secondary:hover { background: var(--surface2); }
.flow-alert {
  background: var(--red-light);
  border-left: 3px solid var(--red);
  color: var(--red);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
}
.flow-pilot-note {
  margin-top: 22px;
  font-size: 12px;
  color: var(--text3);
  text-align: center;
  line-height: 1.6;
}
.flow-pilot-note a { color: var(--text2); }

/* Placeholders (Tier 5 replaces) -------------------------------------- */
.flow-placeholder {
  max-width: 720px;
  margin: 60px auto;
  padding: 36px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(26,32,51,0.08);
}
.flow-placeholder h1 {
  margin-top: 0;
  font-weight: 700;
  font-size: 22px;
}
.flow-placeholder-lede {
  color: var(--text2);
  font-size: 15px;
  line-height: 1.6;
}
.flow-placeholder code {
  background: var(--surface2);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 13px;
}

/* Help page ----------------------------------------------------------- */
.flow-help-wrap {
  max-width: 760px;
  margin: 40px auto;
  padding: 36px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(26,32,51,0.08);
}
.flow-help-title {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 800;
}
.flow-help-lede {
  color: var(--text2);
  font-size: 16px;
  line-height: 1.6;
}
.flow-help-wrap h2 {
  margin-top: 28px;
  font-size: 18px;
  font-weight: 700;
}
.flow-help-wrap ul { line-height: 1.7; color: var(--text2); }

/* Feedback button ----------------------------------------------------- */
.flow-feedback-btn {
  display: none;
}
.feedback-nav {
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.feedback-nav:hover { background: rgba(255,255,255,.06); }

/* v0.1.4.7 — mobile topnav (loaded on every page via base.html) */
.mobile-topnav { display: none; }
.sidebar-backdrop { display: none; }
@media (max-width: 768px) {
  .mobile-topnav {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #FFFFFF;
    border-bottom: 1px solid #DDE1E9;
    position: sticky;
    top: 0;
    z-index: 30;
    gap: 10px;
  }
  .mobile-topnav .mtn-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #F0F2F5;
    border: 1px solid #DDE1E9;
    border-radius: 8px;
    color: #1A2033;
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    line-height: 1;
    white-space: nowrap;
  }
  .mobile-topnav .mtn-btn:hover,
  .mobile-topnav .mtn-btn:active {
    background: #E8EBF0;
    border-color: #C0C8D6;
  }
  .mobile-topnav .mtn-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
  .mobile-topnav .mtn-title {
    font-family: 'Outfit', system-ui, sans-serif;
    font-weight: 700;
    font-size: 13px;
    flex: 1;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0 4px;
    color: #1A2033;
  }
  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 49;
  }
  .sidebar-backdrop.open { display: block !important; }
  /* The slide-in sidebar override is per-page (flow_dashboard.css / flow_ops.css);
     here just ensure z-index is high enough */
  .app aside.sidebar.open {
    position: fixed !important;
    top: 0; left: 0; bottom: 0;
    width: 80vw;
    max-width: 300px;
    z-index: 50 !important;
    box-shadow: 4px 0 24px rgba(0,0,0,0.3);
    overflow-y: auto;
    display: flex !important;
  }
}


/* v0.1.6 — navy CTA + insights occurrence count + grouping chip */
.btn.navy {
  background: var(--sidebar-bg);
  color: #fff;
  border-color: var(--sidebar-bg);
  font-weight: 600;
}
.btn.navy:hover { background: #2D3548; border-color: #2D3548; }
.ii-count {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 8px;
  background: var(--surface2);
  color: var(--text2);
  vertical-align: 1px;
}
.feed-meta .chip.cnt {
  background: var(--surface2);
  color: var(--text2);
  font-weight: 700;
}


/* v0.2.0.3 — PWA update banner (auto-dismiss 30s) */
.torvo-update-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 10px 16px;
  background: #1A2033;
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
  box-shadow: 0 2px 8px rgba(26,32,51,0.18);
  cursor: pointer;
  animation: tub-slidein 0.18s ease-out;
}
.torvo-update-banner .tub-text { color: #fff; }
.torvo-update-banner .tub-reload {
  font-family: inherit;
  background: #fff;
  color: #1A2033;
  border: none;
  border-radius: 4px;
  padding: 5px 12px;
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
}
.torvo-update-banner .tub-reload:hover { background: #E8ECF4; }
@keyframes tub-slidein {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
