/* My City Courier responsive/PWA shell pass ---------------------------------
   This file deliberately sits beside the legacy mercury.css instead of replacing
   it. The aim is to make the existing table-based app usable on phones while
   leaving the proven business logic alone. */

:root {
  --mcc-blue: #084a9c;
  --mcc-dark: #111827;
  --mcc-gold: #ffc66f;
  --mcc-panel: #f8f0c6;
  --mcc-muted: #d8d0c8;
  --mcc-border: #d1d5db;
  --mcc-radius: 14px;
  --mcc-shadow: 0 12px 30px rgba(15, 23, 42, .10);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-width: 0;
  line-height: 1.45;
  overflow-x: hidden;
}

img, video, iframe { max-width: 100%; height: auto; }

input, select, textarea, button {
  max-width: 100%;
  font: inherit;
}

input[type="text"], input[type="password"], input[type="email"], input[type="tel"],
input[type="number"], input[type="date"], select, textarea {
  min-height: 2.5rem;
  padding: .55rem .65rem;
  border: 1px solid var(--mcc-border);
  border-radius: 8px;
  background: #fff;
}

input[type="submit"], input[type="button"], input[type="reset"], button, .btn {
  min-height: 2.5rem;
  padding: .55rem .9rem;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
}

/* Public navigation -------------------------------------------------------- */
.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .15rem;
  width: 100%;
  background: var(--mcc-dark);
  box-shadow: 0 4px 18px rgba(0,0,0,.18);
}

.topnav a {
  display: block;
  padding: .85rem 1rem;
  color: #fff !important;
  text-decoration: none;
}

.topnav a:hover, .topnav a.active { background: var(--mcc-blue); }
.topnav .icon { display: none; margin-left: auto; }

/* App shell header for admin/driver screens. Injected by mcc-app.js. */
.mcc-shellbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 60;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .7rem 1rem;
  background: var(--mcc-dark);
  color: #fff;
  box-shadow: 0 4px 18px rgba(0,0,0,.18);
}
.mcc-shellbar__title { font-weight: 700; }
.mcc-shellbar__install {
  display: none;
  background: var(--mcc-gold);
  color: #111;
}

/* Legacy tables: keep them as tables on desktop but stop them breaking mobile. */
.mcc-table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: .75rem 0;
}
.mcc-table-scroll > table { margin-top: 0; margin-bottom: 0; }

table {
  max-width: 100%;
  border-collapse: collapse;
}

table.index, table.head, table.navbar {
  width: min(100%, 1100px) !important;
}

th, td { overflow-wrap: anywhere; }
th { vertical-align: middle; }
td { vertical-align: top; }

/* Make option boxes feel like cards without changing PHP markup. */
table.index {
  border-radius: var(--mcc-radius);
  overflow: hidden;
  box-shadow: var(--mcc-shadow);
  margin: 1rem auto;
}

th.option, th.index, h1 {
  font-weight: 700;
}

td.option, td.index {
  line-height: 1.5;
}

/* Public hero/search sections. */
.hero, .pubhead {
  min-height: 70vh;
  height: auto;
  padding: clamp(4rem, 10vw, 8rem) 1rem;
  background-attachment: scroll;
}
.hero-inner {
  width: min(92vw, 760px);
  margin: 0 auto;
  text-align: center;
}
.hero-inner h1 {
  display: inline-block;
  font-size: clamp(2rem, 7vw, 4.5rem);
  line-height: 1.05;
}
.hero-inner h2 {
  margin-left: 0;
  font-size: clamp(1.1rem, 3vw, 1.8rem);
}
.search {
  width: min(92vw, 720px);
  margin: 2rem auto;
  padding: 1rem;
}
.search > div {
  padding: 1rem;
  border-radius: var(--mcc-radius);
  box-shadow: var(--mcc-shadow);
  background: #fff;
}

/* Driver licence/profile images. */
.licphoto {
  max-width: 100%;
  min-height: 160px;
}
.licphoto img,
img[src*="uploads"], img[src*="drivers/img"], img[src*="img/"] {
  object-fit: contain;
}

/* Footer links. */
.mcc-footer, .center:last-of-type {
  max-width: 1100px;
  margin: 1.5rem auto;
  padding: 0 1rem;
}

@media (max-width: 760px) {
  body { font-size: 16px; }

  .topnav a:not(:first-child) { display: none; }
  .topnav a.icon { display: block; }
  .topnav.responsive { display: block; }
  .topnav.responsive a { display: block; text-align: left; }
  .topnav.responsive a.icon { position: absolute; right: 0; top: 0; }

  .mcc-admin .mcc-shellbar,
  .mcc-driver .mcc-shellbar { display: flex; }

  h1, h2 { margin-left: 0; font-size: 1.2rem; }
  div.indent, div.double { margin-left: 1rem; margin-right: 1rem; }
  .payment { width: 94%; }

  table.index, table.head, table.navbar,
  table[width="80%"], table[width="90%"], table[width="100%"] {
    width: 100% !important;
  }

  th, td { padding: .55rem; }
  td.right, td.left, td.center,
  td.rightalt, td.leftalt, td.centeralt,
  td.option, td.index {
    text-align: left;
  }

  /* Forms were built with two-column tables. On phones, stack simple label/value rows. */
  form table tr { display: block; margin-bottom: .45rem; }
  form table th, form table td { display: block; width: 100% !important; }
  form table th.submit { text-align: left; }
  form input[type="text"], form input[type="password"], form input[type="email"],
  form input[type="tel"], form select, form textarea {
    width: 100% !important;
  }

  .hero, .pubhead { min-height: 62vh; padding-top: 5rem; }
  .search { width: 100%; padding: .5rem; }
}

@media (max-width: 520px) {
  th, td { font-size: .95rem; }
  input[type="submit"], input[type="button"], input[type="reset"], button, .btn {
    width: 100%;
    margin: .25rem 0;
  }
  .topnav a { padding: .8rem .9rem; }
}
