/* Web Security (epic R130) — rebuilt to the Suite(11) design handoff. The shared
   suite shell (header/footer/menu drawer/AI button) comes from app-chrome.css +
   menu.js + assistant.js; this file styles the app-specific hero, tabs, Summary
   (score gauge, certificate card, stat cards, severity bars), the Issues table
   and the issue detail slide-over. Fonts: Poppins (headings) + Mulish (body).
   Severity/status are conveyed by dot/glyph + text, never colour alone. */

:root {
  --sec-navy: #16273F; --sec-ink: #33404F; --sec-muted: #5B6675; --sec-faint: #8791A0;
  --sec-line: #EAEDF3; --sec-line-soft: #F1F4F8; --sec-red: #E8402A; --sec-blue: #2F6FE0;
  --sec-green: #1FA97A;
  --sec-card-shadow: 0 4px 16px rgba(18,38,63,0.05);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: 'Mulish', system-ui, sans-serif; color: var(--sec-ink); background: linear-gradient(180deg, #F5F3FB 0%, #F1F6F6 100%); }
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
/* Match the suite: the shared header/footer inner defaults to 1440px — narrow it
   to 90% so it lines up with this app's content (like every other fe-* app). */
.app-shell .rm-header-inner, .app-shell .rm-footer-inner { max-width: 90%; }
.mono { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; }
@keyframes secFadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes secSpin { to { transform: rotate(360deg); } }
@keyframes secShimmer { 0% { background-position: -450px 0; } 100% { background-position: 450px 0; } }

/* ---- Hero ---- */
.sec-hero { background: linear-gradient(180deg, rgba(255,255,255,0.55), rgba(255,255,255,0)); }
.sec-hero-inner { max-width: 90%; margin: 0 auto; padding: 32px 32px 8px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.sec-title { font-family: 'Poppins'; font-weight: 700; font-size: 38px; line-height: 1.05; margin: 0; letter-spacing: -0.5px; color: var(--sec-navy); }
.sec-hero-url { font-family: 'Mulish'; font-weight: 600; font-size: 15px; color: var(--sec-blue); text-decoration: none; }
.sec-hero-url:hover { text-decoration: underline; }
.sec-scan-btn { display: inline-flex; align-items: center; gap: 9px; font-family: 'Poppins'; font-weight: 700; font-size: 14.5px; color: #fff; background: var(--sec-red); border: none; border-radius: 12px; padding: 12px 22px; cursor: pointer; box-shadow: 0 6px 16px rgba(232,64,42,0.28); }
.sec-scan-btn:hover { background: #D5361F; }
.sec-scan-btn:disabled { opacity: 0.65; cursor: default; box-shadow: none; }
.sec-scan-btn:focus-visible { outline: 2px solid var(--sec-navy); outline-offset: 2px; }

/* ---- Tab bar ---- */
.sec-tabbar { background: #fff; border-bottom: 1px solid #E7EBF1; box-shadow: 0 1px 2px rgba(18,38,63,0.03); margin-top: 20px; }
.sec-tabbar-inner { max-width: 90%; margin: 0 auto; padding: 0 32px; display: flex; gap: 38px; }
.sec-tab { appearance: none; background: none; border: none; cursor: pointer; font-family: 'Poppins'; font-weight: 600; font-size: 16px; color: var(--sec-faint); padding: 18px 2px; border-bottom: 3px solid transparent; }
.sec-tab:hover { color: var(--sec-muted); }
.sec-tab.active { font-weight: 700; color: var(--sec-navy); border-bottom-color: var(--sec-red); }
.sec-tab:focus-visible { outline: 2px solid var(--sec-blue); outline-offset: 2px; border-radius: 4px; }

/* ---- Main ---- */
.sec-main { flex: 1; max-width: 90%; width: 100%; margin: 0 auto; padding: 34px 32px 56px; }
#secContent > div { animation: secFadeUp 0.4s ease both; }
.sec-prompt { text-align: center; color: var(--sec-faint); font-size: 15px; padding: 60px 20px; }
.sec-card { background: #fff; border: 1px solid var(--sec-line); border-radius: 20px; box-shadow: var(--sec-card-shadow); }
.sec-h2 { font-family: 'Poppins'; font-weight: 700; font-size: 20px; color: var(--sec-navy); margin: 0; }

/* ---- First run ---- */
.sec-firstrun { border: 1px solid var(--sec-line); border-radius: 20px; box-shadow: var(--sec-card-shadow); background: #fff; padding: 64px 32px; text-align: center; }
.sec-firstrun-icon { display: inline-flex; width: 84px; height: 84px; border-radius: 24px; background: #EEF3FF; align-items: center; justify-content: center; margin-bottom: 22px; }
.sec-firstrun h2 { font-family: 'Poppins'; font-weight: 700; font-size: 24px; color: var(--sec-navy); margin: 0 0 8px; }
.sec-firstrun p { font-size: 15px; color: var(--sec-muted); line-height: 1.6; max-width: 520px; margin: 0 auto 26px; }
.sec-firstrun-cta { display: inline-flex; align-items: center; gap: 9px; font-family: 'Poppins'; font-weight: 700; font-size: 15px; color: #fff; background: var(--sec-red); border: none; border-radius: 12px; padding: 14px 26px; cursor: pointer; box-shadow: 0 6px 16px rgba(232,64,42,0.3); }
.sec-firstrun-cta:hover { background: #D5361F; }

/* ---- Scanning ---- */
.sec-scanning-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.sec-spinner { width: 14px; height: 14px; border: 3px solid #D3E2FA; border-top-color: var(--sec-blue); border-radius: 50%; display: inline-block; animation: secSpin 0.7s linear infinite; }
.sec-scanning-title { font-family: 'Poppins'; font-weight: 700; font-size: 17px; color: var(--sec-navy); }
.sec-scanning-sub { font-size: 13.5px; color: var(--sec-faint); margin-top: 2px; }
.sec-progress { height: 12px; border-radius: 999px; background: #EDF0F5; overflow: hidden; }
.sec-progress-bar { height: 100%; width: 35%; border-radius: 999px; background: linear-gradient(90deg, #2F6FE0, #5B9BF0); animation: secSlide 1.3s ease-in-out infinite; }
@keyframes secSlide { 0% { margin-left: -35%; } 100% { margin-left: 100%; } }
.sec-sk { background: #EEF1F6; background-image: linear-gradient(90deg, #EEF1F6 0, #F6F8FC 220px, #EEF1F6 440px); background-size: 900px 100%; animation: secShimmer 1.3s linear infinite; border-radius: 8px; }
.sec-sk-row { display: flex; align-items: center; gap: 16px; padding: 18px 24px; border-bottom: 1px solid var(--sec-line-soft); }
.sec-sk-list { background: #fff; border: 1px solid var(--sec-line); border-radius: 18px; box-shadow: var(--sec-card-shadow); overflow: hidden; }

/* ---- Summary: two-column grid ---- */
.sec-sum-grid { display: grid; grid-template-columns: minmax(360px, 1fr) 1.7fr; gap: 22px; align-items: stretch; }
.sec-score-card { padding: 28px; display: flex; flex-direction: column; }
.sec-score-card .sub { font-size: 14.5px; color: var(--sec-faint); margin-bottom: 24px; }
.sec-score-body { display: flex; align-items: center; gap: 28px; flex: 1; }
.sec-gauge { position: relative; flex: 0 0 auto; width: 168px; height: 168px; }
.sec-gauge-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.sec-grade { font-family: 'Poppins'; font-weight: 800; font-size: 44px; color: var(--sec-navy); line-height: 1; }
.sec-score-label { font-family: 'Poppins'; font-weight: 700; font-size: 15px; color: var(--sec-faint); margin-top: 2px; }
.sec-verdict-pill { display: inline-flex; align-items: center; font-family: 'Poppins'; font-weight: 700; font-size: 14px; border-radius: 999px; padding: 7px 16px; }
.sec-verdict-text { font-size: 14px; color: #43525F; line-height: 1.55; margin: 16px 0 0; }

.sec-right { display: flex; flex-direction: column; gap: 22px; }
/* Certificate card */
.sec-cert { padding: 26px 28px; }
.sec-cert-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.sec-cert-icon { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 13px; background: #E7F7F1; display: flex; align-items: center; justify-content: center; }
.sec-cert-titles { flex: 1; min-width: 0; }
.sec-cert-titles h2 { font-family: 'Poppins'; font-weight: 700; font-size: 20px; color: var(--sec-navy); margin: 0; }
.sec-cert-titles .sub { font-size: 13px; color: var(--sec-faint); margin-top: 2px; }
.sec-cert-status { display: inline-flex; align-items: center; gap: 7px; font-family: 'Poppins'; font-weight: 700; font-size: 13px; border-radius: 999px; padding: 7px 14px; }
.sec-cert-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px 28px; }
.sec-field-label { font-family: 'Poppins'; font-weight: 700; font-size: 11px; letter-spacing: 0.5px; text-transform: uppercase; color: var(--sec-faint); margin-bottom: 5px; }
.sec-field-value { font-family: 'Poppins'; font-weight: 600; font-size: 14.5px; color: var(--sec-navy); word-break: break-word; }
.sec-field-sub { font-size: 12px; margin-top: 2px; }

/* Stat cards */
.sec-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.sec-stat { border-radius: 18px; padding: 20px; text-align: center; border: 1px solid; }
.sec-stat-label { font-family: 'Poppins'; font-weight: 700; font-size: 15px; color: var(--sec-navy); margin-bottom: 10px; }
.sec-stat-value { font-family: 'Poppins'; font-weight: 800; font-size: 36px; line-height: 1; }

/* Severity breakdown */
.sec-breakdown { flex: 1; padding: 26px 28px; }
.sec-breakdown h2 { margin: 0 0 20px; }
.sec-bars { display: flex; flex-direction: column; gap: 18px; }
.sec-bar-row { display: flex; align-items: center; gap: 18px; }
.sec-bar-label { flex: 0 0 92px; font-family: 'Poppins'; font-weight: 700; font-size: 15px; color: var(--sec-navy); }
.sec-bar-count { flex: 0 0 30px; font-family: 'Poppins'; font-weight: 700; font-size: 15px; color: var(--sec-navy); }
.sec-bar-track { flex: 1; height: 13px; border-radius: 999px; background: #EDF0F5; overflow: hidden; }
.sec-bar-fill { height: 100%; border-radius: 999px; }

/* ---- Issues tab ---- */
.sec-issues-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.sec-issues-head h2 { font-family: 'Poppins'; font-weight: 700; font-size: 24px; color: var(--sec-navy); margin: 0 0 4px; }
.sec-issues-count { font-size: 14.5px; color: var(--sec-faint); }
.sec-search { position: relative; display: inline-flex; align-items: center; }
.sec-search svg { position: absolute; left: 13px; pointer-events: none; }
.sec-search input { padding: 10px 14px 10px 38px; border: 1px solid #DCE1E9; border-radius: 12px; font-family: 'Mulish'; font-size: 14px; color: var(--sec-navy); min-width: 250px; outline: none; background: #fff; }
.sec-search input:focus-visible { border-color: var(--sec-blue); box-shadow: 0 0 0 3px rgba(47,111,224,0.15); }
.sec-seg { display: inline-flex; background: #F1F4F9; border: 1px solid #E5E9F0; border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 24px; }
.sec-seg-btn { appearance: none; border: none; cursor: pointer; font-family: 'Poppins'; font-weight: 600; font-size: 13.5px; padding: 8px 16px; border-radius: 9px; background: transparent; color: var(--sec-muted); }
.sec-seg-btn.active { background: #3C7CE0; color: #fff; box-shadow: 0 2px 6px rgba(60,124,224,0.35); }

.sec-table { background: #fff; border: 1px solid var(--sec-line); border-radius: 18px; box-shadow: var(--sec-card-shadow); overflow: hidden; }
.sec-thead, .sec-row { display: grid; grid-template-columns: 118px minmax(0, 2.4fr) 150px minmax(0, 1.6fr) 128px 28px; gap: 16px; align-items: center; }
.sec-thead { padding: 14px 24px; background: #FAFBFD; border-bottom: 1px solid var(--sec-line); }
.sec-th { font-family: 'Poppins'; font-weight: 700; font-size: 11.5px; letter-spacing: 0.5px; text-transform: uppercase; color: var(--sec-faint); }
.sec-row { padding: 16px 24px; border: none; border-bottom: 1px solid var(--sec-line-soft); background: none; width: 100%; cursor: pointer; text-align: left; }
.sec-row:hover { background: #FBFCFE; }
.sec-row:last-child { border-bottom: none; }
.sec-row:focus-visible { outline: 2px solid var(--sec-blue); outline-offset: -2px; }
.sec-sev-pill { display: inline-flex; align-items: center; gap: 7px; font-family: 'Poppins'; font-weight: 700; font-size: 12.5px; border-radius: 999px; padding: 5px 11px; justify-self: start; }
.sec-sev-dot { width: 7px; height: 7px; border-radius: 50%; }
.sec-issue-title { font-family: 'Poppins'; font-weight: 700; font-size: 14.5px; color: var(--sec-navy); }
.sec-issue-desc { font-size: 12.5px; color: var(--sec-faint); margin-top: 2px; }
.sec-cat-chip { font-family: 'Poppins'; font-weight: 600; font-size: 12.5px; color: var(--sec-muted); background: #EEF1F6; border: 1px solid #E0E5EE; border-radius: 999px; padding: 4px 11px; justify-self: start; }
.sec-loc { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: 12px; color: var(--sec-muted); min-width: 0; word-break: break-all; }
.sec-status-pill { display: inline-flex; align-items: center; font-family: 'Poppins'; font-weight: 700; font-size: 12.5px; border-radius: 999px; padding: 5px 12px; justify-self: start; }
.sec-noresults { padding: 48px 24px; text-align: center; color: var(--sec-faint); font-size: 14.5px; }
.sec-error { padding: 40px 24px; text-align: center; color: #C0392B; font-size: 14px; }

/* ---- Detail slide-over ---- */
.sec-detail-overlay { position: fixed; inset: 0; background: rgba(16,26,40,0.5); z-index: 65; opacity: 0; transition: opacity 0.25s ease; }
.sec-detail-overlay.open { opacity: 1; }
.sec-detail { position: fixed; top: 0; right: 0; bottom: 0; width: 480px; max-width: 94vw; background: #fff; z-index: 66; box-shadow: -16px 0 48px rgba(16,26,40,0.22); transform: translateX(102%); transition: transform 0.3s cubic-bezier(.22,.61,.36,1); }
.sec-detail.open { transform: translateX(0); }
.sec-detail-inner { display: flex; flex-direction: column; height: 100%; }
.sec-detail-top { flex: 0 0 auto; padding: 22px 26px; border-bottom: 1px solid #EFF1F6; }
.sec-detail-titlebar { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sec-detail-pills { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.sec-detail-title { font-family: 'Poppins'; font-weight: 700; font-size: 19px; color: var(--sec-navy); margin: 0; line-height: 1.3; }
.sec-detail-close { width: 38px; height: 38px; border-radius: 11px; background: #F4F6FA; border: 1px solid #E4E8EF; cursor: pointer; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.sec-detail-close:hover { background: #EBEFF5; }
.sec-detail-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 22px 26px; display: flex; flex-direction: column; gap: 22px; }
.sec-detail-desc { font-size: 14.5px; color: var(--sec-muted); line-height: 1.6; }
.sec-detail-h3 { font-family: 'Poppins'; font-weight: 700; font-size: 13px; letter-spacing: 0.4px; text-transform: uppercase; color: var(--sec-faint); margin: 0 0 10px; }
.sec-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.sec-meta-label { font-family: 'Poppins'; font-weight: 700; font-size: 11px; letter-spacing: 0.5px; text-transform: uppercase; color: var(--sec-faint); margin-bottom: 4px; }
.sec-meta-value { font-size: 14px; color: var(--sec-navy); word-break: break-word; }
.sec-fix { background: #FBFCFE; border: 1px solid var(--sec-line); border-left: 3px solid var(--sec-green); border-radius: 10px; padding: 14px 16px; font-size: 13.5px; color: var(--sec-muted); line-height: 1.55; }
.sec-detail-foot { flex: 0 0 auto; border-top: 1px solid #EFF1F6; padding: 16px 26px; display: flex; gap: 10px; justify-content: flex-end; background: #FBFCFE; }
.sec-btn-ghost { appearance: none; background: #fff; border: 1px solid #DCE1E9; color: var(--sec-navy); font-family: 'Poppins'; font-weight: 600; font-size: 14px; padding: 11px 18px; border-radius: 11px; cursor: pointer; }
.sec-btn-ghost:hover { border-color: var(--sec-navy); }
.sec-btn-solid { appearance: none; border: none; background: var(--sec-red); color: #fff; font-family: 'Poppins'; font-weight: 700; font-size: 14px; padding: 11px 20px; border-radius: 11px; cursor: pointer; box-shadow: 0 4px 12px rgba(232,64,42,0.28); }
.sec-btn-solid:hover { background: #D5361F; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .sec-sum-grid { grid-template-columns: 1fr; }
  .sec-stat-grid { grid-template-columns: 1fr 1fr; }
  .sec-cert-fields { grid-template-columns: 1fr 1fr; }
  .sec-thead, .sec-row { grid-template-columns: 100px minmax(0,2fr) 110px 26px; }
  .sec-th.sec-col-cat, .sec-th.sec-col-loc, .sec-cat-chip, .sec-loc { display: none; }
}
@media (max-width: 560px) {
  .sec-hero-inner, .sec-tabbar-inner, .sec-main { padding-left: 18px; padding-right: 18px; }
  .sec-title { font-size: 30px; }
  .sec-stat-grid, .sec-cert-fields { grid-template-columns: 1fr; }
  .sec-score-body { flex-direction: column; align-items: flex-start; }
}
