:root {
  /* This app only ships a light theme. Without this, a browser/OS set to
     dark mode renders native form controls (select's option list,
     scrollbars, checkboxes) with a dark UA theme while our CSS still paints
     the surrounding chrome light -- e.g. a <select>'s open dropdown list can
     end up rendering with light-on-light or otherwise illegible text/
     background, making the options invisible even though they're there. */
  color-scheme: light;
  --kepla-navy: #1c3144;
  --kepla-teal: #2a6f77;
  --kepla-bg: #f4f6f7;
  --kepla-border: #d6dde0;
  --kepla-danger: #a3242c;
  --kepla-warn-bg: #fff4e5;
  --kepla-warn-border: #e0a63a;
}

* { box-sizing: border-box; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--kepla-bg);
  color: #1a1a1a;
  margin: 0;
}

header.site-header {
  background: var(--kepla-navy);
  color: #fff;
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header.site-header a { color: #fff; text-decoration: none; }
header.site-header .brand { font-weight: 600; font-size: 1.05rem; }
header.site-header nav a { margin-left: 1rem; font-size: 0.9rem; opacity: 0.9; }
header.site-header nav a:hover { opacity: 1; text-decoration: underline; }
header.site-header nav span { margin-left: 1.5rem; padding-left: 1.5rem; border-left: 1px solid rgba(255, 255, 255, 0.25); font-size: 0.9rem; }

main.container {
  max-width: 960px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.card {
  background: #fff;
  border: 1px solid var(--kepla-border);
  border-radius: 6px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.narrow-card { max-width: 420px; margin: 3rem auto; }

h1, h2, h3 { color: var(--kepla-navy); }

label { display: block; font-weight: 600; margin-top: 0.85rem; margin-bottom: 0.25rem; font-size: 0.9rem; }

input[type="text"], input[type="password"], input[type="email"], input[type="number"],
select, textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--kepla-border);
  border-radius: 4px;
  font-size: 1rem;
}

button, .btn {
  display: inline-block;
  background: var(--kepla-teal);
  color: #fff;
  border: none;
  padding: 0.55rem 1.1rem;
  border-radius: 4px;
  font-size: 0.95rem;
  cursor: pointer;
  margin-top: 1rem;
  text-decoration: none;
}
button:hover, .btn:hover { opacity: 0.92; }
.btn-secondary { background: #6b7a80; }

.errorlist { color: var(--kepla-danger); list-style: none; padding: 0; margin: 0.25rem 0; font-size: 0.85rem; }

.messages { list-style: none; padding: 0; }
.messages li { padding: 0.6rem 1rem; border-radius: 4px; margin-bottom: 0.75rem; background: #e7f3ea; border: 1px solid #a9d3b3; }
.messages li.error { background: #fbe7e8; border-color: #e3a5a9; }

.compliance-banner {
  background: var(--kepla-warn-bg);
  border-bottom: 3px solid var(--kepla-warn-border);
  color: #6b4a12;
  padding: 0.6rem 1.5rem;
  font-size: 0.85rem;
  text-align: center;
  font-weight: 600;
}

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--kepla-border); font-size: 0.9rem; }
th { background: #eef1f2; }

.status-pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #dde7ea;
  color: var(--kepla-navy);
}

.helptext { color: #5a6a70; font-size: 0.85rem; }

.warn-box {
  background: var(--kepla-warn-bg);
  border: 1px solid var(--kepla-warn-border);
  border-radius: 4px;
  padding: 0.75rem 1rem;
  margin: 0.75rem 0;
  color: #6b4a12;
  font-size: 0.9rem;
}

dl.config-list { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; margin: 0; }
dl.config-list dt { font-weight: 600; color: var(--kepla-navy); }
dl.config-list dd { margin: 0; }
.backup-codes { font-family: monospace; font-size: 1.1rem; line-height: 1.8; }

.stat-tiles { display: flex; flex-wrap: wrap; gap: 1.5rem; margin: 0.5rem 0 1rem; }
.stat-tile { min-width: 140px; }
.stat-tile .value { font-size: 2rem; font-weight: 700; color: var(--kepla-navy); line-height: 1.1; }
.stat-tile .label { color: #5a6a70; font-size: 0.85rem; }

.bar-row { display: grid; grid-template-columns: 140px 1fr 60px; align-items: center; gap: 0.6rem; margin: 0.35rem 0; }
.bar-row .bar-label { font-size: 0.85rem; color: var(--kepla-navy); }
.bar-track { background: #eef1f2; border-radius: 3px; height: 14px; overflow: hidden; }
.bar-fill { background: var(--kepla-teal, #2a6f77); height: 100%; }
.bar-row .bar-value { font-size: 0.85rem; text-align: right; color: #5a6a70; }

.timeline { display: flex; flex-direction: column; }
.timeline-step { display: grid; grid-template-columns: 24px 1fr; column-gap: 0.75rem; }
.timeline-rail { display: flex; flex-direction: column; align-items: center; }
.timeline-dot { width: 14px; height: 14px; border-radius: 50%; background: #dde2e3; border: 2px solid #dde2e3; flex: none; margin-top: 0.15rem; }
.timeline-line { width: 2px; flex: 1; background: #dde2e3; min-height: 1.5rem; }
.timeline-step.done .timeline-dot { background: var(--kepla-teal, #2a6f77); border-color: var(--kepla-teal, #2a6f77); }
.timeline-step.done .timeline-line { background: var(--kepla-teal, #2a6f77); }
.timeline-step.current .timeline-dot { background: var(--kepla-navy); border-color: var(--kepla-navy); box-shadow: 0 0 0 3px rgba(28,49,68,0.15); }
.timeline-body { padding-bottom: 1.1rem; }
.timeline-label { font-weight: 600; font-size: 0.9rem; }
.timeline-step.upcoming .timeline-label { color: #93a3ac; font-weight: 500; }
.timeline-meta { font-size: 0.78rem; color: #5a6a70; }
