/* =====================================================================
   EV2W Customer Web — web.css (extends styles.css)
   Desktop-first responsive layout: 375 / 768 / 1366
   ===================================================================== */

@import url('styles.css');

/* ===== Auth modal (login + register over the landing page) ===== */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-modal--open { display: flex; }
.auth-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.auth-modal__card {
  position: relative;
  z-index: 1;
  background: var(--surface-card);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(17, 24, 39, 0.25);
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 40px;
  animation: authModalIn 160ms ease;
}
@keyframes authModalIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.auth-modal__close {
  position: absolute;
  top: 16px; right: 16px;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  color: var(--text-secondary);
}
.auth-modal__close:hover { background: var(--surface-secondary); }

body { background: var(--surface-page); min-height: 100vh; }
@media (min-width: 768px) {
  body { padding: 0; }
  .app-frame {
    max-width: 100%; min-height: 100vh; height: auto;
    box-shadow: none; border-radius: 0; overflow-y: visible;
    background: var(--surface-page);
  }
}

/* nav wrapper must not generate a box, or it constrains the sticky header
   to its own 64px height (header would scroll away). display:contents fixes it. */
#nav { display: contents; }

/* Chip filter row (notifications, history) — was only defined in admin.css */
.filter-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

/* Native <select> fields get the same chevron as the custom tipe-motor dropdown,
   so every dropdown control looks consistent. */
select.field__input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-default) center;
  background-size: 16px;
  padding-right: 44px;
  cursor: pointer;
}
select.field__input::-ms-expand { display: none; }

/* ---------- WEB TOP NAV (Public + Authenticated) ---------- */
.web-topnav {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface-card);
  border-bottom: 1px solid var(--border-default);
  display: flex; align-items: center;
  padding: 0 32px;
  height: 64px;
  gap: 32px;
  flex-shrink: 0;
}
.web-topnav__logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 18px; color: var(--brand-primary-text);
}
.web-topnav__logo-mark {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand-primary-dark);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-on-brand); font-weight: 800;
}
.web-topnav__links {
  display: flex; gap: 24px; flex: 1;
}
.web-topnav__link {
  color: var(--text-secondary);
  font-size: 14px; font-weight: 500;
  padding: 8px 0;
}
.web-topnav__link:hover { color: var(--brand-primary-text); }
.web-topnav__link--active { color: var(--brand-primary-text); }
.web-topnav__actions { display: flex; align-items: center; gap: 12px; }

/* Language toggle (ID / EN) — segmented pill */
.lang-toggle {
  display: inline-flex; align-items: center;
  background: var(--surface-page);
  border: 1px solid var(--border-default);
  border-radius: 999px;
  padding: 2px;
  height: 32px;
}
.lang-toggle__btn {
  height: 28px;
  min-width: 36px;
  padding: 0 10px;
  border: 0; background: transparent;
  border-radius: 999px;
  font-size: 12px; font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 120ms, color 120ms;
}
.lang-toggle__btn:hover { color: var(--text-primary); }
.lang-toggle__btn--active {
  background: var(--brand-primary-dark);
  color: var(--surface-card);
}
.lang-toggle__btn--active:hover { color: var(--surface-card); }

/* User context menu (avatar dropdown) */
.web-usermenu { position: relative; }
.web-usermenu__trigger {
  display: flex; align-items: center; gap: 8px;
  background: transparent; border: 1px solid transparent;
  padding: 6px 8px; border-radius: 999px; cursor: pointer;
  color: inherit;
}
.web-usermenu__trigger:hover { background: var(--surface-page); }
.web-usermenu__avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand-primary-light); color: var(--text-on-brand);
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.web-usermenu__dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 200px; background: var(--surface-card);
  border: 1px solid var(--border-default); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(17,24,39,0.12);
  padding: 6px; z-index: 60;
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .14s ease, transform .14s ease, visibility .14s;
}
.web-usermenu--open .web-usermenu__dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.web-usermenu__item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 12px; border-radius: 8px; border: none; background: transparent;
  font-size: 14px; font-weight: 500; color: var(--text-primary);
  text-align: left; cursor: pointer; text-decoration: none;
}
.web-usermenu__item:hover { background: var(--surface-page); }
.web-usermenu__item--danger { color: var(--error); }
.web-usermenu__divider { height: 1px; background: var(--border-default); margin: 6px 4px; }

/* Settings list (account page) */
.settings-list { padding: 0; overflow: hidden; }
.settings-item {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px; text-decoration: none; color: inherit;
  border-bottom: 1px solid var(--border-default);
}
.settings-item:last-child { border-bottom: none; }
.settings-item:hover { background: var(--surface-page); }
.settings-item__icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--surface-secondary); color: var(--brand-primary-text);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.settings-item__label { flex: 1; font-size: 15px; font-weight: 500; }

@media (max-width: 767px) {
  .web-topnav { padding: 0 16px; gap: 16px; height: 56px; }
  .web-topnav__links { display: none; }
}

/* ---------- WEB LAYOUT ---------- */
.web-page {
  max-width: 1366px;
  margin: 0 auto;
  padding: 32px;
}
@media (max-width: 767px) { .web-page { padding: 16px; } }

.web-page__title { font-size: 30px; font-weight: 700; }
.web-page__subtitle { color: var(--text-secondary); font-size: 16px; margin-top: 8px; }
.web-page__header { margin-bottom: 32px; }

/* Two-column layouts */
.web-two-col {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 32px;
}
.web-two-col__sticky {
  position: sticky; top: 96px;
  height: fit-content;
}
@media (max-width: 1024px) {
  .web-two-col { grid-template-columns: 1fr; }
  .web-two-col__sticky { position: static; }
}

/* Authenticated layout: rail + content */
.web-auth {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 64px);
}
.web-auth__rail {
  background: var(--surface-card);
  border-right: 1px solid var(--border-default);
  padding: 24px 12px;
  position: sticky;
  top: 64px;
  align-self: start;
  height: calc(100vh - 64px);
  overflow-y: auto;
}
.web-auth__content {
  padding: 32px;
  max-width: 1126px;
  margin: 0 auto;
  width: 100%;
}
@media (max-width: 767px) {
  .web-auth { grid-template-columns: 1fr; }
  .web-auth__rail { display: none; }
  .web-auth__content { padding: 16px; }
}

.web-rail__item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px; font-weight: 500;
  color: var(--text-secondary);
}
.web-rail__item:hover { background: var(--surface-page); color: var(--text-primary); }
.web-rail__item--active {
  background: var(--brand-primary-light);
  color: var(--text-on-brand);
}

/* ---------- HERO (Flip/Jenius style: white background, brand accents only) ---------- */
.web-hero {
  background: var(--surface-card);  /* WHITE */
  padding: 80px 32px;
  border-bottom: 1px solid var(--border-default);  /* subtle separator instead of stripe */
}
.web-hero__container {
  max-width: 1200px; margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
.web-hero__title { font-size: 48px; font-weight: 700; line-height: 1.1; color: var(--brand-secondary); }
.web-hero__subtitle { font-size: 18px; color: var(--text-secondary); margin-top: 16px; line-height: 1.5; }
@media (max-width: 767px) {
  .web-hero { padding: 32px 16px; }
  .web-hero__container { grid-template-columns: 1fr; gap: 32px; }
  .web-hero__title { font-size: 32px; }
}

/* Public footer */
.web-footer {
  background: var(--surface-inverse);
  color: var(--text-inverse);
  padding: 48px 32px 24px;
}
.web-footer__container {
  max-width: 1200px; margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 32px;
}
.web-footer__title { font-size: 14px; font-weight: 600; margin-bottom: 12px; color: var(--text-inverse); }
.web-footer__link { display: block; padding: 6px 0; font-size: 13px; color: rgba(255,255,255,0.7); }
.web-footer__link:hover { color: white; }
.web-footer__copyright { text-align: center; padding-top: 32px; font-size: 12px; color: rgba(255,255,255,0.5); border-top: 1px solid rgba(255,255,255,0.1); margin-top: 32px; }
@media (max-width: 767px) {
  .web-footer__container { grid-template-columns: 1fr; }
}

/* Auth card (centered for login/register) */
.web-auth-card {
  max-width: 440px;
  margin: 64px auto;
  padding: 40px;
  background: var(--surface-card);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(17,24,39,0.08);
}
@media (max-width: 767px) {
  .web-auth-card { margin: 16px; padding: 24px; }
}

/* MC card grid (desktop) */
.web-mc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 1024px) { .web-mc-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .web-mc-grid { grid-template-columns: 1fr; } }

/* ---------- DATA TABLE (customer web — history, etc.) ---------- */
.web-table {
  width: 100%;
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  overflow: hidden;
  border-collapse: separate;
  border-spacing: 0;
}
.web-table th {
  text-align: left;
  padding: 12px 16px;
  background: var(--surface-page);
  border-bottom: 1px solid var(--border-default);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}
.web-table td {
  padding: 16px;
  border-bottom: 1px solid var(--border-default);
  font-size: 14px;
  color: var(--text-primary);
  vertical-align: middle;
}
.web-table tr:last-child td { border-bottom: none; }
.web-table tbody tr:hover { background: var(--surface-page); cursor: pointer; }
.web-table td.web-table__num { text-align: right; }
.web-table th.web-table__num { text-align: right; }
.web-table-wrap { overflow-x: auto; }

/* ---------- BACK BREADCRUMB (consistent across pages) ---------- */
.web-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 500; color: var(--text-secondary);
  text-decoration: none; margin-bottom: 16px;
}
.web-back:hover { color: var(--brand-primary-text); }

/* ---------- BOOKING FLOW STEP INDICATOR ---------- */
.flow-steps { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; font-size: 13px; }
.flow-steps__item { display: flex; align-items: center; gap: 8px; color: var(--text-tertiary); }
.flow-steps__num {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface-secondary); color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px;
}
.flow-steps__item--active { color: var(--text-primary); font-weight: 600; }
.flow-steps__item--active .flow-steps__num { background: var(--brand-primary-dark); color: var(--text-on-brand); }
.flow-steps__item--done .flow-steps__num { background: var(--brand-primary-light); color: var(--text-on-brand); }
.flow-steps__sep { color: var(--text-tertiary); }

/* ---------- BROWSE (Cari motor) — vertical layout ---------- */
/* At rest: a normal rounded filter card (contained, with comfortable spacing) */
.browse-filter {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 20px;
  box-shadow: 0 2px 8px rgba(17,24,39,0.05);
}
#filterWrap { position: relative; }
/* When scrolled: pin under the header and span the full content column edge-to-edge */
.browse-filter--stuck {
  position: fixed;
  top: 64px; left: 240px; right: 0;   /* left = sidebar rail width */
  z-index: 40;
  margin: 0;
  border: none;
  border-bottom: 1px solid var(--border-default);
  border-radius: 0;
  padding: 12px 32px;
  box-shadow: 0 6px 16px rgba(17,24,39,0.08);
}
.browse-filter .field { margin: 0; min-width: 0; }
.browse-filter__group { display: flex; flex-direction: column; gap: 6px; }
.browse-filter__types { display: flex; flex-wrap: wrap; gap: 8px 18px; padding-bottom: 8px; }
.browse-filter__actions { display: flex; align-items: center; gap: 16px; margin-left: auto; }
@media (max-width: 767px) {
  .browse-filter__actions { margin-left: 0; width: 100%; }
  /* no pinning on mobile — keep the rounded card */
  .browse-filter--stuck {
    position: static; left: auto; right: auto;
    border: 1px solid var(--border-default); border-radius: 12px;
    padding: 16px 20px; box-shadow: 0 2px 8px rgba(17,24,39,0.05);
  }
}

/* Checkbox dropdown (multi-select filter, e.g. tipe motor) */
.filter-dd { position: relative; }
/* trigger matches .field__input exactly so it lines up with the other inputs */
.filter-dd__trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; height: 48px; padding: 0 var(--space-default);
  border: 1px solid var(--border-default); border-radius: var(--radius-default);
  background: var(--surface-card); color: var(--text-primary);
  font-size: var(--fs-body-md); cursor: pointer;
  transition: border-color 150ms, box-shadow 150ms;
}
.filter-dd__trigger:hover { border-color: var(--border-secondary); }
.filter-dd--open .filter-dd__trigger { border-color: var(--brand-primary-dark); box-shadow: 0 0 0 3px rgba(14,212,0,0.12); }
.filter-dd__menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  min-width: 100%; background: var(--surface-card);
  border: 1px solid var(--border-default); border-radius: var(--radius-default);
  box-shadow: 0 12px 32px rgba(17,24,39,0.12);
  padding: 12px; z-index: 30;
  display: none; flex-direction: column; gap: 12px;
}
.filter-dd--open .filter-dd__menu { display: flex; }

/* mc-card meta row (deposit · distance) */
.mc-card__meta {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--fs-body-sm); color: var(--text-secondary);
}
.mc-card__meta-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-tertiary); flex-shrink: 0; }
.mc-card__agent {
  display: flex; align-items: center; gap: 6px;
  font-size: var(--fs-label-sm); color: var(--brand-primary-text); font-weight: var(--fw-medium);
}

/* Print styles */
@media print {
  .no-print { display: none !important; }
  body { background: white; }
  .app-frame { box-shadow: none; }
}
