:root {
  /* Palette sampled directly from the LTDA logo */
  --ltda-primary: #2d3691;       /* logo ring / handshake-badge blue */
  --ltda-primary-dark: #1f2568;  /* deeper shade for hover/active states */
  --ltda-accent: #f2b705;        /* road-marking gold */
  --ltda-green: #0e9141;         /* laurel-wreath green */
  --ltda-sky: #5b9bd5;           /* "TOGETHER WE CAN" light blue */
  --ltda-bg: #f5f6f8;
  --ltda-text: #23272b;
  --ltda-topbar-bg: #fff;
  --ltda-topbar-border: #e6e8eb;
  --ltda-chip-hover: #f0f1f3;
  --ltda-passport-bg: #f0f1f3;
  --ltda-passport-border: #c7ccd1;
  --ltda-thead-bg: #eef1ee;
  --ltda-header-h: 70px; /* sidebar logo block height */
}
[data-bs-theme="dark"] {
  --ltda-bg: #14181b;
  --ltda-text: #e7e9ea;
  --ltda-topbar-bg: #1b2023;
  --ltda-topbar-border: #2b3236;
  --ltda-chip-hover: #262c30;
  --ltda-passport-bg: #23292c;
  --ltda-passport-border: #3a4247;
  --ltda-thead-bg: #21272a;
}

* {
  font-family: 'Montserrat', 'Segoe UI', Tahoma, Verdana, sans-serif;
}

body {
  background-color: var(--ltda-bg);
  font-family: 'Montserrat', 'Segoe UI', Tahoma, Verdana, sans-serif;
  color: var(--ltda-text);
}

h1, h2, h3, h4, h5, h6, .card-header, .btn {
  font-weight: 600;
  letter-spacing: 0.2px;
}

.ltda-navbar {
  background-color: var(--ltda-primary);
  position: sticky;
  top: 0;
  z-index: 1030;
}
@media (max-width: 991.98px) {
  .ltda-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1040;
  }
  /* Reserve the space the fixed navbar no longer takes up in normal flow */
  .ltda-layout,
  body > .container.my-4 {
    padding-top: 56px;
  }
}
.navbar-brand {
  color: #f5f6f8 !important;
  font-weight: 700;
  letter-spacing: 0.3px;
}

/* Sidebar logo block (desktop): fixed height (see --ltda-header-h above). */
.ltda-sidebar .navbar-brand {
  height: var(--ltda-header-h);
  box-sizing: border-box;
}

/* Logo mark: rounded white plate behind the badge so it reads cleanly on
   the dark blue navbar/sidebar, in any theme. */
.navbar-brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: #fff;
  padding: 3px;
  object-fit: contain;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

/* ---- Landing page hero: truck + owner illustration with a color overlay ---- */
.ltda-hero {
  position: relative;
  overflow: hidden;
  min-height: 420px;
  display: flex;
  align-items: center;
  padding: 3rem;
  background-image: url('../img/hero-truck.svg');
  background-size: cover;
  background-position: center;
  color: #fff;
}
.ltda-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, rgba(31,37,104,0.92) 0%, rgba(45,54,145,0.78) 40%, rgba(45,54,145,0.35) 75%, rgba(45,54,145,0.15) 100%);
}
.ltda-hero-content {
  position: relative;
  z-index: 1;
  max-width: 620px;
}
.ltda-hero-eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #14181b;
  background: var(--ltda-accent);
  padding: 0.3rem 0.8rem;
  border-radius: 30px;
  margin-bottom: 1rem;
}
.ltda-hero-content h1,
.ltda-hero-content p {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
@media (max-width: 767.98px) {
  .ltda-hero { min-height: 340px; padding: 2rem; }
}

/* Index page footer: same color treatment as the top navbar */
footer.ltda-index-footer {
  background: var(--ltda-primary);
  border-top: none;
  color: #f5f6f8 !important;
}
.ltda-index-footer a {
  color: #fff;
}

.ltda-hero-phone {
  color: #fff;
  font-weight: 600;
}
.ltda-hero-phone a {
  color: #fff;
  text-decoration: none;
}
.ltda-hero-phone a:hover {
  text-decoration: underline;
}

/* ---- Sticky footer (both guest and logged-in layouts) ---- */
html, body {
  height: 100%;
}
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
footer {
  margin-top: auto;
}

/* ---- Vertical sidebar layout ---- */
.ltda-layout {
  display: flex;
  align-items: stretch;
  min-height: 100vh;
  flex: 1 1 auto;
}
.ltda-sidebar {
  background-color: var(--ltda-primary) !important;
  width: 250px;
  flex: 0 0 250px;
  box-shadow: 2px 0 12px rgba(0,0,0,0.12);
}
.ltda-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.ltda-main .container-fluid.my-4 {
  flex: 1 1 auto;
}
@media (min-width: 992px) {
  .ltda-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1035;
  }
  .ltda-main {
    margin-left: 250px;
  }
}

/* Guest (logged-out) layout also needs to grow so the footer sticks to the bottom */
body > .container.my-4 {
  flex: 1 1 auto;
}

/* ---- Top bar (page title + user menu) shown above content on logged-in pages ---- */
.ltda-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  height: calc(var(--ltda-header-h) * 1.3); /* 30% taller than the sidebar logo block */
  box-sizing: border-box;
  padding: 0 1.25rem;
  background: var(--ltda-topbar-bg);
  border-bottom: 1px solid var(--ltda-topbar-border);
  position: sticky;
  top: 0;
  z-index: 1020;
}
@media (max-width: 991.98px) {
  /* Docks just below the mobile navbar instead of underneath it */
  .ltda-topbar { top: 56px; }
}
.ltda-topbar .user-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: none;
  background: transparent;
  padding: 0.3rem 0.6rem;
  border-radius: 30px;
  color: var(--ltda-text);
}
.ltda-topbar .user-chip:hover {
  background: var(--ltda-chip-hover);
}
.ltda-topbar .user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ltda-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex: none;
}
.ltda-topbar .user-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ltda-text);
}
.theme-toggle-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--ltda-topbar-border);
  background: transparent;
  color: var(--ltda-text);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.theme-toggle-btn:hover {
  background: var(--ltda-chip-hover);
}

.ltda-nav .nav-link {
  color: #f5f6f8 !important;
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  font-weight: 500;
  font-size: 0.94rem;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.ltda-nav .nav-link:hover {
  background-color: rgba(255,255,255,0.1);
  color: var(--ltda-accent) !important;
  transform: translateX(2px);
}
.ltda-nav .nav-link.active {
  background-color: var(--ltda-accent);
  color: #222 !important;
}

/* ---- Cards & general components ---- */
.card {
  border: none;
  border-radius: 14px;
  box-shadow: 0 2px 14px rgba(0,0,0,0.07);
  transition: box-shadow 0.15s ease;
}
.card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
.card-header {
  background-color: var(--ltda-primary);
  color: #fff;
  border-radius: 14px 14px 0 0 !important;
  font-weight: 600;
  padding: 0.9rem 1.25rem;
}

.btn {
  border-radius: 8px;
  transition: transform 0.08s ease, box-shadow 0.15s ease;
}
.btn:active {
  transform: scale(0.98);
}
.btn-ltda {
  background-color: var(--ltda-primary);
  color: #fff;
  border: none;
}
.btn-ltda:hover {
  background-color: var(--ltda-primary-dark);
  color: #fff;
}
.btn-accent {
  background-color: var(--ltda-accent);
  color: #222;
  border: none;
}
.btn-accent:hover {
  color: #222;
  filter: brightness(0.95);
}

.stat-card h2 {
  font-weight: 700;
  color: var(--ltda-primary);
}

/* ---- Clickable dashboard cards (stat cards + feature cards) ---- */
a.dash-card {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
a.dash-card:hover,
a.dash-card:focus {
  transform: translateY(-3px);
  box-shadow: 0 8px 26px rgba(0,0,0,0.14);
  color: inherit;
  text-decoration: none;
}
a.dash-card .dash-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  color: var(--ltda-primary);
}
a.dash-card:hover .dash-card-cta {
  gap: 0.55rem;
}
a.dash-card .dash-card-cta i {
  transition: transform 0.15s ease;
}

.table thead th {
  background-color: var(--ltda-thead-bg);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #495057;
  border-bottom: 2px solid #dee2e6;
}

.auth-wrapper {
  max-width: 520px;
  margin: 40px auto;
}
.auth-wrapper-wide {
  max-width: 760px;
}

/* ---- Membership badge / ID card ---- */
.member-badge {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(0,0,0,0.18);
  font-family: 'Montserrat', sans-serif;
  background: #fff;
}
.member-badge-header {
  background: linear-gradient(135deg, var(--ltda-primary) 0%, var(--ltda-primary-dark) 100%);
  color: #fff;
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.member-badge-header .badge-title {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.4px;
}
.member-badge-body {
  padding: 1.5rem 1.25rem;
  text-align: center;
}
.member-badge-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--ltda-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  margin: 0 auto 0.9rem auto;
  border: 3px solid var(--ltda-accent);
}
.member-badge-name {
  font-weight: 700;
  font-size: 1.15rem;
  margin-bottom: 0.15rem;
}
.member-badge-code {
  display: inline-block;
  background: var(--ltda-accent);
  color: #222;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.9rem;
  margin: 0.4rem 0 1rem 0;
}
.member-badge-details {
  text-align: left;
  font-size: 0.88rem;
  border-top: 1px dashed #ccc;
  padding-top: 0.9rem;
}
.member-badge-details div {
  display: flex;
  justify-content: space-between;
  padding: 0.2rem 0;
}
.member-badge-details span:first-child {
  color: #777;
}
.member-badge-details span:last-child {
  font-weight: 600;
}
.member-badge-footer {
  background: #f5f6f8;
  text-align: center;
  padding: 0.6rem;
  font-size: 0.7rem;
  color: #888;
  letter-spacing: 0.5px;
}

/* ---- Passport photo preview (registration) ---- */
.passport-preview-wrap {
  position: relative;
  display: inline-block;
  cursor: pointer;
}
.passport-preview {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: var(--ltda-passport-bg);
  border: 3px solid var(--ltda-primary);
  overflow: hidden;
  flex: none;
  font-size: 2.4rem;
  transition: border-color 0.15s ease;
}
.passport-preview-wrap:hover .passport-preview {
  border-color: var(--ltda-accent);
}
.passport-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.passport-preview-edit {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ltda-accent);
  color: #222;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--ltda-topbar-bg);
  font-size: 0.9rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.22);
}
.doc-status {
  font-size: 0.85rem;
  min-height: 1.2em;
}

/* ---- Section headers used to group long forms (e.g. registration) ---- */
.form-section-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--ltda-primary);
  margin: 2rem 0 1.1rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--ltda-topbar-border);
}
.form-section-title:first-of-type {
  margin-top: 0;
}

/* ---- Document/ID layout verification badges (profile uploads) ---- */
.doc-verify-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  margin-top: 0.35rem;
}
.doc-verify-badge.ok { color: #146c43; }
.doc-verify-badge.warn { color: #b02a37; }
.doc-verify-badge.pending { color: #6c757d; }
.doc-verify-warning-list {
  font-size: 0.8rem;
  margin: 0.25rem 0 0 0;
  padding-left: 1.1rem;
  color: #b02a37;
}

/* ---- Print styles: used for the membership list and badge ---- */
@media print {
  .no-print, .no-print * {
    display: none !important;
  }
  .ltda-layout, .ltda-main {
    display: block !important;
  }
  .card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }
  body {
    background: #fff !important;
  }
}
