/* ============================================================
   FMU Competitor Licensing — Design System
   A federation-official feel: navy authority, teal action,
   amber checkpoints — built around the idea of a rally route,
   since every application literally travels through checkpoints.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --navy: #0B2545;
  --navy-deep: #071A32;
  --teal: #0F6B67;
  --teal-deep: #0B5450;
  --amber: #E8A33D;
  --amber-deep: #C9822A;
  --cream: #F7F5F0;
  --card: #FFFFFF;
  --charcoal: #1C1C1E;
  --muted: #6B6A66;
  --line: #E1DCCF;
  --green: #2E7D46;
  --green-bg: #E7F3EA;
  --red: #B23A1A;
  --red-bg: #FBEAE3;
  --amber-bg: #FCF1DD;
  --radius: 10px;
  --font-display: 'Oswald', sans-serif;
  --font-body: 'Inter', sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--charcoal);
  line-height: 1.5;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0 0 0.4em;
  color: var(--navy);
}

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

p { margin: 0 0 1em; }

/* ---------- Auth / login screens ---------- */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}
@media (max-width: 860px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { min-height: 0; justify-content: flex-start; gap: 28px; }
}
.auth-brand {
  background: linear-gradient(160deg, var(--navy-deep) 0%, var(--navy) 65%, #123159 100%);
  color: #fff;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.auth-brand .eyebrow {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--amber);
}
.auth-brand h1 {
  color: #fff;
  font-size: 34px;
  max-width: 420px;
  margin-top: 12px;
}
.auth-brand .tagline { color: #C9D3E0; max-width: 380px; }

.route {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 40px;
}
.route .node {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 2px solid var(--amber);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 13px;
  flex-shrink: 0;
}
.route .seg { flex: 1; height: 2px; background: repeating-linear-gradient(90deg, var(--amber) 0 6px, transparent 6px 11px); min-width: 16px; }
.route-labels { display: flex; justify-content: space-between; margin-top: 8px; font-size: 11px; color: #9FB0C6; }

.auth-card-wrap {
  display: flex; align-items: center; justify-content: center;
  padding: 32px;
  background: var(--cream);
}
.auth-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 1px 3px rgba(11,37,69,0.06);
}
.auth-card h2 { margin-bottom: 4px; }
.auth-card .sub { color: var(--muted); font-size: 14px; margin-bottom: 24px; }

/* ---------- Forms ---------- */
label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 6px; color: var(--navy); }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date],
input[type=number], select, textarea, input[type=file] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 14px;
  background: #fff;
  color: var(--charcoal);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
  border-color: var(--teal);
}
textarea { resize: vertical; min-height: 80px; }
.field-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.field-error { font-size: 12px; color: var(--red); margin-top: 4px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 8px;
  border: none;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-deep); text-decoration: none; }
.btn-block { width: 100%; }
.btn-outline { background: transparent; border: 1px solid var(--navy); color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: #fff; text-decoration: none; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #8E2E14; text-decoration: none;}
.btn-amber { background: var(--amber); color: var(--navy-deep); }
.btn-amber:hover { background: var(--amber-deep); text-decoration: none; }
.btn-sm { padding: 7px 14px; font-size: 13px; }

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 18px;
}
.alert-error { background: var(--red-bg); color: #7A2711; border: 1px solid #E9C3B2; }
.alert-success { background: var(--green-bg); color: #1E5631; border: 1px solid #BEE0C6; }
.alert-info { background: #E7EEF6; color: var(--navy); border: 1px solid #C9D9EC; }

/* ---------- App shell (dashboards) ---------- */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
@media (max-width: 780px) { .shell { grid-template-columns: 1fr; } .sidebar { display:none; } }

.sidebar {
  background: var(--navy-deep);
  color: #fff;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
}
.sidebar .brand { font-family: var(--font-display); font-size: 16px; margin-bottom: 4px; }
.sidebar .brand-sub { font-size: 11px; color: var(--amber); letter-spacing: 0.08em; margin-bottom: 30px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar nav a {
  color: #C9D3E0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
}
.sidebar nav a:hover { background: rgba(255,255,255,0.06); text-decoration: none; }
.sidebar nav a.active { background: var(--teal); color: #fff; }
.sidebar .who { border-top: 1px solid rgba(255,255,255,0.12); padding-top: 16px; font-size: 13px; }
.sidebar .who .name { font-weight: 600; }
.sidebar .who .role { color: var(--amber); font-size: 11px; letter-spacing: 0.06em; }
.sidebar .logout { margin-top: 10px; display: inline-block; font-size: 13px; color: #C9D3E0; }

.main { padding: 32px 40px; max-width: 1100px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.topbar .page-eyebrow { font-size: 12px; letter-spacing: 0.08em; color: var(--muted); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 28px; }
.stat-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.stat-card .num { font-family: var(--font-display); font-size: 28px; color: var(--navy); }
.stat-card .label { font-size: 12px; color: var(--muted); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.card h3 { margin-bottom: 14px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11px; letter-spacing: 0.05em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
.table-empty { padding: 30px; text-align: center; color: var(--muted); }

.badge { display: inline-block; padding: 4px 10px; border-radius: 100px; font-size: 12px; font-weight: 600; }
.badge-pending { background: var(--amber-bg); color: var(--amber-deep); }
.badge-review  { background: #E7EEF6; color: var(--navy); }
.badge-approved{ background: var(--green-bg); color: var(--green); }
.badge-changes { background: var(--amber-bg); color: #8A5A17; }
.badge-rejected{ background: var(--red-bg); color: var(--red); }

/* ---------- Rally stage tracker ---------- */
.tracker { display: flex; align-items: flex-start; margin: 10px 0 26px; }
.tracker .stop { flex: 1; text-align: center; position: relative; }
.tracker .dot {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 8px;
  font-family: var(--font-display);
  font-size: 14px;
  border: 2px solid var(--line);
  background: #fff;
  color: var(--muted);
  position: relative; z-index: 1;
}
.tracker .stop.done .dot { background: var(--green); border-color: var(--green); color: #fff; }
.tracker .stop.current .dot { background: var(--navy); border-color: var(--navy); color: #fff; }
.tracker .stop.changes .dot { background: var(--amber); border-color: var(--amber); color: var(--navy-deep); }
.tracker .stop.rejected .dot { background: var(--red); border-color: var(--red); color: #fff; }
.tracker .stop::before {
  content: ''; position: absolute; top: 17px; left: -50%; width: 100%; height: 2px;
  background: var(--line); z-index: 0;
}
.tracker .stop:first-child::before { display: none; }
.tracker .stop.done::before, .tracker .stop.current::before { background: var(--teal); }
.tracker .label { font-size: 12px; font-weight: 600; color: var(--navy); }
.tracker .sub { font-size: 11px; color: var(--muted); }

/* ---------- License card preview (on-screen, mirrors the PDF: front + back, landscape) ---------- */
.license-card-wrap { display: flex; flex-direction: column; gap: 14px; }
.license-card {
  width: 380px; max-width: 100%;
  aspect-ratio: 85.6 / 54;
  border-radius: 6px;
  background: #fff;
  border: 3px solid #1e1e1e;
  color: var(--charcoal);
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(11,37,69,0.2);
  display: flex;
  flex-direction: column;
}
.license-card .lc-header {
  background: #0f0f0f; color: #fff;
  padding: 8px 34px;
  text-align: center;
  position: relative;
}
.license-card .lc-badge {
  position: absolute; top: 6px; width: 30px; height: 30px; border-radius: 50%;
  background: #fff; color: #0f0f0f; border: 1px solid #0f0f0f;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 8px; font-weight: 700;
}
.license-card .lc-badge.left { left: 6px; }
.license-card .lc-badge.right { right: 6px; }
.license-card .lc-fed { font-family: var(--font-display); font-size: 12px; line-height: 1.2; }
.license-card .lc-banner {
  background: #c6a15b; color: #1e1405;
  text-align: center; font-family: var(--font-display); font-weight: 700;
  font-size: 11px; padding: 5px; border-top: 1px solid #5a4a1e; border-bottom: 1px solid #5a4a1e;
}
.license-card .lc-body { display: flex; gap: 10px; padding: 8px 10px; flex: 1; }
.license-card .lc-photo { width: 70px; height: 82px; flex-shrink: 0; background: #ebebeb; border: 1px solid #1e1e1e; overflow: hidden; }
.license-card .lc-photo img { width: 100%; height: 100%; object-fit: cover; }
.license-card .lc-fields { flex: 1; }
.license-card .lc-fields .lbl { color: var(--muted); font-size: 8px; margin-top: 4px; }
.license-card .lc-fields .lbl:first-child { margin-top: 0; }
.license-card .lc-fields .val { font-weight: 700; color: #111; font-size: 10px; }
.license-card .lc-datesrow { display: flex; gap: 10px; margin-top: 4px; }
.license-card .lc-datesrow > div { flex: 1; }
.license-card .lc-qr { width: 62px; flex-shrink: 0; text-align: center; }
.license-card .lc-qr img { width: 62px; height: 62px; }
.license-card .lc-scan { font-size: 6.5px; color: var(--muted); margin-top: 2px; }
.license-card .lc-flagbar { display: flex; height: 8px; }
.license-card .lc-flagbar > div { flex: 1; }
.license-card.lc-back .lc-header { background: #0f0f0f; }
.license-card.lc-back .lc-back-body { padding: 10px 14px; font-size: 8.5px; color: #222; line-height: 1.5; flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.license-card.lc-back .lc-sig-row { display: flex; justify-content: space-between; gap: 20px; font-size: 7.5px; color: var(--muted); }
.license-card.lc-back .lc-sig-row div { flex: 1; border-top: 1px solid #999; padding-top: 3px; }

.doc-link { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 13px; margin-right: 10px; margin-top: 6px;}

.checkerbar { height: 6px; background: repeating-linear-gradient(90deg, var(--navy) 0 10px, var(--amber) 10px 20px); border-radius: 3px; margin: 24px 0; opacity: 0.5; }

/* ---------- Home landing page: specimen licence card + checkpoint strip ---------- */
.home-specimen {
  position: relative;
  display: inline-block;
  transform: rotate(-3deg);
  margin-top: 10px;
}
.home-specimen-wrap { text-align: center; }
.home-specimen .license-card {
  width: 340px;
  border-color: rgba(255,255,255,0.25);
  box-shadow: 0 24px 50px rgba(0,0,0,0.45);
}
.home-specimen::after {
  content: 'SPECIMEN';
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-3deg);
  font-family: var(--font-display);
  font-size: 30px;
  letter-spacing: 0.08em;
  color: rgba(15,15,15,0.16);
  pointer-events: none;
  white-space: nowrap;
}
.home-checkpoints {
  display: flex;
  justify-content: space-between;
  max-width: 380px;
  margin: 34px auto 0;
}
.home-checkpoints .stop {
  text-align: center;
  flex: 1;
  position: relative;
}
.home-checkpoints .stop .dot {
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1.5px solid var(--amber);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 11px;
  margin: 0 auto 6px;
  position: relative; z-index: 1;
}
.home-checkpoints .stop::before {
  content: '';
  position: absolute; top: 11px; left: -50%; width: 100%; height: 1.5px;
  background: repeating-linear-gradient(90deg, var(--amber) 0 4px, transparent 4px 8px);
}
.home-checkpoints .stop:first-child::before { display: none; }
.home-checkpoints .label { font-size: 11px; color: #C9D3E0; }

.home-options { display: flex; flex-direction: column; gap: 20px; }
.home-option-group .group-label { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.home-option-group .btn { margin-bottom: 6px; }
.home-option-group .group-hint { font-size: 12px; color: var(--muted); margin-top: 2px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 700px) { .grid-2 { grid-template-columns: 1fr; } }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 10px 0 10px 20px; border-left: 2px solid var(--line); position: relative; font-size: 13px; }
.timeline li::before { content:''; position:absolute; left:-6px; top:14px; width:10px; height:10px; border-radius:50%; background: var(--teal); }
.timeline li .when { color: var(--muted); font-size: 11px; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state h3 { color: var(--navy); }
