/* Field Inspector Pro — shared styles for the account / team / auth pages.
 *
 * Tokens and component shapes are lifted from index.html so the product pages look
 * like the landing page: pill buttons, the same blue, the amber "in progress" accent.
 * NDT Pro duplicates its CSS in every page; eight pages needing the same rules is
 * enough concrete cases to justify one file. No build step — it is a static asset.
 */

:root {
  --blue:      #2563EB;
  --blue-dark: #1D4ED8;
  --blue-soft: rgba(37, 99, 235, 0.08);
  --blue-line: rgba(37, 99, 235, 0.22);
  --navy:      #0F2440;
  --accent:    #F59E0B;
  --bg:        #F5F7FA;
  --card:      #FFFFFF;
  --ink:       #16202E;
  --steel:     #5A6B82;
  --line:      #E3E8EF;
  --line-2:    #D4DBE5;
  --ok:        #0F7A3F;
  --ok-bg:     #E8F7EE;
  --ok-line:   #C6ECD4;
  --err:       #B42318;
  --err-bg:    #FDECEC;
  --err-line:  #F6CFCA;
  --warn:      #8A5A00;
  --warn-bg:   #FFF6E5;
  --warn-line: #F5D9A6;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ── Top bar ───────────────────────────────────────────────────────────── */
.top {
  background: linear-gradient(180deg, #fff 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 18px; font-weight: 800; letter-spacing: -0.4px;
  color: var(--navy); text-decoration: none;
}
.logo img { width: 28px; height: 28px; border-radius: 8px; display: block; }
.logo em { font-style: normal; color: var(--blue); }
.topnav { display: flex; gap: 18px; align-items: center; }
.topnav a { font-size: 13.5px; color: var(--steel); text-decoration: none; font-weight: 600; }
.topnav a:hover { color: var(--ink); }
.topnav a.on { color: var(--navy); }
.topnav .signout {
  font-size: 13.5px; color: var(--steel); background: none; border: none;
  cursor: pointer; font-weight: 600; font-family: inherit; padding: 0;
}
.topnav .signout:hover { color: var(--ink); }

/* ── Layout ────────────────────────────────────────────────────────────── */
.wrap { flex: 1; display: flex; align-items: flex-start; justify-content: center; padding: 44px 20px 60px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 12px 40px rgba(15, 36, 64, 0.08);
  width: 100%; max-width: 480px;
  padding: 34px 30px;
}
.card.wide { max-width: 660px; }
.card.narrow { max-width: 440px; }
.card.center { text-align: center; }

h1 { font-size: 25px; font-weight: 830; color: var(--navy); letter-spacing: -0.7px; line-height: 1.2; margin-bottom: 6px; }
h2 { font-size: 15.5px; font-weight: 800; color: var(--navy); margin: 24px 0 8px; }
h2:first-child { margin-top: 0; }
.sub { color: var(--steel); font-size: 14.5px; margin-bottom: 20px; }
.fine { font-size: 12px; color: var(--steel); line-height: 1.55; }
.fine a { color: var(--steel); }

/* ── Forms ─────────────────────────────────────────────────────────────── */
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin: 14px 0 6px; }
input, select {
  width: 100%; padding: 12px 13px;
  border: 1.5px solid var(--line); border-radius: 12px;
  font-size: 15px; font-family: inherit; color: var(--ink);
  background: #fff; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14); }
input:disabled, select:disabled { background: #F7F9FC; color: var(--steel); }

/* ── Buttons — pill shaped, always text-labelled ───────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--blue); color: #fff;
  font-size: 14.5px; font-weight: 700; font-family: inherit;
  padding: 12px 22px; border: none; border-radius: 30px;
  text-decoration: none; cursor: pointer;
  box-shadow: 0 6px 22px rgba(37, 99, 235, 0.28);
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.btn:hover:not(:disabled) { background: var(--blue-dark); transform: translateY(-1px); box-shadow: 0 8px 28px rgba(37, 99, 235, 0.38); }
.btn:disabled { background: #9BB2E8; cursor: not-allowed; box-shadow: none; transform: none; }
.btn-block { width: 100%; margin-top: 20px; padding: 15px 24px; font-size: 15px; }
.btn-ghost {
  background: #fff; color: var(--ink);
  border: 1.5px solid var(--line-2); box-shadow: none;
}
.btn-ghost:hover:not(:disabled) { background: #fff; border-color: var(--blue); color: var(--blue); box-shadow: none; }
.btn-ghost:disabled { background: #fff; color: var(--steel); border-color: var(--line); }
.btn-danger { background: #fff; color: var(--err); border: 1.5px solid var(--err-line); box-shadow: none; }
.btn-danger:hover:not(:disabled) { background: var(--err-bg); color: var(--err); border-color: var(--err-line); box-shadow: none; transform: translateY(-1px); }
.btn-sm { padding: 9px 15px; font-size: 13px; border-radius: 24px; box-shadow: none; }

/* ── Status pills ──────────────────────────────────────────────────────── */
.pill { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill.ok    { background: rgba(24, 169, 87, 0.13); color: var(--ok); }
.pill.trial { background: var(--blue-soft); color: var(--blue-dark); }
.pill.warn  { background: var(--warn-bg); color: var(--warn); }
.pill.bad   { background: var(--err-bg); color: var(--err); }
.pill.off   { background: #EEF1F5; color: var(--steel); }

/* ── Key/value rows ────────────────────────────────────────────────────── */
.row { display: flex; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.row:last-of-type { border-bottom: none; }
.row .k { color: var(--steel); }
.row .v { font-weight: 700; color: var(--ink); text-align: right; }

.section { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }

/* ── Messages / banners / three-part alerts ────────────────────────────── */
.msg { margin-top: 14px; font-size: 14px; line-height: 1.5; padding: 11px 14px; border-radius: 12px; display: none; }
.msg.err { display: block; background: var(--err-bg); color: var(--err); border: 1px solid var(--err-line); }
.msg.ok  { display: block; background: var(--ok-bg);  color: var(--ok);  border: 1px solid var(--ok-line); }

.banner { margin-top: 14px; padding: 14px 16px; border-radius: 14px; font-size: 14px; line-height: 1.5; }
.banner strong { display: block; font-size: 15px; margin-bottom: 3px; }
.banner a { color: inherit; font-weight: 700; }
.banner.info { background: var(--blue-soft); border: 1px solid var(--blue-line); color: var(--blue-dark); }
.banner.warn { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn); }
.banner.bad  { background: var(--err-bg); border: 1px solid var(--err-line); color: var(--err); }
.banner .btn { margin-top: 12px; }

/* Three-part error: 5-7 word title, 1-2 sentence body, one action. Never raw JSON. */
.alert { margin-top: 16px; padding: 15px 17px; border-radius: 14px; background: var(--err-bg); border: 1px solid var(--err-line); color: var(--err); display: none; }
.alert.show { display: block; }
.alert .t { font-weight: 800; font-size: 15px; margin-bottom: 3px; }
.alert .b { font-size: 14px; line-height: 1.5; }
.alert .btn { margin-top: 13px; background: var(--err); box-shadow: none; }
.alert .btn:hover:not(:disabled) { background: #8F1B12; box-shadow: none; }

/* ── Seat usage bar ────────────────────────────────────────────────────── */
.usage { margin: 8px 0 4px; }
.usage .bar { height: 10px; background: #EEF1F5; border-radius: 999px; overflow: hidden; }
.usage .fill { height: 100%; background: var(--blue); border-radius: 999px; transition: width 0.3s; }
.usage .fill.full { background: var(--accent); }
.usage .txt { font-size: 13.5px; color: var(--steel); margin-top: 7px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* ── Team member rows ──────────────────────────────────────────────────── */
.member { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.member:last-child { border-bottom: none; }
.member .who { min-width: 0; flex: 1 1 auto; }
.member .name { font-weight: 700; font-size: 14.5px; display: flex; align-items: center; gap: 7px; min-width: 0; }
.member .nametext { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.member .meta { font-size: 12.5px; color: var(--steel); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member .act { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.empty { font-size: 14px; color: var(--steel); padding: 8px 0; }

.invite-grid { display: grid; grid-template-columns: 1fr 170px auto; gap: 10px; align-items: end; }
.invite-grid label { margin-top: 0; }
.invite-grid .btn { margin-bottom: 1px; }

/* ── Job assignment picker (FIP-specific: inspectors see only assigned jobs) ── */
.jobs-box { margin-top: 10px; padding: 16px 18px; border: 1.5px solid var(--blue-line); background: var(--blue-soft); border-radius: 14px; }
.jobs-box h2 { overflow-wrap: anywhere; }
.jobs-box .hint { overflow-wrap: anywhere; font-size: 13px; color: var(--steel); margin-bottom: 10px; line-height: 1.5; }
.jobs-list { max-height: 260px; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px; }
.jobs-list label { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 9px 0; font-weight: 500; font-size: 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.jobs-list label:last-child { border-bottom: none; }
.jobs-list input[type=checkbox] { width: auto; margin-top: 3px; flex-shrink: 0; accent-color: var(--blue); }
.jobs-list .jname { font-weight: 700; color: var(--ink); }
.jobs-list .jmeta { font-size: 12.5px; color: var(--steel); }
.jobs-box .actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

/* ── Password rule checklist ───────────────────────────────────────────── */
.rules { margin: 12px 0 4px; padding: 12px 14px; background: var(--blue-soft); border: 1px solid var(--blue-line); border-radius: 12px; font-size: 13px; line-height: 1.55; }
.rules .rules-head { font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.rules ul { list-style: none; }
.rules li { padding: 2px 0; display: flex; align-items: center; gap: 8px; color: var(--steel); }
.rules li::before {
  content: ''; flex-shrink: 0; width: 14px; height: 14px; border-radius: 50%;
  background-color: rgba(90, 107, 130, 0.14);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235A6B82' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
  background-repeat: no-repeat; background-position: center; background-size: 9px;
}
.rules li.ok { color: var(--ok); }
.rules li.ok::before {
  background-color: rgba(24, 169, 87, 0.16);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230F7A3F' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
}

/* ── Confirm dialog ────────────────────────────────────────────────────── */
.overlay { position: fixed; inset: 0; background: rgba(15, 36, 64, 0.45); display: none; align-items: center; justify-content: center; padding: 20px; z-index: 50; }
.overlay.show { display: flex; }
.dialog { background: #fff; border-radius: 18px; max-width: 430px; width: 100%; padding: 26px 24px; box-shadow: 0 24px 60px rgba(15, 36, 64, 0.25); }
.dialog h3 { font-size: 18px; font-weight: 800; color: var(--navy); margin-bottom: 8px; }
.dialog p { font-size: 14.5px; line-height: 1.55; color: var(--ink); }
.dialog .actions { display: flex; gap: 10px; margin-top: 20px; justify-content: flex-end; flex-wrap: wrap; }

/* ── Success / cancel pages ────────────────────────────────────────────── */
.check { width: 62px; height: 62px; border-radius: 50%; background: rgba(24, 169, 87, 0.12); color: var(--ok); display: flex; align-items: center; justify-content: center; font-size: 32px; font-weight: 700; margin: 0 auto 20px; }
.steps { text-align: left; color: var(--ink); font-size: 15px; line-height: 1.9; margin: 10px auto 24px; max-width: 340px; padding-left: 22px; }

/* ── Footer ────────────────────────────────────────────────────────────── */
.foot { text-align: center; font-size: 12.5px; color: var(--steel); padding: 22px 20px 30px; }
.foot a { color: var(--steel); text-decoration: none; margin: 0 8px; }
.foot a:hover { color: var(--ink); text-decoration: underline; }

.hide { display: none !important; }
#loading { text-align: center; color: var(--steel); padding: 34px 0; }

@media (max-width: 560px) {
  .card { padding: 28px 22px; border-radius: 18px; }
  h1 { font-size: 22px; }
  .invite-grid { grid-template-columns: 1fr; }
  .member { flex-direction: column; align-items: flex-start; }
  .member .who { width: 100%; }
  .member .act { justify-content: flex-start; }
  .top { padding: 12px 16px; }
  .topnav { gap: 14px; }
}
