/* ═══════════════════════════════════════════════
   FLOTIX — Driver App v8
   Wordmark: Alexandria 600.
═══════════════════════════════════════════════ */

@font-face {
  font-family: Alexandria;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/vendor/alexandria-600-latin.woff2") format("woff2");
}

:root {
  --bg:       #f0f1f3;
  --surface:  #ffffff;
  --s2:       #f8f9fb;
  --text:     #111317;
  --text-2:   #42464f;
  --text-3:   #6f7480;
  --line:     #e2e5ea;
  --good:     #16a34a;
  --good-bg:  #dcfce7;
  --good-fg:  #15803d;
  --mid:      #d97706;
  --mid-bg:   #fef3c7;
  --mid-fg:   #92400e;
  --bad:      #dc2626;
  --bad-bg:   #fee2e2;
  --bad-fg:   #991b1b;
  --sh:       0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --sh-lg:    0 12px 40px rgba(0,0,0,.12);
  --r:        14px;
  --r-lg:     20px;
  --r-xl:     24px;

  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  color: var(--text);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
h1, h2 { margin: 0; line-height: 1.2; }
p { margin: 0; }
button, input, textarea { font: inherit; }
:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.hidden { display: none !important; }

/* ── WORDMARK ─────────────────────────────── */
.wordmark {
  margin: 0;
  font-family: Alexandria, system-ui, sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

/* ── LOGIN CARD ───────────────────────────── */
.login-card {
  width: min(400px, calc(100% - 32px));
  margin: max(8vh, 32px) auto 48px;
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 28px 24px 24px;
  box-shadow: var(--sh-lg);
  display: grid;
  gap: 16px;
}

.login-card h1 {
  font-size: 1.75rem;
  font-weight: 760;
  letter-spacing: -0.05em;
}

.lede { color: var(--text-3); font-size: 0.88rem; }

.field {
  display: grid;
  gap: 5px;
}
.field-lbl { font-size: 0.78rem; font-weight: 600; color: var(--text-2); }

input:not([type=file]), textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  padding: 11px 14px;
  background: var(--s2);
  color: var(--text);
  transition: border-color .15s;
}
input:focus, textarea:focus { outline: none; border-color: #111; background: var(--surface); }

.error { color: var(--bad); font-size: 0.84rem; min-height: 1.2em; }

/* Główny przycisk */
button[type=submit],
.btn-main {
  display: block;
  width: 100%;
  padding: 13px 16px;
  background: #111;
  color: #fff;
  border: 0;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: opacity .15s;
  text-align: center;
  text-decoration: none;
}
button[type=submit]:hover, .btn-main:hover { opacity: .85; }
button[type=submit]:disabled { opacity: .4; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  border: 0;
  color: var(--text-3);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 6px 0;
  transition: color .15s;
}
.btn-ghost:hover { color: var(--text); }

.btn-outline {
  display: block;
  width: 100%;
  padding: 12px;
  background: var(--surface);
  color: #111;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s;
  text-align: center;
}
.btn-outline:hover { border-color: #111; }

/* ── APP WRAP ─────────────────────────────── */
.app-wrap {
  width: min(480px, 100%);
  margin: 0 auto;
  padding: 20px 16px 80px;
}

/* ── HEADER ───────────────────────────────── */
.drv-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 4px;
}

.drv-header h1 {
  font-size: 1.5rem;
  font-weight: 760;
  letter-spacing: -0.05em;
}

.drv-sub { color: var(--text-3); font-size: 0.85rem; margin-top: 2px; }

/* ── SCORE CARD ───────────────────────────── */
.score-card {
  background: #0b0b0d;
  color: #fff;
  border-radius: var(--r-xl);
  padding: 22px 20px 20px;
  margin: 16px 0 12px;
}

.score-kicker {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.4);
  margin-bottom: 6px;
}

.score-num {
  font-size: 5.2rem;
  font-weight: 820;
  letter-spacing: -0.08em;
  line-height: 0.88;
  font-variant-numeric: tabular-nums;
  margin-bottom: 8px;
}
.score-num.good { color: #10b981; }
.score-num.mid  { color: #f59e0b; }
.score-num.bad  { color: #f87171; }

.score-hl {
  font-size: 0.85rem;
  color: rgba(255,255,255,.5);
  margin-top: 4px;
}

/* ── TRIPS LIST ───────────────────────────── */
.trips-label {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 18px 0 8px;
}

.ride {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 12px;
  align-items: center;
  padding: 13px 16px;
  background: var(--surface);
  border-radius: var(--r);
  margin-bottom: 6px;
  box-shadow: var(--sh);
}

.ride-title { font-weight: 650; font-size: 0.9rem; }
.ride-meta  { font-size: 0.77rem; color: var(--text-3); }

.ride-score {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.ride-score.good { color: var(--good); }
.ride-score.mid  { color: var(--mid); }
.ride-score.bad  { color: var(--bad); }

.ride-src {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-3);
  margin-left: 4px;
  vertical-align: middle;
}

/* ── CURRENT CAR ──────────────────────────── */
.current-car {
  background: #0b0b0d;
  color: #fff;
  border-radius: var(--r-xl);
  padding: 18px 20px 16px;
  margin-bottom: 10px;
}

.current-car h2 { color: #fff; font-size: 0.88rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 8px; }
.current-car p  { font-size: 0.9rem; color: rgba(255,255,255,.65); margin-bottom: 12px; }

.current-car button[type=button] {
  display: block;
  width: 100%;
  padding: 11px;
  background: #fff;
  color: #111;
  border: 0;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s;
}
.current-car button[type=button]:hover { opacity: .88; }

.current-car .btn-outline {
  margin-bottom: 8px;
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,.28);
}
.current-car .btn-outline:hover { border-color: #fff; }

.wizard-head { margin: 8px 0 16px; }
.step-kicker {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 6px;
}
.wizard-head h1 {
  font-size: 1.7rem;
  font-weight: 760;
  letter-spacing: -0.05em;
  margin-bottom: 6px;
}

.wizard-card {
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 20px 18px 18px;
  box-shadow: var(--sh);
  display: grid;
  gap: 12px;
}
.wizard-card input[type=file] { display: none; }
.wizard-card .btn-ghost.center,
.btn-ghost.center { width: 100%; text-align: center; padding: 10px 0; }

.photo-stage {
  width: 100%;
  min-height: 180px;
  max-height: 280px;
  object-fit: cover;
  border-radius: var(--r);
  background: var(--s2);
  display: block;
}

.done-card h1 { font-size: 1.55rem; }

/* ── TAKE FORM ────────────────────────────── */
.take-form { margin-top: 16px; }
.take-form h2 { font-size: 1.1rem; font-weight: 760; letter-spacing: -0.03em; margin-bottom: 4px; }
.take-lede { color: var(--text-3); font-size: 0.85rem; margin-bottom: 16px; }

.take-form label.field,
.take-form label.field-plain {
  display: grid;
  gap: 5px;
  margin-bottom: 12px;
}

.take-form label.field-plain {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-2);
}

.take-form textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  padding: 10px 14px;
  background: var(--s2);
  color: var(--text);
  resize: vertical;
}
.take-form textarea:focus { outline: none; border-color: #111; background: var(--surface); }

/* ── PHOTO SLOT ───────────────────────────── */
.photo-slot { margin-bottom: 10px; }
.photo-slot input[type=file] { display: none; }

.photo-pick {
  display: block;
  width: 100%;
  padding: 12px;
  background: var(--surface);
  color: var(--text-2);
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s;
}
.photo-pick:hover { border-color: #111; }
.photo-pick.done  { border-color: var(--good); color: var(--good); }

.photo-preview {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: var(--r);
  margin-top: 6px;
  display: block;
  background: var(--line);
}

/* ── SIGNATURE ────────────────────────────── */
.sign-wrap { margin-bottom: 14px; }
.sign-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
.sign-lbl  { font-size: 0.78rem; font-weight: 600; color: var(--text-2); }

canvas.sign {
  width: 100%;
  height: 150px;
  display: block;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  touch-action: none;
}
