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

:root {
  --ink: #1c1c1a;
  --canvas: #eae3cd;       /* aged khaki/canvas paper */
  --canvas-dark: #dcd3b4;
  --asphalt: #171b1f;      /* garage-dark background */
  --asphalt-2: #20262c;
  --safety-orange: #e8622c;
  --safety-orange-dark: #c94f20;
  --forest: #2f4538;
  --forest-light: #3e5c4a;
  --amber: #d99a1f;
  --danger: #c23b3b;
  --ok: #3e7a52;
  --line: rgba(28,28,26,0.12);
  --radius: 14px;
  --shadow: 0 6px 20px rgba(0,0,0,0.25);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--asphalt);
  color: var(--canvas);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
}

h1, h2, h3, .display {
  font-family: 'Oswald', sans-serif;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 0;
}

.mono {
  font-family: 'JetBrains Mono', monospace;
}

a { color: inherit; }

button {
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  border: none;
  border-radius: 999px;
  padding: 12px 22px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.12s ease, background 0.12s ease;
}
button:active { transform: scale(0.97); }

.btn-primary {
  background: var(--safety-orange);
  color: var(--asphalt);
}
.btn-primary:hover { background: var(--safety-orange-dark); }

.btn-ghost {
  background: transparent;
  color: var(--canvas);
  border: 1.5px solid rgba(234,227,205,0.35);
}
.btn-ghost:hover { border-color: var(--canvas); }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1.5px solid rgba(194,59,59,0.5);
  padding: 8px 16px;
  font-size: 0.85rem;
}

input, select {
  font-family: 'Inter', sans-serif;
  background: rgba(234,227,205,0.06);
  border: 1.5px solid rgba(234,227,205,0.2);
  color: var(--canvas);
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 0.95rem;
  width: 100%;
}
input::placeholder { color: rgba(234,227,205,0.4); }
input:focus, select:focus {
  outline: none;
  border-color: var(--safety-orange);
}
label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(234,227,205,0.6);
  display: block;
  margin-bottom: 6px;
}
.field { margin-bottom: 16px; }

/* ---------- Layout ---------- */
.wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 18px 80px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 18px;
  border-bottom: 1px solid rgba(234,227,205,0.1);
  position: sticky;
  top: 0;
  background: var(--asphalt);
  z-index: 20;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 700;
}
.logo .stamp-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--safety-orange);
  box-shadow: 0 0 0 3px rgba(232,98,44,0.25);
}

/* ---------- Auth screen ---------- */
.auth-card {
  max-width: 400px;
  margin: 10vh auto;
  background: var(--asphalt-2);
  border-radius: var(--radius);
  padding: 36px 30px;
  box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 1.6rem; margin-bottom: 4px; }
.auth-sub {
  color: rgba(234,227,205,0.55);
  font-size: 0.9rem;
  margin-bottom: 28px;
}
.auth-toggle {
  text-align: center;
  margin-top: 18px;
  font-size: 0.88rem;
  color: rgba(234,227,205,0.6);
}
.auth-toggle button {
  background: none; padding: 0; margin-left: 4px;
  color: var(--safety-orange); font-weight: 600; border-radius: 0;
}
.error-msg {
  background: rgba(194,59,59,0.12);
  border: 1px solid rgba(194,59,59,0.4);
  color: #e8a3a3;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 16px;
}
.info-msg {
  background: rgba(62,122,82,0.15);
  border: 1px solid rgba(62,122,82,0.4);
  color: #a8d9b8;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 16px;
}

/* ---------- Dashboard ---------- */
.section-title {
  font-size: 1rem;
  color: rgba(234,227,205,0.5);
  margin: 32px 0 14px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

/* --- The disc card: signature element, modeled on an SA licence disc --- */
.disc-card {
  background: var(--canvas);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.disc-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.disc-ring {
  width: 58px; height: 58px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.disc-ring svg { position: absolute; top: 0; left: 0; transform: rotate(-90deg); }
.disc-ring .days {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 0.78rem;
  z-index: 2;
}
.disc-name { font-size: 1.05rem; font-weight: 600; line-height: 1.2; }
.disc-type {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(28,28,26,0.5);
}
.disc-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.disc-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  padding: 8px 0;
  border-top: 1px dashed var(--line);
}
.disc-row .k { color: rgba(28,28,26,0.55); }
.disc-row .v { font-family: 'JetBrains Mono', monospace; font-weight: 600; }
.tag {
  display: inline-block;
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
  margin-left: 6px;
  vertical-align: middle;
}
.tag-ok { background: rgba(62,122,82,0.15); color: var(--ok); }
.tag-soon { background: rgba(217,154,31,0.18); color: var(--amber); }
.tag-overdue { background: rgba(194,59,59,0.15); color: var(--danger); }

.disc-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
}
.link-btn {
  background: none;
  color: var(--forest);
  padding: 0;
  border-radius: 0;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: underline;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: rgba(234,227,205,0.45);
}
.empty-state .display { font-size: 1.3rem; margin-bottom: 8px; color: rgba(234,227,205,0.7); }

.fab {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--safety-orange);
  color: var(--asphalt);
  font-size: 1.6rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(232,98,44,0.4);
  z-index: 30;
  padding: 0;
}

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: flex-end;
  justify-content: center;
  z-index: 100;
}
.modal {
  background: var(--asphalt-2);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 20px 20px 0 0;
  padding: 28px 24px 40px;
}
@media (min-width: 640px) {
  .modal-backdrop { align-items: center; }
  .modal { border-radius: 20px; }
}
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px;
}
.modal-close {
  background: none; color: rgba(234,227,205,0.6); font-size: 1.4rem;
  padding: 0; border-radius: 0;
}
.subsection {
  border-top: 1px solid rgba(234,227,205,0.1);
  margin-top: 22px;
  padding-top: 18px;
}
.subsection-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.warranty-item {
  background: rgba(234,227,205,0.05);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.warranty-item .wname { font-weight: 600; font-size: 0.9rem; }
.warranty-item .wdate { font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; color: rgba(234,227,205,0.6); }
.remove-x {
  background: none; color: rgba(234,227,205,0.4); padding: 2px 6px; font-size: 1rem; border-radius: 0;
}
.remove-x:hover { color: var(--danger); }

.hidden { display: none !important; }

.loading-dots::after {
  content: '...';
}

footer.small-print {
  text-align: center;
  font-size: 0.75rem;
  color: rgba(234,227,205,0.3);
  padding: 40px 20px 10px;
}
