/* ═══════════════════════════════════════════════════════════════
   HelmHero v1 — components.css
   Reusable UI components. Build screens from these, not inline styles.
   ═══════════════════════════════════════════════════════════════ */

/* ── Buttons ───────────────────────────────────────────────────── */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.01em;
  color: #fff;
  background: var(--hh-grad);
  border-radius: var(--r-pill);
  padding: 11px 24px;
  box-shadow: var(--shadow-btn);
  transition: transform .15s, box-shadow .15s, opacity .15s;
  white-space: nowrap;
  user-select: none;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(20,126,251,.40);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled {
  opacity: .4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn-primary.full { width: 100%; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 13px;
  color: var(--hh-ink-2);
  background: transparent;
  border: 1px solid var(--hh-border);
  border-radius: var(--r-pill);
  padding: 10px 22px;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.btn-secondary:hover {
  color: var(--hh-blue);
  border-color: var(--hh-blue);
}
.btn-secondary:disabled { opacity: .4; cursor: not-allowed; }
.btn-secondary.full { width: 100%; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 12px;
  color: rgba(255,255,255,.65);
  background: transparent;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--r-pill);
  padding: 7px 16px;
  transition: color .15s, border-color .15s;
}
.btn-ghost:hover {
  color: #fff;
  border-color: rgba(255,255,255,.5);
}

/* ── Form inputs ───────────────────────────────────────────────── */

.field { margin-bottom: 16px; }

.field-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--hh-muted);
  margin-bottom: 7px;
}

.field-label .provenance {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  color: var(--hh-aqua-deep);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}

.field-label .provenance.estimated { color: var(--hh-muted); }
.field-label .provenance.manual    { color: var(--hh-blue); }

.inp {
  width: 100%;
  background: var(--hh-surface);
  border: 1.5px solid var(--hh-border);
  border-radius: var(--r-sm);
  padding: 9px 11px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--hh-ink);
  outline: none;
  transition: border-color .15s;
}
.inp:focus { border-color: var(--hh-blue); }
.inp::placeholder { color: var(--hh-muted); }
.inp.has-value { border-color: var(--hh-aqua-deep); }

.inp-time {
  font-family: var(--mono);
  font-size: 13px;
  width: auto;
  flex: 0 0 auto;
}

.inp-hint {
  font-size: 11px;
  color: var(--hh-muted);
  margin-top: 5px;
  line-height: 1.4;
}

/* ── Cards ─────────────────────────────────────────────────────── */

.card {
  background: var(--hh-surface);
  border: 1px solid var(--hh-border);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.card + .card { margin-top: 10px; }

/* Selectable card (boat selector, option picker) */
.card-selectable {
  background: var(--hh-surface);
  border: 1.5px solid var(--hh-border);
  border-radius: var(--r-md);
  padding: 11px 13px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-selectable:hover { border-color: var(--hh-border); background: var(--hh-surface-2); }
.card-selectable.selected {
  border-color: var(--hh-blue);
  background: var(--hh-tint-blue);
}
.card-selectable + .card-selectable { margin-top: 6px; }

.card-selectable .card-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 13px;
  color: var(--hh-ink);
}
.card-selectable .card-meta {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--hh-muted);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.card-selectable .card-check {
  margin-left: auto;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--hh-border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, border-color .15s;
}
.card-selectable.selected .card-check {
  background: var(--hh-blue);
  border-color: var(--hh-blue);
}
.card-selectable.selected .card-check::after {
  content: '';
  width: 5px; height: 8px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translate(-1px,-1px);
}

/* ── KPI cards ─────────────────────────────────────────────────── */

.kpi {
  background: var(--hh-surface);
  border: 1px solid var(--hh-border);
  border-radius: var(--r-md);
  padding: 14px 14px 12px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.kpi::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--hh-grad);
}
.kpi-value {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--hh-ink);
  line-height: 1.2;
}
.kpi-label {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--hh-muted);
  margin-top: 4px;
}

/* ── Chips ─────────────────────────────────────────────────────── */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  background: var(--hh-tint-blue);
  color: var(--hh-ink-2);
  border: 1px solid var(--hh-border-soft);
  border-radius: var(--r-pill);
  padding: 3px 9px;
  white-space: nowrap;
}

.chip.good    { background: var(--hh-tint-green);  color: var(--hh-aqua-deep); border-color: rgba(0,168,132,.2); }
.chip.warn    { background: var(--hh-tint-amber);  color: var(--amber);        border-color: rgba(212,130,10,.2); }
.chip.critical{ background: var(--hh-tint-red);    color: var(--red);          border-color: rgba(192,57,43,.2); }

/* ── Capability disclosure ─────────────────────────────────────── */

.disclosure-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--hh-surface);
  border: 1px solid var(--hh-border);
  border-radius: var(--r-md);
  padding: 10px 12px;
  margin-bottom: 6px;
}
.disclosure-item.locked {
  background: var(--hh-bg);
  border-color: var(--hh-border-soft);
}
.disclosure-icon {
  width: 20px; height: 20px;
  border-radius: 5px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.disclosure-item:not(.locked) .disclosure-icon { background: var(--hh-tint-green); }
.disclosure-item.locked .disclosure-icon {
  background: var(--hh-surface-2);
  border: 1px solid var(--hh-border);
}
.disclosure-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 12px;
  color: var(--hh-ink);
}
.disclosure-item.locked .disclosure-title { color: var(--hh-muted); }
.disclosure-desc {
  font-size: 11px;
  color: var(--hh-muted);
  line-height: 1.45;
  margin-top: 2px;
}

/* ── Felt rating ───────────────────────────────────────────────── */

.felt-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}
.felt-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: var(--hh-surface);
  border: 1.5px solid var(--hh-border);
  border-radius: var(--r-md);
  padding: 11px 6px;
  cursor: pointer;
  font-family: var(--display);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--hh-muted);
  transition: all .15s;
  user-select: none;
}
.felt-option:hover { background: var(--hh-surface-2); }
.felt-option.selected {
  background: var(--hh-tint-blue);
  border-color: var(--hh-blue);
  color: var(--hh-blue);
}
.felt-option svg { transition: color .15s; }

/* ── Provenance / quality badge ────────────────────────────────── */

.quality-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  border-radius: var(--r-pill);
  padding: 2px 7px;
}
.quality-badge.file     { background: var(--hh-tint-green); color: var(--hh-aqua-deep); }
.quality-badge.estimated{ background: var(--hh-tint-blue);  color: var(--hh-blue); }
.quality-badge.manual   { background: var(--hh-tint-blue);  color: var(--hh-blue); }

/* ── Toast ─────────────────────────────────────────────────────── */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--hh-navy);
  color: #fff;
  font-family: var(--sans);
  font-size: 13px;
  border-radius: var(--r-lg);
  padding: 12px 20px;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  white-space: nowrap;
  transition: transform .25s cubic-bezier(.34,1.56,.64,1);
  pointer-events: none;
}
.toast.visible {
  transform: translateX(-50%) translateY(0);
}
.toast a {
  color: var(--hh-aqua-bright);
  margin-left: 10px;
  font-weight: 600;
}

/* ── Responsive form wrapper ───────────────────────────────────── */

.form-wrap {
  width: 90vw;
  margin: 0 auto;
}
@media (min-width: 601px)  { .form-wrap { max-width: 680px; } }
@media (min-width: 1025px) { .form-wrap { max-width: 760px; } }

/* ── Divider ───────────────────────────────────────────────────── */

.divider {
  height: 1px;
  background: var(--hh-border);
  margin: 18px 0;
}

/* ── Inline SVG icon sizing ────────────────────────────────────── */

.icon-sm  { width: 14px; height: 14px; }
.icon-md  { width: 18px; height: 18px; }
.icon-lg  { width: 22px; height: 22px; }

/* ── Crew pills ────────────────────────────────────────────────── */
.crew-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.crew-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--hh-surface);
  border: 1.5px solid var(--hh-border);
  border-radius: var(--r-pill);
  padding: 5px 12px;
  font-family: var(--display);
  font-size: 12px;
  font-weight: 600;
  color: var(--hh-muted);
  cursor: pointer;
  transition: all .15s;
  user-select: none;
}
.crew-pill:hover { border-color: var(--hh-aqua-deep); color: var(--hh-aqua-deep); }
.crew-pill.selected {
  background: var(--hh-tint-green);
  border-color: var(--hh-aqua-deep);
  color: var(--hh-aqua-deep);
}
.crew-flair {
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 400;
  opacity: .7;
}
