/* ==========================================================================
   QuartierCharge — dark EV-charging theme layer
   Loaded on top of the shared bits.Store Bootstrap 5.3.8 bundle, scoped to
   the "QuartierChargeApp" layout only (see Configurations/environment.json).
   Ported from Template/v2/custom.css: repaints Bootstrap's CSS variables for
   the dark brand palette and adds the bespoke bits Bootstrap has no
   component for (map mockup, price circle, pin, QR viewfinder).
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@600;700;800&family=Inter:wght@400;500;600;700&display=swap');

/* ---------------------------------------------------------------------- */
/* 1. Theme tokens — repaint Bootstrap's dark mode                        */
/* ---------------------------------------------------------------------- */
[data-bs-theme="dark"] {
  /* surfaces */
  --bs-body-bg: #131519;
  --bs-body-bg-rgb: 19, 21, 25;
  --bs-body-color: #f6f7f9;
  --bs-body-color-rgb: 246, 247, 249;
  --bs-emphasis-color: #ffffff;
  --bs-secondary-color: #a4abbb;
  --bs-secondary-bg: #1c1f26;
  --bs-tertiary-bg: #202430;
  --bs-tertiary-color: #6f7789;
  --bs-border-color: #33394a;
  --bs-border-color-translucent: rgba(255, 255, 255, 0.08);
  --bs-heading-color: #f6f7f9;
  --bs-link-color: #ffd21f;
  --bs-link-color-rgb: 255, 210, 31;
  --bs-link-hover-color: #ffe16a;
  --bs-link-hover-color-rgb: 255, 225, 106;

  /* brand hues */
  --bs-primary: #ffd21f;   --bs-primary-rgb: 255, 210, 31;
  --bs-success: #7fc242;   --bs-success-rgb: 127, 194, 66;
  --bs-warning: #f0b93d;   --bs-warning-rgb: 240, 185, 61;
  --bs-danger:  #e2636b;   --bs-danger-rgb: 226, 99, 107;
  --bs-info:    #4f8fe8;   --bs-info-rgb: 79, 143, 232;
  --bs-secondary: #6f7789; --bs-secondary-rgb: 111, 119, 137;

  /* "-subtle" utilities (bg-success-subtle, text-primary-emphasis, …) */
  --bs-primary-bg-subtle: rgba(255, 210, 31, .15);
  --bs-primary-border-subtle: rgba(255, 210, 31, .4);
  --bs-primary-text-emphasis: #ffe16a;
  --bs-success-bg-subtle: rgba(127, 194, 66, .15);
  --bs-success-border-subtle: rgba(127, 194, 66, .4);
  --bs-success-text-emphasis: #a8db78;
  --bs-warning-bg-subtle: rgba(240, 185, 61, .15);
  --bs-warning-border-subtle: rgba(240, 185, 61, .4);
  --bs-warning-text-emphasis: #f3c968;
  --bs-danger-bg-subtle: rgba(226, 99, 107, .15);
  --bs-danger-border-subtle: rgba(226, 99, 107, .4);
  --bs-danger-text-emphasis: #ef9aa0;
  --bs-secondary-bg-subtle: #202430;
  --bs-secondary-border-subtle: #33394a;
  --bs-secondary-text-emphasis: #a4abbb;
}

.qc-app {
  font-family: 'Inter', var(--bs-body-font-family);
  background: #0c0d10;
  min-height: 100%;
  color: var(--bs-body-color, #f6f7f9);
}
/* Modals render outside the layout, so they carry their own .qc-app wrapper */
.qc-app-modal {
    min-height: 0;
    background: transparent;
    height: 100%;
}
    /* Modal container - not .qc-app-shell, which is sized for full pages (100dvh, max-width, shadow) */
    .qc-modal {
        display: flex;
        flex-direction: column;
        height: 100%;
        position: relative;
        overflow: hidden;
        border-radius: 1rem;
        background: var(--bs-body-bg);
    }

    .qc-app-modal-body {
        flex: 1 1 auto;
        overflow-y: auto;
        overscroll-behavior: contain;
    }
.qc-app-modal-footer {
    position: sticky;
    bottom: 0;
    z-index: 20;
    background: rgba(19, 21, 25, .92);
    backdrop-filter: blur(10px);
}

.qc-app h1, .qc-app h2, .qc-app h3, .qc-app h4, .qc-app .fw-display { font-family: 'Baloo 2', var(--bs-body-font-family); font-weight: 700; }

/* ---------------------------------------------------------------------- */
/* 2. Component variable overrides                                        */
/* ---------------------------------------------------------------------- */
.qc-app .btn-primary {
  /* yellow brand colour needs dark text for contrast */
  --bs-btn-color: #131519;
  --bs-btn-bg: var(--bs-primary);
  --bs-btn-border-color: var(--bs-primary);
  --bs-btn-hover-color: #131519;
  --bs-btn-hover-bg: #e6bb12;
  --bs-btn-hover-border-color: #e6bb12;
  --bs-btn-active-color: #131519;
  --bs-btn-active-bg: #e6bb12;
  --bs-btn-active-border-color: #e6bb12;
  --bs-btn-disabled-color: #131519;
  --bs-btn-disabled-bg: var(--bs-primary);
  --bs-btn-disabled-border-color: var(--bs-primary);
  font-family: 'Baloo 2', var(--bs-body-font-family);
  font-weight: 700;
}
.qc-app .btn-primary { /* re-apply the variables over bits.Store.Main's app.css, which hard-codes .btn-primary blue */
  color: var(--bs-btn-color); background-color: var(--bs-btn-bg); border-color: var(--bs-btn-border-color);
}
.qc-app .btn-primary:hover { color: var(--bs-btn-hover-color); background-color: var(--bs-btn-hover-bg); border-color: var(--bs-btn-hover-border-color); }
.qc-app .btn-primary:active, .qc-app .btn-primary.active { color: var(--bs-btn-active-color); background-color: var(--bs-btn-active-bg); border-color: var(--bs-btn-active-border-color); }
.qc-app .btn-primary:disabled, .qc-app .btn-primary.disabled { color: var(--bs-btn-disabled-color); background-color: var(--bs-btn-disabled-bg); border-color: var(--bs-btn-disabled-border-color); }
.qc-app .btn-outline-primary {
  --bs-btn-color: var(--bs-primary);
  --bs-btn-border-color: var(--bs-primary);
  --bs-btn-hover-color: #131519;
  --bs-btn-hover-bg: var(--bs-primary);
  --bs-btn-hover-border-color: var(--bs-primary);
  --bs-btn-active-color: #131519;
  --bs-btn-active-bg: var(--bs-primary);
  --bs-btn-active-border-color: var(--bs-primary);
  font-family: 'Baloo 2', var(--bs-body-font-family);
  font-weight: 700;
}
.qc-app .btn-dark {
  --bs-btn-bg: #20242f;
  --bs-btn-border-color: #20242f;
  --bs-btn-color: #f6f7f9;
  --bs-btn-hover-bg: #2a2f3d;
  --bs-btn-hover-border-color: #2a2f3d;
  --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: #2a2f3d;
}
.qc-app .btn { --bs-btn-font-family: 'Baloo 2', var(--bs-body-font-family); }
.qc-app .btn-link { font-weight: 700; }

.qc-app .card {
  --bs-card-bg: #1c1f26;
  --bs-card-border-color: #2a2f3b;
  --bs-card-cap-bg: rgba(255, 255, 255, .03);
  --bs-card-color: #f6f7f9;
}
.qc-app .list-group-item {
  --bs-list-group-bg: transparent;
  --bs-list-group-border-color: #272c37;
  --bs-list-group-color: #f6f7f9;
  --bs-list-group-action-hover-bg: rgba(255, 255, 255, .035);
  --bs-list-group-active-bg: var(--bs-primary);
  --bs-list-group-active-border-color: var(--bs-primary);
  --bs-list-group-active-color: #131519;
}

.qc-app .form-control, .qc-app .form-select {
  background-color: #23262e;
  border-color: #4a5268;
  color: #f6f7f9;
}
.qc-app .form-control::placeholder { color: #6f7789; }
.qc-app .form-control:focus, .qc-app .form-select:focus {
  background-color: #23262e;
  border-color: var(--bs-primary);
  color: #f6f7f9;
  box-shadow: 0 0 0 .2rem rgba(255, 210, 31, .25);
}

.qc-app .nav-pills { --bs-nav-pills-link-active-bg: var(--bs-primary); --bs-nav-pills-link-active-color: #131519; }
.qc-app .nav-pills .nav-link { color: #a4abbb; font-weight: 700; font-family: 'Baloo 2', var(--bs-body-font-family); font-size: .8rem; }

.qc-app .progress { --bs-progress-bg: #262b38; --bs-progress-bar-bg: var(--bs-primary); }
.qc-app .alert-secondary { --bs-alert-bg: #1c1f26; --bs-alert-border-color: #272c37; --bs-alert-color: #a4abbb; }

/* ---------------------------------------------------------------------- */
/* 3. App shell                                                           */
/* ---------------------------------------------------------------------- */
.qc-app-shell {
    max-width: 680px;
    margin: 0 auto;
    height: calc(var(--vh) * 100);
    max-height: calc(var(--vh) * 100);
    background: var(--bs-body-bg);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
@media (min-width: 480px) {
  .qc-app-shell { box-shadow: 0 0 40px rgba(0,0,0,.5); }
}

.qc-app-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(19, 21, 25, .92);
  backdrop-filter: blur(10px);
}
.qc-app-topbar .qc-app-topbar__side { width: 28px; flex-shrink: 0; }

/* ---------------------------------------------------------------------- */
/* 4. Bespoke, non-Bootstrap pieces                                       */
/* ---------------------------------------------------------------------- */

/* Full-bleed map screen */
.qc-map-page { height: 100%; overflow: hidden; }

/* Map */
.qc-map { background: #1a2433; }
.qc-pin {
  width: 44px; height: 44px; border-radius: 50% 50% 50% 4px; background: var(--bs-success);
  transform: rotate(-45deg); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 14px rgba(0,0,0,.4);
}
.qc-pin span { transform: rotate(45deg); font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: .72rem; color: #0d1a05; }
.qc-you-dot { width: 16px; height: 16px; border-radius: 50%; background: #4f8fe8; /* map keeps its blue, not the brand yellow */ border: 3px solid #fff; margin-top: -6px; box-shadow: 0 0 0 4px rgba(79,143,232,.25); }
/* Header: floats the search bar over the map, aligned to the app shell */
.qc-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  max-width: 480px; margin: 0 auto; pointer-events: none;
}
.qc-header > * { pointer-events: auto; }
.qc-topbar { background: rgba(15,17,20,.92) !important; }
.qc-topbar .form-control, .qc-topbar .input-group-text { background: transparent; }

/* Sheet (bottom card acting as an offcanvas) */
.qc-profile-illustration { width: min(78%, 300px); height: auto; overflow: visible; }
.qc-point-list .list-group-item:disabled { opacity: .5; }
.qc-legend li { display: flex; justify-content: space-between; align-items: center; padding: .6rem 0; }
.qc-legend img { width: 40px; height: 48px; object-fit: contain; }
.qc-station-fav { width: 56px; height: 56px; border-width: 2px; font-size: 1.4rem; display: flex; align-items: center; justify-content: center; }
.qc-station-icon { width: 40px; height: 40px; border-radius: 50%; background: #2a2f3a; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.qc-connector-icon { display: block; width: 60%; height: 60%; background-color: currentColor; -webkit-mask: var(--qc-icon) center / contain no-repeat; mask: var(--qc-icon) center / contain no-repeat; }
.qc-station-icon--lg { width: 56px; height: 56px; font-size: 1.6rem; }
.qc-point-list .list-group-item { background: transparent; }
.qc-point-code { background: #2a2f3a; color: var(--bs-body-color); border-radius: .35rem; padding: .1rem .35rem; margin-left: .2rem; }
.qc-switch { width: 3rem !important; height: 1.6rem; cursor: pointer; }
/* Pages inside .qc-app-shell (overflow hidden) scroll in their body */
.qc-page-body { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; }
.qc-sheet { background: var(--bs-body-bg); border-radius: 1rem 1rem 0 0; padding: 0 1rem 1rem; box-shadow: 0 -8px 24px rgba(0,0,0,.35); }
.qc-sheet__card { border: 1px solid #3f4350; border-radius: 1rem; padding: 1.25rem 1.25rem 1.1rem; cursor: pointer; }
.qc-sheet__route { width: 56px; height: 56px; font-size: 1.5rem; display: flex; align-items: center; justify-content: center; padding: 0; }
.qc-sheet-handle { width: 36px; height: 4px; background: #4a5268; border-radius: 999px; margin: 8px auto; }

/* Charging session */
.qc-price-circle {
  width: 160px; height: 160px; border-radius: 50%; background: #262b38; border: 1px solid #4a5268;
  display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 20px auto;
}
.qc-price-circle .num { font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 2.75rem; line-height: 1; }
/* Lademonitor: two-column tiles with icon, label, big value + small unit */
.qc-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.qc-tile { background: #262a33; border-radius: 1.25rem; padding: 18px 18px 20px; min-width: 0; }
.qc-tile--wide { padding: 20px; }
.qc-tile__icon {
  width: 52px; height: 52px; border-radius: 50%; background: #15181d; display: flex; align-items: center; justify-content: center;
  font-size: 1.45rem; margin-bottom: 1.4rem;
}
.qc-tile__label { color: var(--bs-body-color); font-size: .95rem; line-height: 1.3; margin-bottom: .35rem; }
.qc-tile__value { font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 2.4rem; line-height: 1.05; white-space: nowrap; }
.qc-tile__value small { font-size: 1.05rem; font-weight: 700; color: #8a90a0; margin-left: .3rem; }
.qc-charging-status { background: #262a33; color: #a4abbb; font-weight: 600; }

/* Swipe-to-stop, pinned below the scrolling monitor (fades the tiles out above it) */
.qc-monitor-footer { position: relative; padding: 10px 16px 18px; background: var(--bs-body-bg); }
.qc-monitor-footer::before {
  content: ''; position: absolute; left: 0; right: 0; top: -40px; height: 40px; pointer-events: none;
  background: linear-gradient(rgba(19, 21, 25, 0), var(--bs-body-bg));
}
.qc-swipe {
  position: relative; height: 64px; max-width: 340px; margin: 0 auto; border: 3px solid var(--bs-primary); border-radius: 999px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: linear-gradient(90deg, rgba(var(--bs-primary-rgb), .25) calc(var(--qc-swipe, 0) * 1%), transparent 0);
}
.qc-swipe__label {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding-left: 40px; pointer-events: none;
  font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 1.35rem; color: var(--bs-primary);
  opacity: calc(1 - var(--qc-swipe, 0) / 60); /* fades while the knob slides over it */
}
.qc-swipe--busy .qc-swipe__label { padding-left: 0; font-size: 1rem; }
.qc-swipe input[type=range] {
  -webkit-appearance: none; appearance: none; position: absolute; inset: 0; width: 100%; height: 100%;
  margin: 0; padding: 0 2px; background: transparent; cursor: grab; touch-action: pan-y;
}
.qc-swipe input[type=range]:focus { outline: none; }
.qc-swipe input[type=range]::-webkit-slider-runnable-track { height: 100%; background: transparent; border: none; }
.qc-swipe input[type=range]::-moz-range-track { height: 100%; background: transparent; border: none; }
.qc-swipe input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 54px; height: 54px; margin-top: 2px; border-radius: 50%; border: none;
  background: var(--bs-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23131519' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 5l7 7-7 7'/%3E%3C/svg%3E") center / 26px no-repeat;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
}
.qc-swipe input[type=range]::-moz-range-thumb {
  width: 54px; height: 54px; border-radius: 50%; border: none;
  background: var(--bs-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23131519' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 5l7 7-7 7'/%3E%3C/svg%3E") center / 26px no-repeat;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
}

.qc-ribbon-pill {
  display: inline-block; background: var(--bs-warning); color: #241a05; font-family: 'Baloo 2', sans-serif;
  font-weight: 800; font-size: .75rem; padding: 6px 16px 6px 12px; border-radius: 0 999px 999px 0; margin-left: -1rem;
}

/* Tariff promo badge */
.qc-promo-badge {
  width: 50px; height: 50px; border-radius: 50%; background: var(--bs-warning); color: #241a05;
  font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: .62rem; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; line-height: 1.1; flex-shrink: 0;
}

/* QR viewfinder */
.qc-qr-viewfinder { width: 190px; height: 190px; border-radius: 1.25rem; background: #202430; border: 2px solid #4a5268; position: relative; margin: 0 auto; }
.qc-qr-viewfinder::before, .qc-qr-viewfinder::after { content: ''; position: absolute; width: 26px; height: 26px; border: 3px solid var(--bs-primary); }
.qc-qr-viewfinder::before { top: -3px; left: -3px; border-right: none; border-bottom: none; border-radius: 1.25rem 0 0 0; }
.qc-qr-viewfinder::after { bottom: -3px; right: -3px; border-left: none; border-top: none; border-radius: 0 0 1.25rem 0; }

/* QR scanner: live camera fills the modal, viewfinder cuts a clear window into a dimmed overlay */
.qc-qr-scanner { background: #000; }
.qc-qr-scanner__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.qc-qr-scanner .qc-qr-viewfinder { width: min(70vw, 260px); height: min(70vw, 260px); background: transparent; border-color: rgba(255,255,255,.35); box-shadow: 0 0 0 100vmax rgba(0,0,0,.55); }

/* Dual-thumb range look for the filter screen (visual only) */
.qc-range { position: relative; height: 4px; background: #262b38; border-radius: 2px; margin: 28px 6px 8px; }
.qc-range__fill { position: absolute; left: 8%; right: 6%; top: 0; bottom: 0; background: var(--bs-primary); border-radius: 2px; }
.qc-range__handle { position: absolute; top: 50%; width: 16px; height: 16px; background: var(--bs-primary); border: 3px solid #fff; border-radius: 50%; transform: translate(-50%, -50%); }

/* Not-authorized placeholder (fills the page body, CTA pinned to the bottom) */
.qc-not-authorized { min-height: 100%; }
.qc-not-authorized__illustration { width: min(80%, 340px); height: auto; }

/* Login */
.qc-login { min-height: 100%; }
.qc-login__icon { width: 56px; height: 56px; font-size: 1.5rem; display: inline-flex; align-items: center; justify-content: center; }

/* App icon (icon.svg has its own rounded corners) */
.qc-app-icon { display: inline-block; object-fit: contain; }

/* Ladehistorie: month headers, collapsible sessions */
.qc-history-month {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: .9rem 1.25rem; color: var(--bs-secondary-color); font-weight: 600;
  border-bottom: 1px solid var(--bs-border-color);
}
.qc-history-item { border-bottom: 1px solid var(--bs-border-color); }
.qc-history-item__head {
  display: flex; align-items: flex-start; gap: 1rem; width: 100%;
  padding: 1.1rem 1.25rem; background: none; border: 0; color: inherit; text-align: left;
}
.qc-history-item__date { display: block; color: var(--bs-secondary-color); font-size: .95rem; margin-bottom: .6rem; }
.qc-history-item__title { display: block; font-family: "Baloo 2", sans-serif; font-weight: 700; font-size: 1.1rem; line-height: 1.35; margin-bottom: .35rem; }
.qc-history-item__total { display: block; color: var(--bs-secondary-color); font-weight: 700; }
.qc-history-item__body { padding: 0 1.25rem 1.25rem; }
.qc-history-map {
  position: relative; height: 150px; margin-bottom: 1rem;
  border-radius: 1.25rem; overflow: hidden; background: #1d2c4d;
  display: flex; align-items: center; justify-content: center;
}
.qc-history-map img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.qc-history-map__label {
  position: relative; margin-top: 3.5rem; padding: .35rem 1rem; max-width: calc(100% - 2rem);
  background: #131519; border-radius: 999px; font-weight: 700; font-size: .9rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.qc-history-facts { display: grid; grid-template-columns: auto 1fr; row-gap: .6rem; margin: 0; font-size: 1.05rem; }
.qc-history-facts dt { font-weight: 400; }
.qc-history-facts dd { margin: 0; text-align: right; font-weight: 700; }
