/* FortiCompany brand: #d04328 (red-orange), #f1881f (orange), #7f7276 (grey),
   black and white. White text only on the red-orange (4.6:1); --muted is a
   darker tint of the brand grey so small text stays readable. */
:root {
  --brand: #d04328;
  --brand-hover: #b3361e;
  --brand-accent: #f1881f;
  --brand-grey: #7f7276;
  --bg: #faf7f6;
  --panel: #ffffff;
  --border: #e6dedf;
  --text: #141012;
  --muted: #5f5458;
  --danger: #b42318;
  --success-bg: #e3f4e8;
  --success-text: #14602e;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: var(--brand); }
a:hover { color: var(--brand-hover); }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  row-gap: 8px;
  padding: 10px 24px;
  background: var(--panel);
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(90deg, var(--brand), var(--brand-accent)) 1;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { color: var(--text); }
.brand-logo { width: 36px; height: 36px; flex: none; display: block; }
.brand-name { font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.brand .tag {
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 10px;
}

.userbox {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 13px;
}
.user-name { font-weight: 600; }
.inline-form { margin: 0; display: inline-flex; }

main { padding: 24px; max-width: 800px; margin: 0 auto; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px 28px;
}
.card.narrow { max-width: 380px; margin: 48px auto; }
.login-logo { display: block; margin: 0 auto 12px; }
.card.narrow h1 { text-align: center; }

h1 { margin-top: 0; font-size: 22px; letter-spacing: -0.01em; }

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-top: 12px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); font-size: 14px; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; white-space: nowrap; }
td.nowrap { white-space: nowrap; }
tfoot td { font-weight: 700; border-top: 2px solid var(--text); border-bottom: none; }

main form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; }
input {
  font-size: 16px; /* >=16px stops iOS Safari zooming in on focus */
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
}
input:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; border-color: var(--brand); }

button, .btn-primary, .btn-secondary {
  font-family: inherit;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: 6px;
  border: 1px solid var(--brand);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button, .btn-primary { background: var(--brand); color: #fff; }
button:hover, .btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: #fff; }
.btn-secondary { background: #fff; color: var(--brand); }
.btn-secondary:hover { background: #fdf1ee; color: var(--brand-hover); }
button:focus-visible, .btn-secondary:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

.btn-ghost {
  background: #fff;
  color: var(--text);
  border-color: var(--border);
  padding: 6px 12px;
  font-size: 13px;
}
.btn-ghost:hover { background: #fff; color: var(--text); border-color: var(--brand-grey); }

.actions { margin-top: 20px; }

.hint { font-size: 13px; color: var(--muted); }
.error { color: var(--danger); }
.ok { color: var(--success-text); font-weight: 600; }
code { background: #f1ecec; padding: 1px 5px; border-radius: 3px; font-size: 12px; overflow-wrap: anywhere; }

.notice {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  border: 1px solid transparent;
}
.notice-ok { background: var(--success-bg); color: var(--success-text); border-color: #bfe3ca; }
.notice-warn { background: #fff1e0; color: #7a3f00; border-color: #f6cf9f; }

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 10px;
  text-transform: capitalize;
}
.badge-pending { background: #fff1e0; color: #7a3f00; }
.badge-awaiting_signature { background: #ece7e8; color: #4a3f43; }
.badge-signed { background: var(--success-bg); color: var(--success-text); }

@media (max-width: 600px) {
  .topbar { padding: 8px 12px; }
  .brand-logo { width: 30px; height: 30px; }
  .brand-name { font-size: 16px; }
  main { padding: 12px; }
  button, .btn-primary, .btn-secondary { min-height: 40px; }
  .card { padding: 18px 16px; }
  .card.narrow { margin: 24px auto; }
}
