/* Look and feel follow the 1159finance.com signup form (Salient theme):
   Noto Sans, navy text, borderless light-blue inputs, violet-blue accent. */

@font-face {
  font-family: "Noto Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/noto-sans-ad935206.woff2") format("woff2");
}

:root {
  --bg: #ffffff;
  --text: #161842;
  --muted: #6e7191;
  --field: #f3f5fb;
  --line: #e3e6f0;
  --accent: #6a7de7;
  --accent-dark: #5266d6;
  --ok: #1a7f4b;
  --warn: #b7791f;
  --error: #dd3333;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 "Noto Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Link text uses the darker accent: the brand violet is below AA contrast on white. */
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 84px;
  padding: 0 2rem;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.topbar .brand { display: flex; align-items: center; gap: 0.75rem; color: var(--text); text-decoration: none; }
.topbar .brand img { height: 26px; width: auto; display: block; }
.topbar .brand span { font-weight: 700; padding-left: 0.75rem; border-left: 1px solid var(--line); }
.topbar nav { display: flex; align-items: center; gap: 1.5rem; }
.topbar nav a { font-weight: 700; }
.topbar nav form { margin: 0; }

.container { max-width: 900px; margin: 0 auto; padding: 2.5rem 1.5rem 4rem; }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

h1 { font-size: 1.6rem; line-height: 1.3; margin: 0; }
h2 { font-size: 1.15rem; margin: 0 0 1rem; }

.panel {
  background: var(--field);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.flash { padding: 0.9rem 1.25rem; border-radius: 4px; margin-bottom: 1.5rem; }
.flash-notice { background: #e6f4ec; color: var(--ok); }
.flash-alert { background: #fbe7e7; color: var(--error); }
.flash-warning { background: #fdf3e1; color: var(--warn); }
.flash ul { margin: 0.25rem 0 0 1.25rem; }
.flash a { color: inherit; text-decoration: underline; }

/* Buttons */
.button {
  display: inline-block;
  padding: 0.75rem 1.4rem;
  border: 0;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 6px 14px rgba(106, 125, 231, 0.24);
  transition: background 0.15s, box-shadow 0.15s;
}
.button:hover { background: var(--accent-dark); color: #fff; text-decoration: none; box-shadow: 0 3px 8px rgba(106, 125, 231, 0.3); }
.button-small { padding: 0.5rem 1rem; font-size: 0.95rem; }
.button-secondary { background: #fff; color: var(--accent-dark); border: 2px solid var(--accent); padding: calc(0.75rem - 2px) calc(1.4rem - 2px); box-shadow: none; }
.button-secondary:hover { background: var(--field); box-shadow: none; }

.link-button {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: var(--accent-dark);
  cursor: pointer;
}
.link-button:hover { text-decoration: underline; }

.button:focus-visible, .link-button:focus-visible, input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--accent-dark);
  outline-offset: 2px;
}

.badge {
  display: inline-block;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  vertical-align: middle;
}
.badge-draft { background: #e6e8f2; color: var(--muted); }
.badge-partial { background: #fdf3e1; color: var(--warn); }
.badge-failed { background: #fbe7e7; color: var(--error); }
.badge-completed { background: #e6f4ec; color: var(--ok); }

.muted { color: var(--muted); }
.error { color: var(--error); }
.hint { color: var(--muted); margin: 0 0 1rem; font-size: 0.95rem; }
legend + .hint, h2 + .hint { margin-top: -0.5rem; }
.empty { color: var(--muted); }

/* Forms */
.onboarding-form fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 2.5rem;
}
.onboarding-form legend {
  font-size: 1.15rem;
  font-weight: 700;
  padding: 0;
  margin-bottom: 1rem;
}

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.5rem; }
.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field-wide { grid-column: span 2; }
.field-checkbox { flex-direction: row; align-items: center; gap: 0.6rem; }
.field label { font-size: 0.9rem; font-weight: 700; }
.field-checkbox label { font-size: 1rem; }
.field small { color: var(--muted); font-size: 0.85rem; }

input[type="text"], input[type="email"], input[type="tel"], input[type="password"], select, textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid transparent;
  border-radius: 4px;
  font: inherit;
  color: var(--text);
  background: var(--field);
  transition: border-color 0.15s, background 0.15s;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input[type="text"]:focus, input[type="email"]:focus, input[type="tel"]:focus, input[type="password"]:focus, select:focus, textarea:focus {
  outline: 0;
  border-color: var(--accent);
  background-color: #fff;
}
input[type="checkbox"] { width: 1.1rem; height: 1.1rem; margin: 0; accent-color: var(--accent); }

/* Rails wraps invalid fields in a div; display: contents keeps the .field column layout intact. */
.field_with_errors { display: contents; }
.field_with_errors label { color: var(--error); }
.field_with_errors input, .field_with_errors select, .field_with_errors textarea { border-color: var(--error); background: #fff7f7; }
select {
  appearance: none;
  padding-right: 2.5rem;
  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 d='M1 1l5 5 5-5' fill='none' stroke='%23161842' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}

.target {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 1rem 1.5rem;
  align-items: center;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}
.target:first-of-type { border-top: 0; padding-top: 0; }
.target .field-checkbox label { font-weight: 700; }

.actions { display: flex; align-items: center; gap: 1.5rem; margin-top: 0.5rem; }

.auth { max-width: 420px; margin: 4rem auto; }
.auth h1 { margin-bottom: 1.5rem; }
.auth .field { margin-bottom: 1rem; }

/* Lists and data */
.list { width: 100%; border-collapse: collapse; }
.list th, .list td { text-align: left; padding: 0.75rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.list th { font-size: 0.85rem; color: var(--muted); font-weight: 700; }
.list small { color: var(--muted); }

.data { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 0.4rem 1rem; margin: 0; }
.data dt { color: var(--muted); }
.data dd { margin: 0; }
.data dd p { margin: 0; }

.target-status {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}
.target-status:last-of-type { border-bottom: 0; }
.target-status + .button_to { margin-top: 1rem; }
.target-status .muted { display: block; font-size: 0.9rem; }

.checklist { margin: 0; padding-left: 1.25rem; }
.checklist li { margin-bottom: 0.4rem; }

code.response { font-size: 0.8rem; word-break: break-all; color: var(--muted); }

@media (max-width: 640px) {
  .topbar { height: auto; padding: 1rem; flex-wrap: wrap; }
  .container { padding: 1.5rem 1rem 3rem; }
  .grid, .target, .data { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .target-status { flex-direction: column; }
  .page-header { flex-wrap: wrap; }
}
