/* ============================================================
   TrueCaber — mobile-first stylesheet
   ============================================================ */
:root {
  --bg:      #eef1f5;
  --card:    #ffffff;
  --text:    #16202b;
  --muted:   #6b7684;
  --line:    #e4e8ee;
  --brand:   #0f766e;
  --brand-2: #14b8a6;
  --ink:     #134e4a;
  --star:    #ffb400;
  --ok:      #16a34a;
  --warn:    #d97706;
  --danger:  #e11d48;
  --radius:  16px;
  --shadow:  0 6px 20px rgba(22, 32, 43, .08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}
img, svg { max-width: 100%; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); font-size: .85rem; }
.hidden { display: none !important; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 12px; height: 60px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.15rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-ico {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1rem;
}
.brand-name em { font-style: normal; color: var(--brand-2); }

.nav-toggle {
  margin-left: auto; display: none; flex-direction: column; gap: 4px;
  background: none; border: 0; cursor: pointer; padding: 8px;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: .2s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.site-nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.site-nav a, .nav-user { padding: 8px 12px; border-radius: 10px; font-size: .92rem; font-weight: 600; color: var(--text); }
.site-nav a:hover { background: var(--bg); text-decoration: none; }
.site-nav a.on { color: var(--brand); background: rgba(20,184,166,.12); }
.nav-user { color: var(--muted); font-weight: 500; cursor: default; }

/* ---------- Hero / search ---------- */
.hero {
  margin: 0 -16px 24px;
  padding: 40px 16px 56px;
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(20,184,166,.35), transparent 55%),
    radial-gradient(120% 120% at 0% 100%, rgba(15,118,110,.45), transparent 55%),
    linear-gradient(160deg, #134e4a, #0f766e);
  color: #fff;
  text-align: center;
  border-radius: 0 0 28px 28px;
}
.hero h1 { font-size: 1.7rem; font-weight: 800; margin-bottom: 6px; }
.hero p { opacity: .9; font-size: .95rem; margin-bottom: 24px; }

.search-form { max-width: 520px; margin: 0 auto; }
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border-radius: 999px;
  padding: 6px 6px 6px 18px;
  box-shadow: 0 14px 40px rgba(0,0,0,.25);
}
.search-box .mic, .search-box .go {
  border: 0; background: var(--brand); color: #fff; cursor: pointer;
  width: 44px; height: 44px; border-radius: 50%;
  font-size: 1.1rem; display: flex; align-items: center; justify-content: center;
  flex: none;
}
.search-box .mic { background: var(--brand-2); }
.search-box input {
  flex: 1; border: 0; outline: 0; font-size: 1.05rem; min-width: 0;
  font-weight: 600; letter-spacing: .03em; text-transform: uppercase;
}
.search-hint { color: rgba(255,255,255,.85); font-size: .8rem; margin-top: 12px; }

/* ---------- Cards / sections ---------- */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px;
}
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 22px 4px 12px; }
.section-title h2 { font-size: 1.05rem; }
.section-title a { font-size: .85rem; font-weight: 600; }

/* ---------- Vehicle header card ---------- */
.veh-card { overflow: hidden; padding: 0; }
.veh-top { padding: 20px 18px; background: linear-gradient(135deg, #134e4a, #0f766e); color: #fff; }
.veh-top .reg { font-size: 1.6rem; font-weight: 800; letter-spacing: .05em; }
.veh-top .reg-sub { opacity: .85; font-size: .85rem; margin-top: 2px; }
.veh-score { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.veh-score .big { font-size: 2rem; font-weight: 800; line-height: 1; }
.veh-score .stars { font-size: 1.1rem; }
.veh-score .reviews { font-size: .82rem; opacity: .9; }
.veh-body { padding: 16px 18px; }
.veh-actions { display: flex; gap: 10px; padding: 0 18px 18px; }
.veh-actions .btn { flex: 1; text-align: center; }

/* ---------- Stats row ---------- */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stat { text-align: center; }
.stat .val { font-size: 1.2rem; font-weight: 800; }
.stat .lbl { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

/* ---------- Detail rows ---------- */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.detail { padding: 12px 2px; border-bottom: 1px solid var(--line); }
.detail:nth-child(odd) { padding-right: 10px; }
.detail .k { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.detail .v { font-weight: 600; font-size: .95rem; word-break: break-word; }
.valid { color: var(--ok); font-weight: 700; }
.expired { color: var(--danger); font-weight: 700; }

/* ---------- Tabs ---------- */
.tabs {
  position: sticky; top: 60px; z-index: 40;
  display: flex; gap: 4px; background: var(--card);
  border: 1px solid var(--line); border-radius: 14px; padding: 4px;
  margin-bottom: 16px; box-shadow: var(--shadow);
}
.tabs button {
  flex: 1; border: 0; background: none; padding: 10px; border-radius: 10px;
  font-weight: 700; font-size: .9rem; color: var(--muted); cursor: pointer;
}
.tabs button.on { background: var(--brand); color: #fff; }
.tab-panel { display: none; }
.tab-panel.on { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }

/* ---------- Feedback ---------- */
.fb-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.fb-item:last-child { border-bottom: 0; }
.avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #fff; font-size: 1.05rem;
}
.fb-main { flex: 1; min-width: 0; }
.fb-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fb-name { font-weight: 700; font-size: .95rem; }
.fb-time { font-size: .75rem; color: var(--muted); }
.fb-stars { margin: 4px 0; }
.fb-sub { font-size: .78rem; color: var(--muted); }
.fb-sub b { color: var(--text); }
.fb-comment { font-size: .92rem; margin-top: 6px; }
.avatar { background: var(--brand); }
.avatar.c2 { background: #7c3aed; } .avatar.c3 { background: #ea580c; }
.avatar.c4 { background: #0891b2; } .avatar.c5 { background: #be185d; }

/* ---------- Challans ---------- */
.challan { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; }
.challan .amt { font-weight: 800; font-size: 1.05rem; margin-left: auto; white-space: nowrap; }
.challan .desc { font-size: .88rem; }
.challan .meta { font-size: .76rem; color: var(--muted); }
.total-pending { background: rgba(225,29,72,.08); color: var(--danger); font-weight: 700; padding: 10px 14px; border-radius: 12px; margin-bottom: 14px; }

/* ---------- Badges / buttons ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.badge-ok { background: rgba(22,163,74,.12); color: var(--ok); }
.badge-warn { background: rgba(217,119,6,.12); color: var(--warn); }
.badge-off { background: rgba(107,114,132,.15); color: var(--muted); }

.btn {
  display: inline-block; border: 0; cursor: pointer;
  background: var(--brand); color: #fff; font-weight: 700;
  padding: 12px 20px; border-radius: 12px; font-size: .95rem;
  transition: transform .1s, background .15s;
}
.btn:hover { text-decoration: none; background: var(--ink); }
.btn:active { transform: scale(.98); }
.btn-sm { padding: 8px 14px; font-size: .85rem; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-ghost { background: var(--bg); color: var(--text); }
.btn-danger { background: var(--danger); }
.btn-block { display: block; width: 100%; text-align: center; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Flash ---------- */
.flash { border-radius: 12px; padding: 12px 16px; margin-bottom: 14px; font-weight: 600; font-size: .92rem; }
.flash-success { background: rgba(22,163,74,.12); color: var(--ok); }
.flash-error   { background: rgba(225,29,72,.1);  color: var(--danger); }
.flash-info    { background: rgba(14,165,233,.12); color: #0369a1; }

/* ---------- Forms ---------- */
.form-card { max-width: 460px; margin: 0 auto; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.form-group .hint { font-size: .78rem; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=tel], input[type=email], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 12px 14px; font-size: 1rem; font-family: inherit; outline: none;
  background: #fbfcfe; transition: border .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand-2); background: #fff; }
textarea { resize: vertical; min-height: 90px; }
input[type=text].reg-input { text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.center { text-align: center; }
.auth-links { text-align: center; font-size: .9rem; margin-top: 14px; }

/* Star rating input (click to rate) */
.star-input { display: flex; gap: 6px; }
.star-input button {
  background: none; border: 0; cursor: pointer; font-size: 1.7rem; line-height: 1;
  color: #d8dee7; transition: transform .08s;
}
.star-input button.active { color: var(--star); }
.star-input button:hover { transform: scale(1.15); }

/* display stars bar */
.stars { position: relative; display: inline-block; font-size: 1rem; line-height: 1; letter-spacing: 2px; }
.stars-bg { color: #d8dee7; }
.stars-fill { position: absolute; top: 0; left: 0; overflow: hidden; white-space: nowrap; color: var(--star); }

/* ---------- Empty / not found ---------- */
.empty { text-align: center; padding: 30px 10px; }
.empty .ico { font-size: 2.6rem; margin-bottom: 10px; }
.empty h3 { margin-bottom: 6px; }

/* ---------- Grid (cab list on home) ---------- */
.cab-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.cab-item { display: flex; align-items: center; gap: 14px; padding: 14px; }
.cab-item .reg { font-weight: 800; font-size: 1.05rem; letter-spacing: .03em; }
.cab-item .model { font-size: .85rem; color: var(--muted); }
.cab-item .meta { margin-left: auto; text-align: right; }
.cab-item .meta .stars { font-size: .85rem; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 40px; border-top: 1px solid var(--line); padding: 24px 0 40px; color: var(--muted); font-size: .85rem; text-align: center; }
.site-footer p + p { margin-top: 4px; }

/* ---------- Responsive ---------- */
@media (min-width: 640px) {
  .hero h1 { font-size: 2.2rem; }
  .cab-grid { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 639px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute; top: 60px; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: stretch; gap: 2px;
    padding: 10px 16px; box-shadow: var(--shadow);
    display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav a, .nav-user { padding: 12px; border-radius: 10px; }
  .nav-user { display: none; }
  .stat-row { grid-template-columns: repeat(2, 1fr); gap: 16px 10px; }
  .detail-grid { grid-template-columns: 1fr; }
}
