/* PIP Passport — site styles. Calm, high-contrast, readable. */

:root {
  --ink: #1a2e2a;
  --muted: #4b5d58;
  --paper: #f7f5ef;
  --card: #ffffff;
  --teal: #0f766e;
  --teal-dark: #0b5e57;
  --teal-soft: #e0f2ef;
  --gold: #b45309;
  --border: #d8d3c4;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

.site-header {
  background: var(--teal);
  color: #ffffff;
  padding: 0 0 32px;
  text-align: center;
}

.cover-banner {
  display: block;
  width: 100%;
  height: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.site-header .tagline {
  margin: 24px auto 16px;
  max-width: 640px;
  font-size: 1.15em;
  padding: 0 20px;
}

.site-header .disclaimer {
  margin: 0 auto;
  max-width: 640px;
  font-size: 0.85em;
  opacity: 0.9;
  padding: 0 20px;
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px 40px;
}

section { margin-top: 40px; }

h2 {
  font-size: 1.5em;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

h3 { margin: 0 0 4px; }

p { margin: 0 0 12px; }

a { color: var(--teal-dark); }

/* Checker form */
#checker-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 16px;
}

#checker-form label {
  display: block;
  font-weight: 600;
  font-size: 0.95em;
}

#checker-form select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px;
  font: inherit;
  font-weight: 400;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
}

#checker-form button[type="submit"] {
  grid-column: 1 / -1;
  justify-self: start;
}

button {
  font: inherit;
  padding: 10px 18px;
  border: 1px solid var(--teal);
  border-radius: 8px;
  background: var(--teal);
  color: #ffffff;
  cursor: pointer;
}

button:hover { background: var(--teal-dark); }

button:disabled {
  background: var(--muted);
  border-color: var(--muted);
  cursor: default;
}

button.add-plan {
  margin-top: 10px;
  padding: 8px 14px;
  font-size: 0.9em;
}

/* Results */
#checker-results { margin-top: 24px; }

#checker-results h3 { font-size: 1.25em; }

.result {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 6px solid var(--muted);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 12px 0;
}

.result-likely { border-left-color: #15803d; }
.result-maybe { border-left-color: var(--gold); }
.result-not_on_this { border-left-color: #9ca3af; }
.result-everyone { border-left-color: var(--teal); }

.result-verdict { font-weight: 700; margin-bottom: 6px; }

.result a { margin-right: 12px; }

/* Scheme directory */
.scheme-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.scheme {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.scheme-tagline {
  font-weight: 600;
  color: var(--teal-dark);
}

.scheme-cost { color: var(--muted); }

.scheme a { margin-right: 12px; }

/* Plan */
#plan-list {
  list-style: none;
  margin: 12px 0;
  padding: 0;
}

.plan-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 8px;
}

.plan-item select {
  padding: 6px 8px;
  font: inherit;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
}

.plan-remove {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--border);
  padding: 6px 12px;
  font-size: 0.9em;
}

.plan-remove:hover { background: #f0ede4; }

/* Assistant layout. Append to the site's stylesheet and set the colors to the site's palette. */
.assistant { margin-top: 48px; }

/* The runtime reads these variables for its chat, settings and agent panels.
   The chat background below also uses --ns-bg. White text sits on --ns-primary (the
   visitor's messages, Send, and the chat form and settings buttons) and on --ns-accent
   (Send while a turn is steered), so give both at least 4.5:1 contrast with white.
   --ns-accent also underlines the chat header. */
#agent-app {
  --ns-font: system-ui, sans-serif;
  --ns-bg: #ffffff;
  --ns-fg: #1a2e2a;
  --ns-primary: #0f766e;
  --ns-accent: #0f766e;
  --ns-border: #d8d3c4;
  --ns-panelbg: #ffffff;
  --ns-msgbg: #f7f5ef;
  --ns-muted: #4b5d58;
}

.assistant-panels {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 16px;
  margin-top: 16px;
}

/* Set the height once the runtime has mounted the chat, so a failed load leaves no
   empty box. */
#agent-app.ns-composed-app [data-ns-slot="chat"] { height: 720px; }
/* The runtime gives the chat no background of its own. Keep --ns-msgbg different from
   --ns-bg, or bot replies lose their bubble. */
#agent-app .ns-chat { background: var(--ns-bg); }

/* Site-wide form rules often stretch the runtime's own controls. Undo them here. */
#agent-app input[type="checkbox"],
#agent-app input[type="radio"] { width: auto; }
#agent-app .ns-header { flex-wrap: wrap; }
/* Site label rules add margins and bold text, and the inputs inside the labels inherit
   the weight. */
#agent-app .ns-settings-body label { margin: 4px 0; font-weight: 400; }
/* Chat forms label radio groups with a legend, so site legend fonts would reach them. */
#agent-app .ns-w-label { font-family: inherit; }
/* Site label rules add margins to chat form fields and make their options bold. */
#agent-app .ns-widget label { margin: 0; }
#agent-app .ns-w-radio label,
#agent-app .ns-w-multi label,
#agent-app .ns-w-toggle { font-weight: 400; }
/* The runtime sizes radio and multi-choice options but not the checkbox label. */
#agent-app .ns-w-toggle { font-size: 13px; }
/* The runtime spaces its buttons with gap. A site's button margin pushes Send below the input. */
#agent-app button { margin: 0; }
/* Chat choices are buttons with a light background. A site's button color can hide their
   titles. */
#agent-app .ns-w-choice { color: var(--ns-fg); }
/* A site's button:hover background also reaches the runtime's plain buttons, behind
   their dark text. Keep the runtime's own backgrounds. */
#agent-app .ns-devtoggle:not(.on):hover,
#agent-app .ns-modal-close:hover { background: transparent; }
#agent-app .ns-w-choice:disabled:hover { background: #fafbfc; }
/* The runtime's message rule hides the partner consent card's own background, and its
   Decline label then has too little contrast. */
#agent-app .ns-consent { background: #fffbeb; }
/* While a consent card waits, the status line above it already says "Contacting", though
   nothing has been sent. Hide it until the visitor answers. */
#agent-app .ns-msgs:has(.ns-consent-actions) > .ns-turn-status { display: none; }
/* Long links in a reply would run out of the bubble on a phone. "anywhere" would also
   let the consent card's buttons shrink and split their labels. */
#agent-app .ns-msg { overflow-wrap: break-word; }
/* On a phone the consent card is too narrow for its three buttons in one row, and
   "Always allow" breaks onto two lines. Keep each label whole and wrap the row. */
#agent-app .ns-consent-actions { flex-wrap: wrap; }
#agent-app .ns-consent-actions button { white-space: nowrap; }

/* site.js and the runtime add their confirmation dialogs to <body>, outside #agent-app.
   Site h2 rules reach the heading, and the two buttons touch. A right margin keeps
   wrapped buttons lined up on the left. */
body > dialog h2 { margin: 0 0 12px; font: 700 1.25em system-ui, sans-serif; }
body > dialog button { margin-right: 8px; }
/* site.js's dialog: the details in two columns, and a plain decline button, so the two
   choices do not look the same. */
.assistant-review { max-width: 640px; width: 85%; max-height: 85vh; overflow: auto; border: 1px solid #888; border-radius: 12px; padding: 24px; font: 16px system-ui, sans-serif; }
.assistant-review dl { display: grid; grid-template-columns: fit-content(40%) 1fr; gap: 4px 16px; margin: 12px 0; }
.assistant-review dt { font-weight: 600; }
.assistant-review dd { margin: 0; overflow-wrap: anywhere; }
.assistant-review details { margin: 12px 0; }
.assistant-review pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.assistant-review .assistant-decline { background: transparent; color: inherit; border: 1px solid currentColor; }

/* Home-screen widget card */
.widget-card {
  background: #0a1e2e;
  color: #ffffff;
  border-radius: var(--radius);
  padding: 20px;
  max-width: 420px;
  margin: 16px 0;
}

.widget-card-title {
  font-size: 1.25em;
  font-weight: 700;
  margin: 0 0 4px;
}

.widget-card ul {
  margin: 12px 0 0;
  padding-left: 20px;
}

footer {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 20px 48px;
  color: var(--muted);
  font-size: 0.9em;
  border-top: 1px solid var(--border);
}

footer h2 { font-size: 1.1em; }

@media (max-width: 760px) {
  #checker-form { grid-template-columns: 1fr; }
  .scheme-grid { grid-template-columns: 1fr; }
  .assistant-panels { grid-template-columns: 1fr; }
  /* On a phone, each detail goes under its label, so an email is not split. */
  .assistant-review dl { grid-template-columns: 1fr; gap: 0; }
  .assistant-review dd { margin-bottom: 8px; }
}
