/* ─── CheckSecure · Foyabo Technologies ─────────────────────────────────── */

:root {
  --brand:       #1A3A5C;
  --brand-mid:   #2471A3;
  --brand-lite:  #D6EAF8;
  --green:       #1E8449;
  --green-lite:  #D5F5E3;
  --amber:       #9A7D0A;
  --amber-lite:  #FEF9E7;
  --red:         #C0392B;
  --red-lite:    #FDEDEC;
  --gray:        #5D6D7E;
  --gray-lite:   #F2F4F4;
  --border:      #DEE2E6;
  --text:        #212529;
  --text-muted:  #6C757D;
  --bg:          #F8F9FB;
  --white:       #FFFFFF;
  --radius:      8px;
  --radius-lg:   12px;
  --shadow:      0 1px 3px rgba(0,0,0,.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

/* ── Navigation ──────────────────────────────────────────────────────────── */
.nav {
  background: var(--brand);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  height: 52px;
  gap: 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-brand { display: flex; align-items: center; gap: 8px; margin-right: auto; }
.nav-logo {
  width: 28px; height: 28px; border-radius: 6px;
  background: var(--brand-mid);
  color: #fff; font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.nav-company { color: #fff; font-weight: 600; font-size: 15px; }
.nav-sep     { color: #5A90C0; font-size: 15px; }
.nav-product { color: #7EB8E8; font-size: 15px; }
.nav-links   { display: flex; gap: 4px; }
.nav-link {
  color: #B3CDE8; font-size: 13px; text-decoration: none;
  padding: 5px 12px; border-radius: 6px; transition: all .15s;
}
.nav-link:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav-link.active { background: rgba(255,255,255,.15); color: #fff; }

/* ── Layout ──────────────────────────────────────────────────────────────── */
.container { max-width: 1000px; margin: 0 auto; padding: 1.5rem; }
.page-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 1rem;
  margin-bottom: 1.25rem;
}
.page-title { font-size: 20px; font-weight: 600; color: var(--text); }
.page-sub   { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.btn-group  { display: flex; gap: 8px; flex-shrink: 0; }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}
.card-body   { padding: 1.25rem; }
.card-header {
  padding: .875rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.card-title  { font-size: 15px; font-weight: 600; flex: 1; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500; cursor: pointer;
  border: 1px solid var(--border);
  background: var(--white); color: var(--text);
  text-decoration: none; transition: all .15s; white-space: nowrap;
}
.btn:hover       { background: var(--gray-lite); }
.btn-primary     { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-mid); border-color: var(--brand-mid); }
.btn-success     { background: var(--green); border-color: var(--green); color: #fff; }
.btn-success:hover { opacity: .9; }
.btn-danger      { background: var(--red); border-color: var(--red); color: #fff; }
.btn-sm          { padding: 4px 10px; font-size: 12px; }
.btn-lg          { padding: 10px 24px; font-size: 15px; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label {
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .04em;
}
.form-control {
  height: 38px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--white); color: var(--text); font-size: 14px;
  transition: border-color .15s;
  outline: none;
}
.form-control:focus {
  border-color: var(--brand-mid);
  box-shadow: 0 0 0 3px rgba(36,113,163,.12);
}
textarea.form-control { height: auto; padding: 8px 12px; resize: vertical; }

/* ── Progress bar ────────────────────────────────────────────────────────── */
.progress-wrap {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1rem 1.25rem;
  display: flex; align-items: center; gap: 1.25rem; margin-bottom: 1rem;
}
.progress-bar-outer {
  flex: 1; height: 10px; background: var(--gray-lite);
  border-radius: 99px; overflow: hidden;
}
.progress-bar-inner {
  height: 100%; background: var(--green);
  border-radius: 99px; transition: width .4s;
}
.progress-stats { display: flex; gap: 1.25rem; }
.prog-stat { text-align: center; }
.prog-stat .n { font-size: 22px; font-weight: 600; }
.prog-stat .l { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

/* ── Checklist section header ────────────────────────────────────────────── */
.section-header {
  background: var(--brand);
  color: #fff; padding: 9px 14px;
  border-radius: var(--radius);
  margin: 1.25rem 0 4px;
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 600;
}
.section-header .s-count {
  margin-left: auto;
  background: rgba(255,255,255,.2);
  border-radius: 99px; font-size: 11px; padding: 2px 9px; font-weight: 500;
}

/* ── Item rows ───────────────────────────────────────────────────────────── */
.item-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius);
  transition: background .12s; cursor: default;
}
.item-row:hover { background: var(--gray-lite); }
.item-label { flex: 1; font-size: 13px; color: var(--text); }
.item-label.ignored { color: var(--text-muted); text-decoration: line-through; }
.item-label.failed  { color: var(--red); }

/* ── State buttons ───────────────────────────────────────────────────────── */
.state-btns { display: flex; gap: 4px; }
.state-btn {
  width: 30px; height: 30px; border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--white); cursor: pointer; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  transition: all .12s; color: var(--text-muted);
}
.state-btn:hover   { background: var(--gray-lite); }
.state-btn.ok      { background: var(--green-lite);  border-color: var(--green); color: var(--green); font-weight: 700; }
.state-btn.skip    { background: var(--gray-lite);   border-color: var(--gray);  color: var(--gray); }
.state-btn.fail    { background: var(--red-lite);    border-color: var(--red);   color: var(--red);  font-weight: 700; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 99px; white-space: nowrap;
}
.badge-critical    { background: var(--red-lite);   color: var(--red); }
.badge-important   { background: var(--amber-lite); color: var(--amber); }
.badge-recommended { background: var(--green-lite); color: var(--green); }
.badge-ok          { background: var(--green-lite); color: var(--green); }
.badge-warn        { background: var(--amber-lite); color: var(--amber); }
.badge-info        { background: var(--brand-lite); color: var(--brand); }
.badge-danger      { background: var(--red-lite);   color: var(--red); }

/* ── Archives table ──────────────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; padding: 10px 14px;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; color: var(--text-muted);
  border-bottom: 1px solid var(--border); background: var(--gray-lite);
}
.table td {
  padding: 11px 14px; border-bottom: 1px solid var(--border);
  color: var(--text); font-size: 13px;
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: #F0F4F8; }

.score-bar-wrap {
  display: inline-block; width: 60px; height: 5px;
  background: var(--border); border-radius: 99px;
  vertical-align: middle; margin-left: 6px; overflow: hidden;
}
.score-bar-fill { height: 100%; border-radius: 99px; }

/* ── Metric cards ────────────────────────────────────────────────────────── */
.metrics-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 10px; margin-bottom: 1.25rem;
}
.metric-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: .875rem 1rem; text-align: center;
}
.metric-card .mk { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 5px; }
.metric-card .mv { font-size: 26px; font-weight: 700; }
.metric-card .ms { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── Scanner page ────────────────────────────────────────────────────────── */
.scan-url-row { display: flex; gap: 10px; margin-bottom: .75rem; }
.scan-url-row .form-control { flex: 1; font-size: 15px; height: 44px; }
.scan-url-row .btn { height: 44px; padding: 0 24px; font-size: 14px; }

.scan-progress { display: none; margin: 1rem 0; }
.scan-progress.active { display: block; }
.scan-anim {
  height: 4px; background: var(--gray-lite); border-radius: 99px;
  overflow: hidden; margin-bottom: 10px;
}
.scan-anim-fill {
  height: 100%; background: var(--brand-mid); border-radius: 99px;
  animation: scanslide 1.8s ease-in-out infinite;
}
@keyframes scanslide { 0%{width:0;margin-left:0} 50%{width:55%;margin-left:22%} 100%{width:0;margin-left:100%} }

.scan-step { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 12px; color: var(--text-muted); }
.scan-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border); flex-shrink: 0; transition: background .2s; }
.scan-dot.done   { background: var(--green); }
.scan-dot.active { background: var(--brand-mid); animation: dotpulse 1s ease infinite; }
@keyframes dotpulse { 0%,100%{opacity:1} 50%{opacity:.35} }

.scan-results { display: none; }
.scan-results.active { display: block; }

.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.check-grid .full { grid-column: 1 / -1; }

.check-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 14px; border-bottom: 1px solid var(--border);
}
.check-item:last-child { border-bottom: none; }
.check-icon {
  width: 22px; height: 22px; border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0; margin-top: 1px;
}
.ci-ok   { background: var(--green-lite);  color: var(--green); }
.ci-fail { background: var(--red-lite);    color: var(--red); }
.ci-warn { background: var(--amber-lite);  color: var(--amber); }
.ci-info { background: var(--brand-lite);  color: var(--brand); }
.ci-info { background: var(--brand-lite);  color: var(--brand); }
.check-item-label  { font-size: 13px; font-weight: 500; color: var(--text); }
.check-item-detail { font-size: 12px; color: var(--text-muted); margin-top: 2px; font-family: monospace; word-break: break-all; }

.issues-list { }
.issue-row {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
}
.issue-row:last-child { border-bottom: none; }
.issue-sev { flex-shrink: 0; }
.issue-label { font-size: 13px; font-weight: 500; color: var(--text); }
.issue-fix   { font-size: 12px; color: var(--text-muted); margin-top: 3px; font-family: monospace; background: var(--gray-lite); padding: 2px 6px; border-radius: 4px; word-break: break-all; }

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.alert {
  padding: .875rem 1rem; border-radius: var(--radius);
  margin-bottom: 1rem; font-size: 13px;
}
.alert-success { background: var(--green-lite); color: var(--green); border: 1px solid #A9DFBF; }
.alert-error   { background: var(--red-lite);   color: var(--red);   border: 1px solid #F5B7B1; }
.alert-info    { background: var(--brand-lite);  color: var(--brand); border: 1px solid #AED6F1; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.footer {
  text-align: center; padding: 1.5rem;
  font-size: 12px; color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  display: flex; justify-content: space-between;
}

/* ── Notice box ──────────────────────────────────────────────────────────── */
.notice {
  display: flex; gap: 8px; align-items: flex-start;
  background: var(--brand-lite); border: 1px solid #AED6F1;
  border-radius: var(--radius); padding: .75rem 1rem;
  font-size: 12px; color: var(--brand); margin-bottom: 1rem;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .form-grid    { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .check-grid   { grid-template-columns: 1fr; }
  .nav-links    { display: none; }
  .page-header  { flex-direction: column; }
}