/* ============================================================
   e-mobility Bern — Design System
   ============================================================ */

/* === TOKENS === */
:root {
  --green-50:  #f0fdf4;
  --green-100: #dcfce7;
  --green-200: #bbf7d0;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-700: #15803d;
  --green-800: #166534;
  --green-900: #14532d;
  --green-950: #052e16;

  --slate-50:  #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  --bg:          #f8fafc;
  --surface:     #ffffff;
  --border:      #e2e8f0;
  --text:        #1e293b;
  --text-muted:  #64748b;
  --primary:     #22c55e;
  --primary-dark:#16a34a;
  --danger:      #ef4444;

  --radius-sm: 10px;
  --radius:    18px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
  --shadow-sm: 0 1px 4px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
  --shadow:    0 4px 16px rgba(0,0,0,.08), 0 1px 4px rgba(0,0,0,.04);
  --shadow-md: 0 8px 32px rgba(0,0,0,.10), 0 2px 8px rgba(0,0,0,.05);
  --shadow-lg: 0 20px 60px rgba(0,0,0,.12), 0 4px 20px rgba(0,0,0,.06);

  --nav-h: 70px;
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* === LAYOUT === */
.page-shell { min-height: 100vh; display: flex; flex-direction: column; }
.page-content { flex: 1; padding-bottom: 5rem; }
.container { width: min(1200px, calc(100% - 2.5rem)); margin: 0 auto; }

/* === HEADER === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(0,0,0,.04);
}
.nav {
  height: var(--nav-h);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.brand { display: flex; align-items: center; flex-shrink: 0; }
.brand img { height: 38px; }
.nav-links { display: flex; align-items: center; gap: .2rem; }
.nav-links a {
  color: var(--slate-700);
  font-size: .94rem;
  font-weight: 500;
  padding: .5rem .9rem;
  border-radius: var(--radius-sm);
  transition: background .15s, color .15s;
}
.nav-links a:hover { background: var(--green-50); color: var(--green-700); }
.nav-pill {
  background: var(--primary) !important;
  color: #fff !important;
  font-weight: 600 !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: 0 2px 8px rgba(34,197,94,.28) !important;
  transition: background .15s, transform .12s, box-shadow .15s !important;
}
.nav-pill:hover {
  background: var(--primary-dark) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 14px rgba(34,197,94,.36) !important;
}

/* === HERO (Startseite) === */
.hero {
  margin: 2rem 0 1.5rem;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  background: linear-gradient(135deg, #031a0d 0%, #0b3320 45%, #0e4528 100%);
  color: #fff;
  align-items: center;
  min-height: 460px;
}
.hero-copy { padding: 3rem 2.5rem 3rem 3rem; }
.hero-copy h1 {
  font-family: 'Poppins', 'Inter', sans-serif;
  font-weight: 800;
  font-size: clamp(1.9rem, 3.5vw, 3.1rem);
  line-height: 1.1;
  letter-spacing: -.025em;
  margin: .7rem 0 1rem;
}
.hero-copy p { color: rgba(255,255,255,.68); font-size: 1.03rem; max-width: 55ch; line-height: 1.72; }
.hero-art {
  align-self: stretch;
  display: grid;
  place-items: center;
  padding: 2.5rem 2rem;
  background: linear-gradient(135deg, rgba(34,197,94,.07), rgba(22,163,74,.13));
  min-height: 420px;
}
.hero-art img {
  width: 100%;
  max-width: 300px;
  filter: drop-shadow(0 24px 48px rgba(0,0,0,.32));
}

/* === DASHBOARD HERO === */
.dashboard-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1.5rem;
  background: linear-gradient(135deg, #031a0d 0%, #0b3320 100%);
  color: #fff;
  padding: 2rem 2.5rem;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  margin: 2rem 0 1.5rem;
}
.dashboard-hero .hero-copy { padding: 0; }
.dashboard-hero h1 {
  font-family: 'Poppins', 'Inter', sans-serif;
  font-weight: 700;
  font-size: clamp(1.5rem, 2.5vw, 2.1rem);
  letter-spacing: -.018em;
  margin: .5rem 0 .55rem;
}
.dashboard-hero p { color: rgba(255,255,255,.68); font-size: .97rem; max-width: 60ch; }

/* === EYEBROW === */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .28rem .7rem;
  border-radius: 999px;
  background: rgba(34,197,94,.16);
  color: #4ade80;
  text-transform: uppercase;
  letter-spacing: .085em;
  font-size: .7rem;
  font-weight: 700;
}
.section-headline .eyebrow,
.info-card .eyebrow,
.form-card .eyebrow,
.map-card .eyebrow {
  background: var(--green-100);
  color: var(--green-700);
}

/* === ACTIONS & BUTTONS === */
.actions { display: flex; gap: .8rem; flex-wrap: wrap; margin: 1.4rem 0 1.7rem; }
.btn, button {
  appearance: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .7rem 1.4rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .94rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease;
}
.btn, button[type="submit"] {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(34,197,94,.24);
}
.btn:hover, button[type="submit"]:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(34,197,94,.34);
}
.btn.secondary {
  background: rgba(255,255,255,.09);
  color: #fff;
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: none;
}
.btn.secondary:hover { background: rgba(255,255,255,.17); }
button.danger {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  box-shadow: none;
}
button.danger:hover { background: #dc2626; color: #fff; border-color: #dc2626; }

/* === HERO STATS === */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .65rem;
  margin-top: 1rem;
}
.hero-stats.two-col { grid-template-columns: repeat(2, 1fr); }
.stat-card {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-sm);
  padding: .85rem 1rem;
}
.stat-card strong { display: block; font-size: 1.08rem; font-weight: 700; color: #fff; margin-bottom: .18rem; }
.stat-card span { font-size: .82rem; color: rgba(255,255,255,.6); }

/* === TOKEN CARD === */
.token-card {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  min-width: 260px;
  max-width: 380px;
  flex-shrink: 0;
}
.token-card .eyebrow { margin-bottom: .55rem; }

/* === FEATURE STRIP === */
.feature-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.feature-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--green-100);
  font-size: 1.5rem;
  margin-bottom: .9rem;
}
.feature-card h3 {
  font-family: 'Poppins', 'Inter', sans-serif;
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--slate-800);
  margin-bottom: .4rem;
}
.feature-card p { font-size: .92rem; color: var(--text-muted); line-height: 1.62; }

/* === INFO GRID === */
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}
.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.8rem;
  box-shadow: var(--shadow-sm);
}
.info-card h2 {
  font-family: 'Poppins', 'Inter', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--slate-800);
  margin: .45rem 0 .65rem;
}
.info-card p { font-size: .96rem; color: var(--text-muted); line-height: 1.7; }

/* === SECTION HEADLINE === */
.section-headline {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin: 2.5rem 0 1rem;
}
.section-headline h2 {
  font-family: 'Poppins', 'Inter', sans-serif;
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--slate-800);
  margin: .3rem 0 0;
}

/* === CARD GRID === */
.grid, .card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

/* === CARD === */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.card h3 {
  font-family: 'Poppins', 'Inter', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: var(--slate-800);
  margin-bottom: .35rem;
}
.card p { font-size: .9rem; color: var(--text-muted); margin-bottom: .22rem; line-height: 1.52; }
.card p strong { color: var(--slate-700); font-weight: 600; }
.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .45rem;
  margin-bottom: 1rem;
}

/* === SCOOTER VISUAL === */
.scooter-visual {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--green-100), var(--green-200));
  font-size: 1.45rem;
  margin-bottom: .8rem;
}

/* === STATUS & BATTERY BADGES === */
.status-badge, .battery-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .28rem .65rem;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .012em;
}
.status-badge             { background: var(--green-100); color: var(--green-800); }
.status-badge.rented,
.status-badge.active      { background: #dbeafe; color: #1e40af; }
.status-badge.maintenance { background: #fef3c7; color: #92400e; }
.status-badge.completed   { background: var(--green-100); color: var(--green-800); }
.battery-badge { background: var(--slate-100); color: var(--slate-600); }

/* Battery bar */
.battery-bar {
  height: 5px;
  background: var(--slate-100);
  border-radius: 999px;
  overflow: hidden;
  margin: .55rem 0 .85rem;
}
.battery-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #22c55e, #4ade80);
  transition: width .4s ease;
}
.battery-bar-fill.low      { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.battery-bar-fill.critical { background: linear-gradient(90deg, #ef4444, #f87171); }

/* === VEHICLE TYPE === */
.vehicle-type-label {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--primary-dark);
  margin: -.25rem 0 .5rem;
}

/* === QR CODE === */
.qr-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  margin: .85rem 0 .5rem;
  padding: .75rem;
  background: var(--slate-50);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.qr-wrapper .qr-code img,
.qr-wrapper .qr-code canvas {
  display: block;
  border-radius: 4px;
}
.qr-label {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin: 0;
}

/* === EMPTY CARD === */
.empty-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 200px;
  border: 2px dashed var(--border);
  background: var(--slate-50);
  box-shadow: none;
  color: var(--text-muted);
}
.empty-card:hover { transform: none; box-shadow: none; }
.empty-card h3 { color: var(--slate-600); }

/* === FORM CARD === */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
  max-width: 720px;
  margin: 0 auto 1.5rem;
}
.wide-card { max-width: none; }
.form-card h1, .form-card h2 {
  font-family: 'Poppins', 'Inter', sans-serif;
  font-weight: 700;
  color: var(--slate-800);
  margin-bottom: 1.25rem;
}

/* === AUTH LAYOUT === */
.auth-layout {
  display: grid;
  grid-template-columns: 1fr 460px;
  gap: 1.5rem;
  align-items: stretch;
  margin: 2rem 0;
}
.auth-panel { min-height: 100%; }
.promo-panel {
  background: linear-gradient(145deg, #031a0d 0%, #0b3320 55%, #0e4228 100%);
  color: #fff;
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.promo-panel h1 {
  font-family: 'Poppins', 'Inter', sans-serif;
  font-weight: 800;
  font-size: clamp(1.55rem, 2.5vw, 2.1rem);
  line-height: 1.22;
  letter-spacing: -.02em;
  margin: .7rem 0 .9rem;
}
.promo-panel p { color: rgba(255,255,255,.68); line-height: 1.7; margin-bottom: 1.4rem; }
.promo-panel img {
  width: 100%;
  max-width: 320px;
  margin: 1.5rem auto 0;
  filter: drop-shadow(0 14px 30px rgba(0,0,0,.28));
}

/* === LABELS & INPUTS === */
label {
  display: block;
  font-size: .88rem;
  font-weight: 600;
  color: var(--slate-700);
  margin-bottom: 1rem;
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select {
  display: block;
  width: 100%;
  padding: .72rem 1rem;
  margin-top: .32rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: .95rem;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(34,197,94,.12);
}

/* === FLASH MESSAGES === */
.messages { margin: 1rem 0; }
.flash {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .85rem 1.1rem;
  border-radius: var(--radius-sm);
  margin-bottom: .45rem;
  font-size: .92rem;
  font-weight: 500;
  border-left: 3px solid;
}
.flash.success { background: #f0fdf4; color: #15803d; border-color: #22c55e; }
.flash.danger  { background: #fef2f2; color: #991b1b; border-color: #ef4444; }
.flash.info    { background: #eff6ff; color: #1d4ed8; border-color: #3b82f6; }
.flash.warning { background: #fffbeb; color: #92400e; border-color: #f59e0b; }

/* === MAP === */
.map-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}
.map-box {
  width: 100%;
  min-height: 380px;
  border-radius: var(--radius);
  overflow: hidden;
}
.leaflet-container { font-family: 'Inter', sans-serif; }

/* === FORM GRID === */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .7rem 1.2rem;
}
.form-actions { display: flex; align-items: flex-end; }

/* === MUTED & CODE === */
.muted { color: var(--text-muted); font-size: .87rem; margin-top: 1rem; }
code {
  word-break: break-all;
  display: block;
  background: var(--slate-900);
  color: #86efac;
  border-radius: var(--radius-sm);
  padding: .8rem 1rem;
  margin-top: .45rem;
  font-size: .8rem;
  line-height: 1.6;
  font-family: 'Consolas', 'JetBrains Mono', 'Fira Code', monospace;
}

/* === FOOTER === */
.site-footer {
  background: var(--slate-900);
  color: rgba(255,255,255,.55);
  padding: 2.5rem 0;
  margin-top: auto;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-brand { display: flex; align-items: center; gap: .7rem; }
.footer-brand img { height: 26px; filter: brightness(0) invert(1) opacity(.6); }
.footer-brand span { font-size: .87rem; font-weight: 500; }
.footer-copy { font-size: .83rem; }
.footer-links { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.footer-links a { font-size: .83rem; color: rgba(255,255,255,.45); transition: color .15s; }
.footer-links a:hover { color: rgba(255,255,255,.9); }

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .hero-grid   { grid-template-columns: 1fr; }
  .hero-art    { min-height: 240px; }
  .auth-layout { grid-template-columns: 1fr; }
  .info-grid   { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .feature-strip { grid-template-columns: 1fr; }
  .hero-stats, .hero-stats.two-col { grid-template-columns: repeat(2, 1fr); }
  .form-grid     { grid-template-columns: 1fr; }
  .dashboard-hero { grid-template-columns: 1fr; }
  .token-card    { max-width: 100%; min-width: auto; }
}
@media (max-width: 640px) {
  .nav-links a    { padding: .45rem .65rem; font-size: .86rem; }
  .hero-copy      { padding: 2rem 1.5rem; }
  .hero-copy h1   { font-size: 1.75rem; }
  .dashboard-hero { padding: 1.5rem; }
  .form-card      { padding: 1.5rem; }
  .promo-panel    { padding: 1.75rem; }
  .section-headline { flex-direction: column; align-items: flex-start; }
  .container      { width: calc(100% - 2rem); }
}
