/* CPA Evidence Search. Visual system matches the CPA sites Nomion built (cpa.nomion.ai: the strategy packet and the
   discovery questionnaire): CPA's palette from calvaryonlineschool.com, Roboto for display, Open Sans for body. */

:root {
  --cpa-teal: #226d7a;
  --cpa-teal-dark: #1a5862;
  --cpa-sky: #22b8d1;
  --cpa-cloud: #b0e0e9;
  --cpa-ivory: #e4f5fa;
  --cpa-white: #ffffff;
  --cpa-text: #1a1a1a;
  --cpa-text-soft: #4a5a60;
  --cpa-text-muted: #6e7e83;
  --cpa-border: #d6e6ea;
  --cpa-border-strong: #b0e0e9;
  --ok: #27916b;
  --warn: #c0532b;
  --warn-bg: #fdece6;
  --font-display: "Roboto", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Open Sans", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--cpa-text);
  background: linear-gradient(160deg, var(--cpa-ivory) 0%, #fff 45%);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--cpa-teal); text-decoration: none; border-bottom: 1px solid transparent; }
a:hover { color: var(--cpa-sky); border-bottom-color: var(--cpa-sky); }

/* Header: same brand tile and text block as the discovery questionnaire */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--cpa-border); box-shadow: 0 1px 4px rgba(34, 109, 122, .05);
}
.header-inner {
  max-width: 880px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--cpa-teal), var(--cpa-sky)); color: #fff;
  font-family: var(--font-display); font-weight: 900; font-size: 19px;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(34, 109, 122, .25);
}
.brand-text b { font-family: var(--font-display); font-weight: 700; color: var(--cpa-teal); font-size: 16px; display: block; line-height: 1.1; }
.brand-text span { font-size: 12px; color: var(--cpa-text-muted); letter-spacing: .04em; text-transform: uppercase; }
.header-actions { display: flex; align-items: center; gap: 10px; }

/* Page */
main { max-width: 880px; margin: 0 auto; padding: 28px 24px 80px; }
.kicker {
  font-family: var(--font-display); font-size: 12px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--cpa-sky); margin: 0 0 8px;
}
h1 {
  font-family: var(--font-display); font-weight: 700; font-size: 30px; line-height: 1.15;
  color: var(--cpa-teal); margin: 0 0 10px; letter-spacing: -.01em;
}
.sub { font-size: 16px; color: var(--cpa-text-soft); margin: 0 0 28px; max-width: 640px; }

.card {
  background: #fff; border: 1px solid var(--cpa-border-strong); border-radius: 16px;
  padding: 28px; box-shadow: 0 4px 24px rgba(34, 109, 122, .06); margin-bottom: 22px;
}
.field-label {
  display: block; font-family: var(--font-display); font-weight: 600; font-size: 15px;
  color: var(--cpa-text); margin-bottom: 6px;
}
.hint { font-size: 13px; color: var(--cpa-text-muted); margin: 8px 0 0; line-height: 1.5; }

.notice {
  background: var(--cpa-ivory); border-left: 4px solid var(--cpa-sky); border-radius: 0 8px 8px 0;
  padding: 14px 18px; font-size: 14px; color: var(--cpa-teal-dark); margin: 0 0 20px;
}

/* Forms */
form { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
input[type=text], input[type=password], input[type=email], input[type=number], textarea, select {
  flex: 1 1 260px; font-family: var(--font-body); font-size: 15px; color: var(--cpa-text); background: #fff;
  border: 1px solid var(--cpa-border-strong); border-radius: 10px; padding: 12px 14px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 110px; resize: vertical; width: 100%; line-height: 1.55; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--cpa-sky); box-shadow: 0 0 0 3px rgba(34, 184, 209, .15); }
.form-foot { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px; }
.count { font-family: var(--font-display); font-size: 12px; font-weight: 600; color: var(--cpa-text-muted); letter-spacing: .04em; }

/* Buttons: every button is the primary teal button unless marked otherwise */
button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 26px; border-radius: 10px; border: 2px solid var(--cpa-teal);
  background: var(--cpa-teal); color: #fff; box-shadow: 0 4px 12px rgba(34, 109, 122, .18);
  font-family: var(--font-display); font-weight: 700; font-size: 15px; line-height: 1; cursor: pointer;
  transition: transform .15s, background .15s, box-shadow .15s, color .15s;
}
button:hover { transform: translateY(-1px); background: var(--cpa-teal-dark); border-color: var(--cpa-teal-dark); }
button[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
button:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(34, 184, 209, .35); }
.btn-ghost { background: #fff; color: var(--cpa-teal); border-color: var(--cpa-border-strong); box-shadow: none; }
.btn-ghost:hover { background: var(--cpa-ivory); color: var(--cpa-teal); border-color: var(--cpa-border-strong); }
#actions button { padding: 10px 18px; font-size: 14px; margin: 0 8px 8px 0; }
td button { padding: 7px 12px; font-size: 13px; box-shadow: none; }

/* Answer */
.answer:empty { display: none; }
.answer {
  background: #fff; border: 1px solid var(--cpa-border-strong); border-radius: 16px;
  padding: 24px 28px; box-shadow: 0 4px 24px rgba(34, 109, 122, .06); margin-top: 22px;
}
.answer p { margin: 0 0 12px; }
.sources {
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--cpa-border);
  font-size: 14px; color: var(--cpa-text-soft);
}
.sources strong {
  font-family: var(--font-display); font-size: 12px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--cpa-teal-dark);
}
.declined { color: var(--cpa-text-soft); font-style: italic; }
.error { color: var(--warn); font-size: 14px; margin: 10px 0 0; }
.error:empty { display: none; }

/* Staff tabs: the questionnaire's choice chips */
#tabs { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 20px; }
#tabs button {
  background: #fff; color: var(--cpa-text-soft); border: 1.5px solid var(--cpa-border-strong); box-shadow: none;
  font-weight: 500; font-size: 14px; padding: 10px 16px;
}
#tabs button:hover { background: var(--cpa-ivory); color: var(--cpa-teal); transform: none; }
#tabs button.on { background: var(--cpa-teal); border-color: var(--cpa-teal); color: #fff; box-shadow: 0 2px 8px rgba(34, 109, 122, .2); }
#msg:empty { display: none; }
#msg { font-size: 14px; margin: 0 0 16px; padding: 12px 16px; border-radius: 0 8px 8px 0; }
#msg.ok { background: var(--cpa-ivory); border-left: 4px solid var(--ok); color: var(--cpa-teal-dark); }
#msg.err { background: var(--warn-bg); border-left: 4px solid var(--warn); color: var(--warn); }
p.err { color: var(--warn); font-size: 14px; }
p.empty { color: var(--cpa-text-muted); font-size: 14px; }

/* Staff action forms (replace browser pop-ups) */
.action-form { display: block; max-width: 620px; }
.action-form h2 { font-family: var(--font-display); font-size: 18px; color: var(--cpa-teal); margin: 0 0 6px; }
.action-form > .hint { margin: 0 0 18px; }
.field { margin-bottom: 18px; }
.field input, .field select, .field textarea { width: 100%; }
.field .hint { margin-top: 6px; }
select { appearance: none; padding-right: 40px; background-repeat: no-repeat; background-position: right 16px center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23226d7a' d='M6 8 0 0h12z'/%3E%3C/svg%3E"); }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.reveal { max-width: 620px; border-color: var(--ok); }
.reveal .code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 26px; font-weight: 700; letter-spacing: .06em;
  color: var(--cpa-teal-dark); background: var(--cpa-ivory); border-radius: 10px; padding: 14px 18px; margin: 4px 0 12px; word-break: break-all; }
button.armed { background: var(--warn); border-color: var(--warn); color: #fff; }

/* Tables */
#view { overflow-x: auto; }
table {
  border-collapse: separate; border-spacing: 0; width: 100%; font-size: 14px; background: #fff;
  border: 1px solid var(--cpa-border); border-radius: 12px; overflow: hidden;
}
th {
  font-family: var(--font-display); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--cpa-teal-dark); background: var(--cpa-ivory); text-align: left; padding: 10px 12px;
  border-bottom: 1px solid var(--cpa-border-strong);
}
td { padding: 10px 12px; border-bottom: 1px solid var(--cpa-border); vertical-align: top; color: var(--cpa-text-soft); }
tr:last-child td { border-bottom: 0; }

.site-footer {
  max-width: 880px; margin: 0 auto; padding: 20px 24px 40px; font-size: 13px; color: var(--cpa-text-muted);
  border-top: 1px solid var(--cpa-border);
}

.hidden { display: none !important; }

@media (max-width: 600px) {
  .header-inner, main, .site-footer { padding-left: 16px; padding-right: 16px; }
  h1 { font-size: 25px; }
  .card { padding: 20px; }
  .brand-text span { display: none; }
  form button, .form-foot button { width: 100%; }
  .form-foot { flex-direction: column; align-items: stretch; }
  input[type=text], input[type=password], textarea { flex-basis: 100%; }
  .header-actions button { padding: 10px 14px; font-size: 13px; }
}

form .field-label { width: 100%; margin-bottom: 0; }
