/* Basic styles approximating design_reference_readonly (eVital quiz page) */
:root {
  --primary: #3BAA8C;
  --primary-dark: #2d8a6f;
  --text: #1a2332;
  --muted: #5a6c7d;
  --bg: #f8faf9;
  --border: #e5e7eb;
  --error: #dc2626;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Varela Round", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container { max-width: 900px; margin: 0 auto; padding: 0 1rem; width: 100%; }
main.container { flex: 1; padding-top: 2rem; padding-bottom: 3rem; }

/* Header */
.site-header { background: #fff; border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; padding-top: 1rem; padding-bottom: 1rem; }
.header-logos { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem; }
.logo img { height: 60px; width: auto; display: block; }
.client-logo { max-height: 60px; max-width: 220px; width: auto; height: auto; object-fit: contain; display: block; padding-left: 1rem; border-left: 1px solid var(--border); }
.site-nav { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; }
.site-nav a { color: var(--text); text-decoration: none; font-weight: 600; letter-spacing: .03em; }
.site-nav a:hover { color: var(--primary); }

/* Footer */
.site-footer { color: var(--muted); font-size: .9rem; padding: 1.5rem 0; border-top: 1px solid var(--border); background: #fff; }

/* Content */
h1 { font-size: 2rem; margin: 0 0 .5rem; }
.muted { color: var(--muted); }
.card { background: #fff; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.05); padding: 2rem; }
.card.narrow { max-width: 440px; margin: 0 auto; }

.error { color: var(--error); background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; padding: .75rem 1rem; }

/* Forms */
label { display: block; font-weight: 600; margin: 1rem 0 .35rem; }
input[type=email], input[type=password], input[type=text] {
  width: 100%; padding: .75rem; font: inherit; color: inherit;
  border: 2px solid var(--border); border-radius: 8px; background: #fff;
}
input:focus { outline: none; border-color: var(--primary); }
form .btn { margin-top: 1.5rem; }

/* Buttons */
.btn {
  display: inline-block; padding: .875rem 1.75rem; font: inherit; font-weight: 600;
  color: #fff; background: var(--primary); border: 2px solid var(--primary);
  border-radius: 8px; cursor: pointer; text-decoration: none; transition: all .2s ease;
}
.btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-secondary { background: #fff; color: var(--primary); }
.btn-secondary:hover { background: var(--primary); color: #fff; }

/* Details table */
.details { border-collapse: collapse; margin: 1rem 0; }
.details th { text-align: left; color: var(--muted); font-weight: 600; padding: .35rem 1.5rem .35rem 0; }
.details td { padding: .35rem 0; }

.notice { color: #065f46; background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 8px; padding: .75rem 1rem; }
h2 { font-size: 1.35rem; margin: 2rem 0 .5rem; }
textarea { width: 100%; padding: .75rem; font: inherit; color: inherit; border: 2px solid var(--border); border-radius: 8px; }
textarea:focus { outline: none; border-color: var(--primary); }

/* Diagnostic */
.step-label { color: var(--muted); font-size: .9rem; margin: 0 0 .35rem; }
.progress { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; margin-bottom: 1.5rem; }
.progress-bar { height: 100%; background: var(--primary); }

.question { border: 2px solid var(--border); border-radius: 8px; padding: 1rem 1.25rem; margin: 1rem 0; }
.question.missing { border-color: var(--error); }
.question legend { font-weight: 600; padding: 0 .35rem; }
.qnum { color: var(--primary); margin-right: .25rem; }
.note { color: var(--muted); font-size: .95rem; margin: .25rem 0 .75rem; }
.error-inline { color: var(--error); margin: .5rem 0 0; font-size: .95rem; }

.options { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.option { position: relative; margin: 0; font-weight: normal; cursor: pointer; }
.option input { position: absolute; left: 50%; bottom: 0; opacity: 0; pointer-events: none; }
.option span { display: inline-block; padding: .5rem 1rem; border: 2px solid var(--border); border-radius: 8px; background: #fff; transition: all .15s ease; }
.option:hover span { border-color: var(--primary); }
.option input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.option input:focus-visible + span { outline: 3px solid var(--primary-dark); outline-offset: 2px; }

.ranklist { list-style: none; counter-reset: rank; padding: 0; margin: .25rem 0; max-width: 360px; }
.ranklist li { counter-increment: rank; display: flex; align-items: center; gap: .5rem; padding: .4rem .5rem .4rem .75rem; margin: .3rem 0; border: 2px solid var(--border); border-radius: 8px; background: #fff; }
.ranklist li::before { content: counter(rank) "."; color: var(--muted); min-width: 1.5rem; }
.ranklist .word { flex: 1; }
.ranklist .move { font: inherit; border: 1px solid var(--border); background: var(--bg); border-radius: 6px; padding: .2rem .55rem; cursor: pointer; }
.ranklist .move:hover { border-color: var(--primary); color: var(--primary); }
.rank-end { font-weight: 600; color: var(--muted); font-size: .9rem; margin: .5rem 0 0; }

/* Dashboard */
.report-list { padding-left: 1.25rem; }
.report-list a { color: var(--primary-dark); }

/* Report */
h3 { font-size: 1.1rem; color: var(--primary-dark); margin: 1.5rem 0 .35rem; }
.report h2 { border-top: 2px solid var(--border); padding-top: 1.25rem; }
.report-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.report-head .btn { margin-top: 0; }
.chart { width: 100%; max-width: 620px; height: auto; display: block; margin: 1rem 0; }
.report-key { display: flex; align-items: center; gap: 2rem; flex-wrap: wrap; }
.wide-img { max-width: 100%; height: auto; }
.small { font-size: .9rem; }
.wellness { border-radius: 8px; padding: 1rem 1.25rem; border: 2px solid; }
.wellness p { margin: .25rem 0; }
.wellness-text { font-size: 1.15rem; font-weight: 600; }
.wellness-high { background: #fef2f2; border-color: #fecaca; }
.wellness-medium { background: #fffbeb; border-color: #fde68a; }
.wellness-low { background: #ecfdf5; border-color: #a7f3d0; }
.questionnaire th { width: 35%; vertical-align: top; }
details { margin: 1rem 0; }
summary { cursor: pointer; color: var(--muted); }

@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; padding: 0; }
  .site-header { border-bottom: 0; }
  .report h2, .chart, .wellness { break-inside: avoid; }
  .report h2 { break-after: avoid; }
}

/* Group reports */
h4 { font-size: 1rem; margin: 1rem 0 .25rem; }
.list { border-collapse: collapse; width: 100%; margin: 1rem 0; font-size: .95rem; }
.list th, .list td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--border); }
.list thead th, .list tfoot th { color: var(--muted); font-weight: 600; }
.list tfoot td, .list tfoot th { border-top: 2px solid var(--border); border-bottom: 0; }
.list a, .zone-list a { color: var(--primary-dark); }
.num { text-align: right !important; white-space: nowrap; }
.table-scroll { overflow-x: auto; }
.tiles { display: flex; gap: 1rem; flex-wrap: wrap; margin: 1.5rem 0; }
.tile { flex: 1 1 180px; border: 2px solid var(--border); border-radius: 8px; padding: 1rem; }
.tile-value { display: block; font-size: 1.6rem; font-weight: 600; color: var(--primary-dark); }
.tile-label { color: var(--muted); font-size: .9rem; }
.risk-table { width: 100%; }
.risk-table th { width: 45%; }
.bar-cell { width: 40%; }
.bar { display: block; height: 12px; border-radius: 6px; min-width: 2px; }
.bar-high, .risk-high { background: #fecaca; }
.bar-medium, .risk-medium { background: #fde68a; }
.bar-low, .risk-low { background: #a7f3d0; }
.risk { display: inline-block; padding: .1rem .5rem; border-radius: 6px; font-size: .85rem; }
.zone-list { margin: .25rem 0; padding-left: 1.25rem; }
@media print {
  .bar, .risk { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.hostile { color: var(--error); font-weight: 700; }
.guide dt { font-weight: 600; margin-top: .75rem; }
.guide dd { margin: .2rem 0 0 0; }

/* Account & admin forms */
.form-narrow { max-width: 460px; }
.form-links { margin-top: 1.25rem; font-size: .95rem; }
.form-links a { color: var(--primary-dark); }
.error-list { margin: 0; padding-left: 1.25rem; }
.section-sep { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
.inline-form { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; max-width: 460px; margin: .5rem 0 1.25rem; }
.inline-form input[type=text] { flex: 1 1 220px; width: auto; }
.inline-form .btn { margin-top: 0; padding: .75rem 1.25rem; }
.resend-form { margin: .5rem 0 1rem; }
.resend-form .btn { margin-top: 0; }

select {
  padding: .55rem .75rem; font: inherit; color: inherit;
  border: 2px solid var(--border); border-radius: 8px; background: #fff;
}
select:focus { outline: none; border-color: var(--primary); }
.inline-form select { flex: 0 1 200px; }
.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.25rem 0; }
.btn-sm { padding: .4rem .85rem; font-size: .9rem; }
.btn-danger { background: #fff; color: var(--error); border-color: var(--error); }
.btn-danger:hover { background: var(--error); color: #fff; border-color: var(--error); }
.table-form { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: 0; }
.table-form input[type=text] { width: 160px; padding: .35rem .55rem; font-size: .9rem; }
.table-form select { padding: .35rem .55rem; font-size: .9rem; }
.table-form .btn { margin-top: 0; }
.manage-cell { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.section-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.section-head h1, .section-head h2 { margin: 0; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92rem; background: var(--bg); padding: .15rem .4rem; border-radius: 4px; border: 1px solid var(--border); }
.tag { display: inline-block; padding: .1rem .5rem; border-radius: 6px; font-size: .82rem; font-weight: 600; }
.tag-ok { background: #ecfdf5; color: #065f46; }
.tag-warn { background: #fffbeb; color: #b45309; }
.tag-muted { background: #f3f4f6; color: var(--muted); }
input[type=number] {
  width: 110px; padding: .55rem .75rem; font: inherit; color: inherit;
  border: 2px solid var(--border); border-radius: 8px; background: #fff;
}
input[type=file] { display: block; margin-top: .25rem; font: inherit; }
.table-form input[type=email] { width: 210px; padding: .35rem .55rem; font-size: .9rem; }
.check-label { display: flex; align-items: center; gap: .5rem; font-weight: normal; cursor: pointer; margin-top: 1rem; }
.check-label input { width: auto; }
.logo-preview { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin: .75rem 0 1rem; padding: .75rem 1rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); }
.logo-preview img { max-height: 60px; max-width: 220px; width: auto; height: auto; object-fit: contain; display: block; }
.support-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
