/* ============================================================
   Tribun RIAS — Screen-specific styles
   ============================================================ */

/* ---------------- Pipeline diagram ---------------- */
.pipeline { display: flex; align-items: center; gap: 0; width: 100%; }
.pl-node { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.pipeline.compact .pl-node { gap: 8px; }
.pl-icon {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; position: relative;
  display: grid; place-items: center; border: 1.5px solid var(--rule-2);
  background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 600;
  transition: .3s;
}
.pl-node.active .pl-icon { border-color: var(--accent-solid); color: var(--accent-ink); background: var(--accent-soft); }
.pl-node.done .pl-icon { border-color: var(--positive); background: var(--positive); color: #fff; }
.pl-ring { position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--accent-solid); animation: ring-out calc(1.8s / var(--motion)) ease-out infinite; }
.pl-num { line-height: 1; }
.pl-name { font-size: 12.5px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.pl-node.idle .pl-name { color: var(--muted); }
.pl-desc { font-size: 10.5px; color: var(--muted); white-space: nowrap; margin-top: 1px; }
.pl-link { flex: 1; min-width: 18px; height: 2px; background: var(--rule-2); position: relative; margin: 0 10px; border-radius: 2px; overflow: hidden; }
.pl-link-fill { position: absolute; inset: 0; width: 0; background: var(--accent-solid); transition: width .5s ease; }
.pl-link.active .pl-link-fill { width: 60%; background: var(--accent-grad); }
.pl-link.done .pl-link-fill { width: 100%; background: var(--positive); }

/* ============================================================
   SIGN IN
   ============================================================ */
.auth { height: 100%; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--bg); position: relative; }
.auth-left { position: relative; z-index: 2; display: flex; flex-direction: column; padding: 40px 52px; background: var(--surface); overflow-y: auto; }
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: auto; }
.auth-body { width: 100%; max-width: 392px; margin: 40px auto auto; padding-bottom: 30px; }
.auth-foot { margin-top: auto; padding-top: 28px; font-size: 11.5px; color: var(--muted-2); }
.auth-eyebrow {
  display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono);
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-ink);
  background: var(--accent-soft); border: 1px solid var(--accent-soft-border);
  padding: 5px 11px; border-radius: var(--r-pill); margin-bottom: 22px; white-space: nowrap;
}
.auth-h1 { font-family: var(--font-display); font-size: 38px; font-weight: 600; letter-spacing: -.03em; color: var(--ink); line-height: 1.02; }
.auth-lead { font-size: 14.5px; color: var(--muted); margin-top: 12px; line-height: 1.55; }
.auth-form { display: flex; flex-direction: column; gap: 16px; margin-top: 30px; }
.auth-row-between { display: flex; align-items: center; justify-content: space-between; }
.link-btn { font-size: 12px; color: var(--accent-ink); font-weight: 500; }
.link-btn:hover { text-decoration: underline; }
.pw-wrap { position: relative; }
.pw-toggle { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted-2); padding: 4px; line-height: 0; }
.pw-toggle:hover { color: var(--ink-2); }
.check-row { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); cursor: pointer; user-select: none; }
.check-box { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--rule-2); display: grid; place-items: center; transition: .15s; flex-shrink: 0; }
.check-row input { display: none; }
.check-row input:checked + .check-box { background: var(--accent-solid); border-color: var(--accent-solid); }
.check-box svg { opacity: 0; transition: .15s; }
.check-row input:checked + .check-box svg { opacity: 1; }
.auth-divider { display: flex; align-items: center; gap: 14px; color: var(--muted-2); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.auth-divider span { flex: 1; height: 1px; background: var(--rule); }

/* Right hero panel */
.auth-right { position: relative; overflow: hidden; background: var(--hero-bg); display: flex; align-items: center; justify-content: center; padding: 40px; }
.auth-hero-inner { position: relative; z-index: 2; width: 100%; max-width: 440px; display: flex; flex-direction: column; align-items: center; }
.hero-caption { text-align: center; margin-top: 8px; }
.hero-caption h2 { font-family: var(--font-display); font-size: 22px; font-weight: 600; color: var(--ink); letter-spacing: -.02em; }
.hero-caption p { font-size: 13.5px; color: var(--muted); margin-top: 8px; line-height: 1.55; max-width: 38ch; }
.hero-chips { display: flex; gap: 8px; margin-top: 20px; flex-wrap: wrap; justify-content: center; }

/* the "what happens next" card on right */
.next-card { width: 100%; padding: 24px 26px; }
.next-head { font-family: var(--font-mono); font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink); padding-bottom: 14px; border-bottom: 1px solid var(--rule); margin-bottom: 4px; }
.next-step { display: flex; gap: 16px; align-items: center; padding: 15px 0; }
.next-step + .next-step { border-top: 1px solid var(--rule); }
.next-num { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-size: 14px; font-weight: 700; background: var(--accent-soft); color: var(--accent-ink); font-family: var(--font-mono); }
.next-num.active { background: var(--accent-grad); color: #fff; box-shadow: 0 4px 12px -4px var(--accent-glow); }
.next-title { font-size: 16px; font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
.next-sub { font-size: 13.5px; color: var(--muted); margin-top: 3px; line-height: 1.4; }

/* already-have-account card */
.account-card { width: 100%; margin-top: 16px; display: flex; align-items: center; gap: 16px; padding: 20px 22px; background: var(--accent-soft); border: 1px solid var(--accent-soft-border); border-radius: var(--r-lg); }
.account-title { font-size: 15px; font-weight: 600; color: var(--ink); }
.account-sub { font-size: 13px; color: var(--muted); margin-top: 3px; line-height: 1.45; }

/* ============================================================
   REPORT GENERATOR
   ============================================================ */
.rg { display: grid; grid-template-columns: 380px 1fr; height: 100%; min-height: 0; transition: grid-template-columns .45s cubic-bezier(.4,0,.2,1); }
.rg.form-collapsed { grid-template-columns: 0px 1fr; }
.rg-form { border-right: 1px solid var(--rule); background: var(--surface); overflow-y: auto; overflow-x: hidden; padding: 26px; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.rg.form-collapsed .rg-form { border-right: 0; padding-left: 0; padding-right: 0; }
.rg-form-head h3 { font-family: var(--font-display); font-size: 19px; font-weight: 600; color: var(--ink); }
.rg-form-head p { font-size: 12.5px; color: var(--muted); margin-top: 5px; line-height: 1.5; }
.char-counter { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted-2); margin-left: auto; }

.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip { font-size: 12px; font-weight: 500; padding: 7px 12px; border-radius: var(--r-sm); border: 1px solid var(--rule-2); background: var(--surface); color: var(--ink-2); transition: .14s; }
.chip:hover { border-color: var(--rule-strong); }
.chip.active { background: var(--accent-soft); border-color: var(--accent-soft-border); color: var(--accent-ink); font-weight: 600; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.choice-card { border: 1px solid var(--rule-2); border-radius: var(--r-md); padding: 13px; cursor: pointer; transition: .15s; background: var(--surface); position: relative; }
.choice-card:hover { border-color: var(--rule-strong); }
.choice-card.active { border-color: var(--accent-solid); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft); }
.choice-head { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.choice-radio { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--rule-2); flex-shrink: 0; display: grid; place-items: center; transition: .15s; }
.choice-card.active .choice-radio { border-color: var(--accent-solid); }
.choice-card.active .choice-radio::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-solid); }
.choice-icon { width: 30px; height: 30px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; margin-bottom: 8px; }
.choice-title { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.choice-sub { font-size: 11px; color: var(--muted); margin-top: 3px; line-height: 1.4; }

/* Right canvas */
.rg-canvas { position: relative; overflow-y: auto; overflow-x: hidden; display: flex; align-items: center; justify-content: center; padding: 36px; min-height: 0; }
.rg-canvas-inner { width: 100%; max-width: 720px; position: relative; z-index: 2; }

/* progress card */
.prog { padding: 26px; }
.prog-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.prog-title { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 17px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.prog-elapsed { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.prog-pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--accent-solid); box-shadow: 0 0 0 0 var(--accent-glow); animation: prog-pulse calc(1.6s / var(--motion)) ease-out infinite; }
@keyframes prog-pulse { 0% { box-shadow: 0 0 0 0 var(--accent-glow); } 70% { box-shadow: 0 0 0 9px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.prog-bar { height: 7px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin: 18px 0 8px; }
.prog-bar-fill { height: 100%; border-radius: 999px; background: var(--accent-grad); transition: width .5s cubic-bezier(.3,.8,.3,1); position: relative; }
.prog-bar-fill::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.4), transparent); background-size: 200% 100%; animation: shimmer calc(1.4s / var(--motion)) linear infinite; }
.prog-stage { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--muted); }
.prog-pct { font-family: var(--font-mono); font-weight: 600; color: var(--accent-ink); }
.prog-log { margin-top: 18px; border-top: 1px solid var(--rule); padding-top: 14px; max-height: 150px; overflow-y: auto; display: flex; flex-direction: column; gap: 7px; font-family: var(--font-mono); font-size: 11.5px; }
.prog-log-line { display: flex; gap: 9px; color: var(--muted); animation: enter .3s ease both; }
.prog-log-line .lt { color: var(--muted-2); }
.prog-log-line.done .lm { color: var(--ink-2); }

/* result card */
.result-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px; border-bottom: 1px solid var(--rule); }
.result-brand { font-family: var(--font-display); font-size: 19px; font-weight: 600; color: var(--ink); }
.result-meta { font-size: 12px; color: var(--muted); margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.result-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 20px 22px; }
.slide-thumb { aspect-ratio: 16/10; border-radius: var(--r-sm); border: 1px solid var(--rule); background: var(--surface-2); overflow: hidden; position: relative; transition: .15s; cursor: pointer; }
.slide-thumb:hover { border-color: var(--accent-soft-border); transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* ============================================================
   PROFILE
   ============================================================ */
.profile-hero { position: relative; overflow: hidden; padding: 30px; }
.profile-hero .aurora { opacity: .8; }
.profile-row { position: relative; z-index: 2; display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.profile-av { width: 92px; height: 92px; border-radius: 50%; background: var(--accent-grad); color: #fff; display: grid; place-items: center; font-family: var(--font-display); font-size: 34px; font-weight: 600; box-shadow: var(--shadow-glow); flex-shrink: 0; }
.profile-name { font-family: var(--font-display); font-size: 30px; font-weight: 600; color: var(--ink); letter-spacing: -.02em; }
.profile-meta { display: flex; gap: 16px; margin-top: 8px; flex-wrap: wrap; }
.profile-meta-item { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.profile-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--gap-card); margin-top: var(--gap-card); }
.info-list { display: flex; flex-direction: column; }
.info-row { display: flex; justify-content: space-between; align-items: baseline; padding: 13px 0; border-bottom: 1px solid var(--rule); gap: 16px; }
.info-row:last-child { border-bottom: 0; }
.info-k { font-size: 13px; color: var(--muted); white-space: nowrap; }
.info-v { font-size: 13px; color: var(--ink); font-weight: 500; text-align: right; white-space: nowrap; }

/* ============================================================
   ROLES & PERMISSIONS
   ============================================================ */
.roles-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap-card); }
.role-card { padding: 16px 18px; transition: .15s; }
.role-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.role-head { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; }
.role-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.role-name { font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.role-count { font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-bottom: 9px; }
.role-desc { font-size: 12px; color: var(--muted); line-height: 1.5; }
.perm-table td:not(:first-child), .perm-table th:not(:first-child) { text-align: center; }
.perm-yes { color: var(--positive); }
.perm-no { color: var(--muted-2); }

/* ============================================================
   REPORT CONFIG (agents)
   ============================================================ */
.mode-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 8px; }
.cfg-agent { padding: 18px 20px; }
.cfg-agent-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.cfg-agent-badge { width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; flex-shrink: 0; }
.cfg-agent-name { font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.cfg-agent-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.cfg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* toggle switch */
.switch { position: relative; width: 38px; height: 22px; border-radius: 999px; background: var(--rule-2); transition: .2s; flex-shrink: 0; }
.switch.on { background: var(--accent-solid); }
.switch i { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch.on i { transform: translateX(16px); }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--rule); }
.setting-row:last-child { border-bottom: 0; }
.setting-info h4 { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.setting-info p { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.45; max-width: 52ch; }

/* responsive guards */
@media (max-width: 1000px) {
  .auth { grid-template-columns: 1fr; }
  .auth-right { display: none; }
  .rg { grid-template-columns: 1fr; }
  .rg-form { border-right: 0; border-bottom: 1px solid var(--rule); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .roles-grid { grid-template-columns: repeat(2, 1fr); }
  .profile-grid { grid-template-columns: 1fr; }
}
