@charset "UTF-8";
/* ============================================================
   portal.css — customer-facing overrides on top of app.css
   Mobile slide-in navigation, garage card polish.
   ============================================================ */

/* The drawer logo only appears inside the mobile menu, never on desktop. */
.nav-drawer-brand { display: none; }

/* Hamburger button — hidden on desktop, shown on mobile */
.nav-toggle {
  display: none;
  width: 42px; height: 42px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); cursor: pointer;
  align-items: center; justify-content: center; flex-direction: column; gap: 4px;
}
.nav-toggle span {
  display: block; width: 18px; height: 2px; border-radius: 2px;
  background: currentColor; transition: transform .2s ease, opacity .2s ease;
}
body.menu-open .nav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
body.menu-open .nav-toggle span:nth-child(2) { opacity: 0; }
body.menu-open .nav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Backdrop behind the mobile menu */
.nav-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.4); opacity: 0; visibility: hidden;
  transition: opacity .25s ease, visibility 0s linear .25s; z-index: 70;
}
body.menu-open .nav-backdrop { opacity: 1; visibility: visible; transition: opacity .25s ease, visibility 0s; }

@media (max-width: 760px) {
  .nav-toggle { display: flex; }

  /* Guests already get Register/Login as hero CTAs, so drop the duplicate
     header buttons on mobile (keeps the bar from overflowing). Contact +
     language + theme stay. */
  .nav-auth-link { display: none; }

  /* When the drawer is open, lift the whole header (which contains the
     drawer) above the backdrop. The header is a sticky stacking context,
     so the drawer's own z-index can't escape it otherwise. */
  body.menu-open .nav { z-index: 90; }

  /* Turn the inline nav links into a slide-in drawer (from the left) */
  .nav-links {
    position: fixed; top: 0; left: 0; height: 100dvh; width: min(80vw, 320px);
    background: var(--surface); border-right: 1px solid var(--border);
    flex-direction: column; align-items: stretch; gap: 2px; padding: 16px 16px 24px;
    transform: translateX(-100%);
    /* On close, keep it visible until the slide-out finishes (delay the
       visibility flip by the transform duration) so it animates away cleanly. */
    transition: transform .28s cubic-bezier(.4,0,.2,1), visibility 0s linear .28s;
    z-index: 80; box-shadow: 16px 0 40px rgba(0,0,0,.18); overflow-y: auto;
    margin-left: 0;
    /* Closed drawer must not be reachable or visible until opened. */
    visibility: hidden; pointer-events: none;
  }
  body.menu-open .nav-links {
    transform: translateX(0); visibility: visible; pointer-events: auto;
    transition: transform .28s cubic-bezier(.4,0,.2,1), visibility 0s;
  }
  /* Logo at the top of the drawer. */
  .nav-links .nav-drawer-brand {
    display: flex; align-items: center; gap: 8px; font-family: var(--font-display);
    font-weight: 700; font-size: 1.2rem; color: var(--text);
    padding: 6px 16px 16px; margin-bottom: 8px; border-bottom: 1px solid var(--border);
  }
  .nav-links a {
    padding: 14px 16px; border-radius: 12px; font-size: 1rem; font-weight: 600;
    display: flex; align-items: center; justify-content: space-between;
  }
  .nav-links a.active { background: var(--accent-soft); color: var(--accent); }

  /* In the drawer, the "Manage" group is an inline labelled section, not a
     floating dropdown — its links are always shown beneath the heading. */
  .nav-group { width: 100%; margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--border); }
  .nav-group-toggle {
    width: 100%; justify-content: space-between; padding: 6px 16px;
    font-size: .78rem; text-transform: uppercase; letter-spacing: .05em;
    color: var(--text-muted); font-weight: 700; cursor: default;
  }
  .nav-group-toggle:hover { background: none; }
  .nav-group.active .nav-group-toggle { background: none; }
  .nav-group-caret { display: none; }              /* no toggling needed in the drawer */
  .nav-group-menu {
    display: block; position: static; border: none; box-shadow: none;
    background: none; padding: 0; min-width: 0;
  }
  .nav-group-menu a {
    padding: 14px 16px; border-radius: 12px; font-size: 1rem; font-weight: 600; color: var(--text);
  }

  /* Keep brand + actions on the bar, hide secondary text */
  .nav .container { flex-wrap: nowrap; }
  .nav-right .dropdown [data-dropdown] { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* Prevent the off-canvas drawer from causing horizontal scroll/bleed. */
  body { overflow-x: hidden; }
}

/* ---- Garage card polish (works at all sizes) ---- */
.garage-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px;
}
.car-card {
  position: relative; overflow: hidden; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface);
  display: flex; flex-direction: column; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.car-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.car-card .car-photo {
  height: 232px; background: var(--gradient-dark); position: relative;
  display: grid; place-items: center; overflow: hidden;
  text-decoration: none; cursor: pointer;
}
.car-card .car-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.car-card:hover .car-photo img { transform: scale(1.04); }
.car-card .car-badge-letter {
  width: 72px; height: 72px; border-radius: 20px; background: var(--gradient-accent);
  color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 2rem;
  display: grid; place-items: center; box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.car-card .car-year-tag {
  position: absolute; top: 12px; right: 12px; padding: 4px 12px; border-radius: 99px;
  background: rgba(0,0,0,.55); color: #fff; font-size: .78rem; font-weight: 600; backdrop-filter: blur(4px);
}
.car-card .car-body { padding: 18px; flex: 1; display: flex; flex-direction: column; }
.car-card .car-name { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }
.car-card .car-sub { color: var(--text-muted); font-size: .88rem; margin-top: 2px; }
.car-card .car-spec { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.car-card .car-spec .chip {
  font-size: .76rem; padding: 4px 10px; border-radius: 8px; background: var(--surface-2);
  color: var(--text-muted); font-weight: 600;
}
/* License plate badge: EU-style, centered, its own visual element. */
.car-card .car-plate {
  display: flex; align-items: stretch; align-self: center; margin: 14px 0 2px;
  border: 1.5px solid var(--border); border-radius: 7px; overflow: hidden;
  font-family: var(--font-display); box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.car-card .car-plate .cp-band {
  display: grid; place-items: center; padding: 0 8px;
  background: #1a3fb0; color: #fff; font-size: .7rem; font-weight: 700; letter-spacing: .03em;
}
.car-card .car-plate .cp-num {
  padding: 7px 16px; background: #fff; color: #111;
  font-size: 1.15rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
}
.car-card .car-actions {
  display: flex; gap: 8px; margin-top: auto; padding-top: 16px;
}
.car-card .car-actions .btn { flex: 1; }
.car-card .car-actions .icon-action {
  width: 42px; flex: 0 0 auto; display: grid; place-items: center; padding: 0;
}

/* Repair history photo thumbnails (clickable) */
.repair-photos { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.repair-photos img {
  width: 72px; height: 72px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border);
  cursor: zoom-in; transition: transform .15s ease;
}
.repair-photos img:hover { transform: scale(1.05); }

/* Repair history line items */
.repair-card { margin-bottom: 14px; }

/* ---- Notification preference toggles ---- */

/* ---- Dashboard split (recent repairs + tier card) ---- */
.dash-split {
  display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: stretch;
}
/* Both columns fill the row to the same height. The grid stretches the cell;
   making each child height:100% ensures the card itself fills it too. */
.dash-split > * { height: 100%; }
.dash-split > .tier-hero {
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center;
}
.dash-split > .tier-hero .tier-points { margin: 18px 0 4px; }
@media (max-width: 760px) {
  .dash-split { grid-template-columns: 1fr; }
  .dash-split > * { height: auto; }
}
.dash-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dash-card-head .section-title { margin: 0; }
.dash-card-link { font-size: .85rem; font-weight: 600; color: var(--accent); text-decoration: none; white-space: nowrap; }
.dash-card-link:hover { text-decoration: underline; }
/* Upcoming appointments feed with a calendar-style date block. */
.appt-feed { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
/* When full-width (below the split), show appointments two-across on desktop. */
.appt-feed-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (max-width: 760px) { .appt-feed-grid { grid-template-columns: 1fr; } }
.appt-feed-row {
  display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 12px;
  background: var(--surface-2); text-decoration: none; color: inherit; transition: background .12s;
}
.appt-feed-row:hover { background: color-mix(in srgb, var(--accent) 8%, var(--surface-2)); }
.af-date {
  flex: 0 0 auto; width: 48px; height: 48px; border-radius: 10px; background: var(--accent-soft);
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
}
.af-day { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; color: var(--accent); }
.af-mon { font-size: .62rem; font-weight: 700; letter-spacing: .06em; color: var(--accent); opacity: .8; }
.af-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.af-title { font-weight: 600; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.af-meta { font-size: .82rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.af-time { flex: 0 0 auto; font-family: var(--font-display); font-weight: 700; color: var(--text-muted); }

/* Label row that carries a small inline hint on the right (engine range). */

/* Reward the customer can't yet afford: a clear locked state instead of a
   dead disabled button, showing how many more points are needed. */
.reward-locked {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 14px; border-radius: var(--radius-sm); text-align: center;
  background: var(--surface-2); color: var(--text-muted);
  font-size: .9rem; font-weight: 600;
}
.reward-locked .rl-ico { opacity: .7; }

/* Recent repairs feed on the dashboard (replaces a table). */
.repair-feed { display: flex; flex-direction: column; gap: 10px; }
.repair-feed-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.repair-feed-row:last-child { border-bottom: 0; padding-bottom: 0; }
.rf-main { min-width: 0; }
.rf-title { font-weight: 600; font-family: var(--font-display); }
.rf-desc { font-size: .9rem; color: var(--text-muted); margin-top: 2px; }
.rf-date { font-size: .8rem; color: var(--text-muted); margin-top: 4px; }
.rf-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: 0 0 auto; }
.rf-cost { font-family: var(--font-display); font-weight: 700; white-space: nowrap; }

/* Loyalty points history feed (replaces a table). */
.ledger-feed { display: flex; flex-direction: column; }
.ledger-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.ledger-row:last-child { border-bottom: 0; }
.lf-main { min-width: 0; }
.lf-reason { font-weight: 600; }
.lf-date { font-size: .8rem; color: var(--text-muted); margin-top: 2px; }
.lf-points { font-family: var(--font-display); font-weight: 700; white-space: nowrap; flex: 0 0 auto; }

/* Contact page — info card beside the form. */
.contact-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; align-items: start; }
.contact-info .contact-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; font-size: .95rem; }
.contact-info .contact-item:not(:last-child) { border-bottom: 1px solid var(--border); }
.contact-info .ci-ico { font-size: 1.1rem; width: 24px; text-align: center; flex: 0 0 auto; }
.contact-info a { color: var(--text); text-decoration: none; }
.contact-info a:hover { color: var(--accent); }
@media (max-width: 720px) { .contact-grid { grid-template-columns: 1fr; } }

/* ---------- Garage card stats + service tag ---------- */
.car-service-tag { position: absolute; top: 12px; left: 12px; background: rgba(0,0,0,.55); color: #fff; font-size: .72rem; font-weight: 600; padding: 4px 9px; border-radius: 999px; backdrop-filter: blur(4px); }
.car-service-tag.is-soon { background: var(--warning); }
.car-service-tag.is-overdue { background: var(--danger); }
.car-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 14px 0; padding: 12px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.car-stat { display: flex; flex-direction: column; gap: 2px; text-align: center; }
.cs-num { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; line-height: 1.1; }
.cs-lbl { font-size: .68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }

/* ---------- Vehicle history hero ---------- */
.car-hero { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.ch-stat { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 18px; display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.ch-stat::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--accent); }
.ch-stat.ch-soon::before { background: var(--warning); }
.ch-stat.ch-overdue::before { background: var(--danger); }
.ch-ico { font-size: 1.3rem; }
.ch-num { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; line-height: 1.1; }
.ch-unit { font-size: .9rem; font-weight: 500; color: var(--text-muted); }
.ch-lbl { font-size: .76rem; color: var(--text-muted); }
.ch-stat.ch-overdue .ch-num { color: var(--danger); }
.ch-stat.ch-soon .ch-num { color: var(--warning); }

/* ---------- Mileage journey timeline ---------- */
.mileage-card { margin-bottom: 24px; }
.mileage-timeline { position: relative; padding-left: 28px; margin-top: 8px; }
.mileage-timeline::before { content: ''; position: absolute; top: 6px; bottom: 6px; left: 7px; width: 2px; background: var(--border); }
.mt-point { position: relative; padding: 10px 0; }
.mt-dot { position: absolute; left: -28px; top: 14px; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--border); }
.mt-km { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.mt-delta { color: var(--accent); font-size: .85rem; font-weight: 600; margin-left: 4px; }
.mt-meta { font-size: .85rem; color: var(--text-muted); margin-top: 2px; }

@media (max-width: 760px) {
  .car-hero { grid-template-columns: repeat(2, 1fr); }
}

/* Customer appointments list. */
.appt-list { display: flex; flex-direction: column; gap: 12px; }
.appt-list.is-past { opacity: .75; }
.appt-card { display: flex; gap: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; align-items: flex-start; }
.appt-card.is-cancelled { opacity: .55; }
.appt-card.is-cancelled .appt-card-service { text-decoration: line-through; }
.appt-card-date { flex-shrink: 0; width: 56px; text-align: center; background: var(--accent-soft); border-radius: var(--radius-sm); padding: 10px 0; }
.acd-day { display: block; font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; line-height: 1; color: var(--accent); }
.acd-mon { display: block; font-size: .72rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; margin-top: 2px; }
.appt-card-body { flex: 1; min-width: 0; }
.appt-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.appt-card-service { font-size: 1.05rem; }
.appt-card-meta { font-size: .88rem; color: var(--text-muted); margin-top: 6px; }
.appt-card-note { font-size: .88rem; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); color: var(--text); white-space: pre-line; }
@media (max-width: 520px) {
  .appt-card-date { width: 48px; }
  .acd-day { font-size: 1.25rem; }
}

/* Sale-report callout on the vehicle history page. */
.report-callout { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 22px; }
.rc-text { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 240px; }
.rc-title { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.rc-desc { font-size: .9rem; color: var(--text-muted); line-height: 1.5; }

/* Read-only detail list (label above value), e.g. locked vehicle details. */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px 24px; }
.detail-grid > div { display: flex; flex-direction: column; gap: 2px; }
.detail-grid .dt-label { font-size: .78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }
.detail-grid .dt-value { font-size: .98rem; font-weight: 600; color: var(--text); }
