:root {
  color-scheme: dark;
  --bg: #07110d;
  --surface: #0c1813;
  --surface-raised: #112119;
  --surface-hover: #162a20;
  --border: #223a2e;
  --border-strong: #315440;
  --text: #e8f2ec;
  --muted: #91a79a;
  --muted-2: #667b6f;
  --primary: #22c55e;
  --primary-hover: #34d399;
  --primary-soft: #123822;
  --focus: #6ee7a0;
  --danger: #fb7185;
  --warning: #fbbf24;
  --shadow: 0 24px 80px rgb(0 0 0 / 30%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { min-height: 100vh; margin: 0; background: var(--bg); color: var(--text); }
button, input, select { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
a { color: var(--primary-hover); text-decoration: none; }
a:hover { color: #86efac; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 0 18px;
  cursor: pointer;
  font-weight: 700;
  transition: 140ms ease;
}
.button-primary { background: var(--primary); color: #041109; box-shadow: 0 8px 24px rgb(34 197 94 / 16%); }
.button-primary:hover { background: var(--primary-hover); color: #041109; transform: translateY(-1px); }
.button-primary:disabled { cursor: not-allowed; opacity: .42; transform: none; }
.button-ghost { border-color: var(--border); background: rgb(17 33 25 / 70%); color: var(--text); }
.button-ghost:hover { border-color: var(--border-strong); background: var(--surface-hover); color: var(--text); }
.button-large { min-height: 50px; padding: 0 24px; }
.button-block { width: 100%; margin-top: 8px; }
.text-button { border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.text-button:hover { color: var(--text); }

.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid #2f6945; border-radius: 10px; background: var(--primary-soft); color: var(--focus); font-weight: 900; box-shadow: inset 0 0 20px rgb(34 197 94 / 8%); }
.brand > span:last-child { display: flex; flex-direction: column; line-height: 1.02; }
.brand strong { font-size: 14px; letter-spacing: .01em; }
.brand small { margin-top: 4px; color: var(--primary-hover); font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }

.language-form { display: flex; align-items: center; }
.language-form select { min-height: 36px; border: 1px solid var(--border); border-radius: 8px; padding: 0 30px 0 10px; background: var(--surface); color: var(--muted); cursor: pointer; }
[dir="rtl"] .language-form select { padding: 0 10px 0 30px; }
.language-submit { margin-inline-start: 5px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; }
html.js .language-submit { display: none; }

.flash { position: fixed; z-index: 100; top: 18px; left: 50%; width: min(520px, calc(100% - 32px)); transform: translateX(-50%); border: 1px solid var(--border-strong); border-radius: 10px; padding: 13px 16px; background: #10251a; color: var(--text); box-shadow: var(--shadow); text-align: center; }
.flash-error { border-color: #6b2934; background: #2b1217; color: #fecdd3; }
.flash-success { border-color: #25623c; background: #0e2b19; color: #bbf7d0; }

.public-page { background: radial-gradient(circle at 50% -15%, rgb(34 197 94 / 17%), transparent 36%), var(--bg); }
.public-header, .auth-header { display: flex; width: min(1180px, calc(100% - 48px)); height: 78px; align-items: center; justify-content: space-between; margin: 0 auto; }
.public-actions { display: flex; align-items: center; gap: 10px; }
.landing { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 92px 0 70px; }
.hero { max-width: 870px; margin: 0 auto 100px; text-align: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; color: #9ae6b4; font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.eyebrow span { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 14px var(--primary); }
.hero h1, .auth-intro h1 { margin: 24px 0 22px; font-size: clamp(42px, 7vw, 76px); line-height: .99; letter-spacing: -.055em; }
.hero p, .auth-intro p { max-width: 710px; margin: 0 auto; color: var(--muted); font-size: clamp(16px, 2vw, 20px); line-height: 1.65; }
.hero-actions { display: flex; justify-content: center; gap: 12px; margin-top: 34px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.feature-grid article { min-height: 210px; border: 1px solid var(--border); border-radius: 14px; padding: 26px; background: linear-gradient(150deg, rgb(17 33 25 / 88%), rgb(9 20 15 / 88%)); }
.feature-number { color: var(--primary); font: 700 11px/1 ui-monospace, monospace; }
.feature-grid h2 { margin: 55px 0 10px; font-size: 19px; }
.feature-grid p { margin: 0; color: var(--muted); line-height: 1.55; }

.auth-page { background: radial-gradient(circle at 20% 15%, rgb(34 197 94 / 12%), transparent 34%), var(--bg); }
.auth-layout { display: grid; width: min(1100px, calc(100% - 48px)); min-height: calc(100vh - 100px); grid-template-columns: 1fr 430px; align-items: center; gap: 90px; margin: 0 auto; padding: 38px 0 80px; }
.auth-intro h1 { max-width: 650px; font-size: clamp(38px, 5vw, 62px); }
.auth-intro p { margin: 0; }
.auth-card { border: 1px solid var(--border); border-radius: 16px; padding: 30px; background: rgb(12 24 19 / 92%); box-shadow: var(--shadow); }
.auth-card h1, .auth-card h2 { margin: 0 0 24px; font-size: 26px; letter-spacing: -.025em; }
.auth-card label { display: grid; gap: 8px; margin-bottom: 16px; color: #bdd0c4; font-size: 13px; font-weight: 650; }
.auth-card input, .quick-scan-card input { width: 100%; min-height: 46px; border: 1px solid var(--border); border-radius: 9px; padding: 0 13px; background: #08140f; color: var(--text); }
.auth-card input:hover, .quick-scan-card input:hover { border-color: var(--border-strong); }
.auth-card input:focus, .quick-scan-card input:focus { border-color: var(--primary); outline: 2px solid rgb(34 197 94 / 12%); }
.check-row { display: flex !important; grid-template-columns: auto 1fr; align-items: flex-start; gap: 10px !important; color: var(--muted) !important; font-weight: 500 !important; line-height: 1.5; }
.check-row input { width: 17px; min-height: 17px; margin-top: 2px; accent-color: var(--primary); }
.auth-links { display: flex; justify-content: space-between; gap: 16px; margin-top: 20px; color: var(--muted); font-size: 13px; }
.form-error { margin-bottom: 10px; border: 1px solid #6b2934; border-radius: 8px; padding: 10px 12px; background: #2b1217; color: #fecdd3; font-size: 13px; }
.single-auth { display: grid; min-height: calc(100vh - 100px); place-items: center; padding: 30px; }
.single-auth .auth-card { width: min(430px, 100%); }

.app-page { overflow: hidden; }
.app-shell { display: grid; min-height: 100vh; grid-template-columns: 244px minmax(0, 1fr); }
.app-sidebar { display: flex; height: 100vh; flex-direction: column; border-inline-end: 1px solid var(--border); padding: 22px 16px; background: #08130e; }
.app-sidebar .brand { padding: 0 8px 22px; }
.app-nav { display: grid; gap: 4px; margin-top: 14px; }
.app-nav a { display: flex; min-height: 43px; align-items: center; gap: 12px; border: 1px solid transparent; border-radius: 9px; padding: 0 11px; color: var(--muted); font-size: 14px; font-weight: 620; }
.app-nav a > span { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 7px; background: #102017; color: #89a695; font: 800 11px/1 ui-monospace, monospace; }
.app-nav a:hover { background: var(--surface-hover); color: var(--text); }
.app-nav a.active { border-color: #265137; background: var(--primary-soft); color: #bcf7d0; }
.app-nav a.active > span { background: var(--primary); color: #041109; }
.app-nav-bottom { margin-top: auto; }
.app-main { min-width: 0; height: 100vh; overflow: auto; background: radial-gradient(circle at 80% -20%, rgb(34 197 94 / 7%), transparent 34%), var(--bg); }
.app-topbar { position: sticky; z-index: 20; top: 0; display: flex; min-height: 72px; align-items: center; gap: 16px; border-bottom: 1px solid var(--border); padding: 0 28px; background: rgb(7 17 13 / 90%); backdrop-filter: blur(15px); }
.topbar-title { display: flex; flex-direction: column; }
.topbar-title span { font-size: 14px; font-weight: 750; }
.topbar-title small { margin-top: 3px; color: var(--muted-2); font-size: 11px; }
.sidebar-toggle { display: none; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.account-menu { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; }
.account-avatar { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid #37664a; border-radius: 50%; background: var(--primary-soft); color: var(--focus); font-weight: 800; }
.account-copy { display: flex; max-width: 200px; flex-direction: column; }
.account-copy strong, .account-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-copy strong { font-size: 12px; }
.account-copy small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.app-content { width: min(1440px, 100%); margin: 0 auto; padding: 34px 38px 60px; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 26px; }
.page-heading h1 { margin: 0; font-size: 28px; letter-spacing: -.035em; }
.page-heading p { margin: 7px 0 0; color: var(--muted); }
.verification-banner { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; border: 1px solid #66521d; border-radius: 11px; padding: 12px 15px; background: #2b230c; color: #fde68a; }
.verification-banner > span { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 50%; background: #4b3b0b; font-weight: 900; }
.verification-banner form { margin-inline-start: auto; }
.verification-banner button { border: 0; background: transparent; color: #fef3c7; cursor: pointer; text-decoration: underline; }
.quick-scan-card { display: flex; align-items: center; gap: 26px; border: 1px solid #285039; border-radius: 14px; padding: 22px; background: linear-gradient(110deg, #10281a, #0d1c15); }
.quick-scan-card > div { flex: 0 0 220px; }
.quick-scan-card h2 { margin: 5px 0 0; font-size: 18px; }
.section-kicker { color: var(--primary); font: 800 10px/1 ui-monospace, monospace; letter-spacing: .13em; }
.quick-scan-card form { display: grid; flex: 1; grid-template-columns: minmax(180px, 1fr) auto auto; align-items: center; gap: 10px; }
.policy-pill { border: 1px solid var(--border-strong); border-radius: 999px; padding: 7px 10px; color: #a7c5b2; font-size: 11px; white-space: nowrap; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
.metric-grid article, .content-card { border: 1px solid var(--border); border-radius: 12px; background: rgb(12 24 19 / 72%); }
.metric-grid article { min-height: 128px; padding: 18px; }
.metric-grid article > span { color: var(--muted); font-size: 12px; }
.metric-grid strong { display: block; margin: 16px 0 4px; font: 650 32px/1 ui-monospace, monospace; }
.metric-grid small { color: var(--muted-2); }
.dashboard-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 12px; margin-top: 16px; }
.content-card { min-height: 270px; padding: 22px; }
.content-card h2 { margin: 0; font-size: 17px; }
.content-card p { color: var(--muted); line-height: 1.55; }
.onboarding-card { background: radial-gradient(circle at 85% 15%, rgb(34 197 94 / 11%), transparent 36%), var(--surface); }
.onboarding-card p { max-width: 470px; }
.onboarding-icon { display: grid; width: 44px; height: 44px; place-items: center; margin-bottom: 34px; border: 1px solid #2b6843; border-radius: 11px; background: var(--primary-soft); color: var(--focus); font-size: 21px; }
.onboarding-card .button { margin-top: 12px; }
.card-heading { display: flex; align-items: center; justify-content: space-between; }
.card-heading a { font-size: 12px; }
.empty-state { display: grid; min-height: 180px; place-items: center; color: var(--muted-2); font-size: 13px; }
.placeholder-card { display: grid; min-height: 420px; place-content: center; justify-items: center; text-align: center; }
.placeholder-card p { max-width: 500px; }
.scan-form-card { max-width: 820px; min-height: 0; }
.scan-form-card form { display: grid; gap: 22px; }
.scan-target-label { display: grid; gap: 9px; color: #bdd0c4; font-size: 13px; font-weight: 700; }
.scan-target-label input { width: 100%; min-height: 54px; border: 1px solid var(--border-strong); border-radius: 10px; padding: 0 15px; background: #08140f; color: var(--text); font-size: 16px; }
.policy-choice { display: flex; align-items: flex-start; gap: 14px; border: 1px solid var(--border); border-radius: 10px; padding: 15px; background: #0a1711; }
.policy-choice p { margin: 0; font-size: 13px; }
.scan-attestation { margin: 0 !important; }
.data-card { min-height: 0; padding: 0; overflow: hidden; }
.data-card > h2, .data-card > .card-heading { padding: 20px 22px 0; }
.responsive-table { width: 100%; overflow-x: auto; }
.responsive-table table { width: 100%; border-collapse: collapse; }
.responsive-table th, .responsive-table td { border-bottom: 1px solid var(--border); padding: 15px 18px; text-align: start; white-space: nowrap; }
.responsive-table th { color: var(--muted-2); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.responsive-table td { color: var(--muted); font-size: 13px; }
.responsive-table td strong { color: var(--text); }
.responsive-table tbody tr:hover { background: rgb(22 42 32 / 45%); }
.scan-status { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: 999px; padding: 5px 9px; background: #102019; color: #afc7b7; font: 800 9px/1 ui-monospace, monospace; letter-spacing: .06em; }
.status-running, .status-normalizing, .status-analyzing { border-color: #316647; color: #86efac; }
.status-completed { border-color: #25623c; background: #0e2b19; color: #86efac; }
.status-failed, .status-timeout { border-color: #6b2934; background: #2b1217; color: #fecdd3; }
.scan-summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 12px; }
.scan-summary-grid .content-card { min-height: 126px; }
.scan-summary-grid span { color: var(--muted); font-size: 12px; }
.scan-summary-grid strong { display: block; margin-top: 20px; font: 700 32px/1 ui-monospace, monospace; }
.scan-summary-grid .small-value { font-size: 14px; line-height: 1.4; }
.detail-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: 12px; }
.detail-grid > .content-card { min-height: 330px; }
.back-link { display: inline-block; margin-bottom: 10px; color: var(--muted); font-size: 12px; }
.finding-list { margin-top: 14px; }
.finding-row { display: flex; align-items: flex-start; gap: 12px; border-top: 1px solid var(--border); padding: 15px 22px; }
.finding-row > div { display: grid; gap: 5px; }
.finding-row strong { font-size: 13px; }
.finding-row small { color: var(--muted); }
.severity { flex: 0 0 62px; border: 1px solid var(--border); border-radius: 6px; padding: 5px 6px; text-align: center; font: 800 9px/1 ui-monospace, monospace; }
.severity-critical { border-color: #7f1d1d; background: #351014; color: #fda4af; }
.severity-high { border-color: #7c2d12; background: #35170c; color: #fdba74; }
.severity-medium { border-color: #713f12; background: #30220a; color: #fde68a; }
.severity-low { border-color: #1e3a8a; background: #101d3b; color: #93c5fd; }
.event-list { padding: 10px 22px 22px; }
.event-list > div { display: flex; gap: 11px; min-height: 55px; }
.event-list > div > span { width: 8px; height: 8px; flex: 0 0 8px; margin-top: 5px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 10px rgb(34 197 94 / 40%); }
.event-list p { display: grid; gap: 4px; margin: 0; }
.event-list strong { font-size: 12px; text-transform: capitalize; }
.event-list small { color: var(--muted-2); font-size: 10px; }
.recent-scan-list { display: grid; margin-top: 8px; }
.recent-scan-list > a { align-items: center; border-bottom: 1px solid var(--border); color: var(--text); display: flex; gap: 16px; justify-content: space-between; padding: 13px 0; text-decoration: none; }
.recent-scan-list > a:last-child { border-bottom: 0; }
.recent-scan-list > a:hover strong { color: var(--primary); }
.recent-scan-list span:first-child { display: grid; gap: 4px; min-width: 0; }
.recent-scan-list strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-scan-list small { color: var(--muted-2); }
.not-found { display: grid; min-height: calc(100vh - 78px); place-content: center; justify-items: center; }
.not-found h1 { margin: 0; font: 700 90px/1 ui-monospace, monospace; color: var(--primary); }

@media (max-width: 960px) {
  .auth-layout { grid-template-columns: 1fr; gap: 34px; }
  .auth-intro { display: none; }
  .auth-card { width: min(440px, 100%); margin: 0 auto; }
  .feature-grid { grid-template-columns: 1fr; }
  .feature-grid article { min-height: 160px; }
  .feature-grid h2 { margin-top: 30px; }
  .app-shell { grid-template-columns: 1fr; }
  .app-sidebar { position: fixed; z-index: 50; inset-block: 0; inset-inline-start: 0; width: 244px; transform: translateX(-105%); box-shadow: var(--shadow); transition: transform 180ms ease; }
  [dir="rtl"] .app-sidebar { transform: translateX(105%); }
  .app-sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: inline-grid; width: 36px; height: 36px; place-items: center; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .public-header, .auth-header, .landing, .auth-layout { width: min(100% - 28px, 1180px); }
  .public-header .button-ghost, .account-copy, .account-menu > .language-form { display: none; }
  .landing { padding-top: 60px; }
  .hero { margin-bottom: 60px; }
  .hero h1 { font-size: 43px; }
  .hero-actions { flex-direction: column; }
  .auth-links { flex-direction: column; }
  .app-topbar { padding: 0 14px; }
  .app-content { padding: 25px 15px 50px; }
  .quick-scan-card { align-items: stretch; flex-direction: column; }
  .quick-scan-card > div { flex-basis: auto; }
  .quick-scan-card form { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .scan-summary-grid { grid-template-columns: 1fr; }
  .verification-banner { align-items: flex-start; flex-wrap: wrap; }
  .verification-banner form { width: 100%; margin-inline-start: 37px; }
}
