@font-face {
  font-family: 'Roboto';
  src: url('/src/assets/fonts/Roboto-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
}

@font-face {
  font-family: 'Roboto';
  src: url('/src/assets/fonts/Roboto-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Roboto';
  src: url('/src/assets/fonts/Roboto-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
}

:root {
  font-family: 'Roboto', system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  font-weight: 400;

  color-scheme: light;
  color: var(--text-dark);
  background-color: var(--bg-dark);

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* HSL Color Palette tokens - Light Theme (Notion / Workspace Inspired) */
  --bg-dark: #f5f6fa;
  --bg-card: #ffffff;
  --accent-gold: #3b429f; /* Swepearl Navy Blue */
  --accent-gold-gradient: linear-gradient(135deg, #5056bc 0%, #3b429f 50%, #252a70 100%);
  --success-emerald: #1d6f62; /* Swepearl Teal Green */
  --success-gradient: linear-gradient(135deg, #2b9d8c 0%, #1d6f62 100%);
  --error-rubin: #e03e5c; /* Notion Red */
  --error-gradient: linear-gradient(135deg, #f87171 0%, #e03e5c 100%);
  --amber-warning: #d97706; /* Warm Orange */
  --border-light: rgba(0, 0, 0, 0.06);

  /* New premium color variables */
  --primary-indigo: #424396;
  --light-gray-bg: #e2e8f0;
  --black-ink: #000000;
  --text-dark: #0c0d10;
  --text-muted: #6b7280;
  --border-glass: rgba(255, 255, 255, 0.5);
  --bg-sheet: rgba(255, 255, 255, 0.97);

  /* Font-size variables */
  --font-xs: 11px;
  --font-sm: 12px;
  --font-base: 14px;
  --font-md: 16px;
  --font-lg: 18px;
  --font-xl: 20px;
  --font-2xl: 24px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent !important; /* Disables native on-tap highlight color completely */
}
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  position: fixed;
  overflow: hidden;
  -webkit-touch-callout: none; /* Disables copy/save callout popup on long press */
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--bg-dark);
  user-select: none;
  -webkit-user-select: none; /* Disables text copy/selection popup on iOS */
  -moz-user-select: none;
  -ms-user-select: none;
}

input, textarea {
  user-select: text !important;
  -webkit-user-select: text !important;
}

.app-container {
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
  background-color: var(--bg-dark);
}

/* SPA View routing classes */
.view-panel {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.hidden {
  display: none !important;
  opacity: 0;
  pointer-events: none;
}

/* ========================================== */
/* A. PREMIUM LOGIN VIEW STYLES               */
/* ========================================== */
.login-panel {
  justify-content: flex-start;
  align-items: center;
  padding: 60px 24px 24px 24px;
  background: #f8f9fc; /* Light Notion/Workspace background */
  overflow-y: auto;
}

.login-container {
  width: 100%;
  max-width: 420px;
  margin: auto;
  padding: 20px 10px;
  animation: slideUpIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUpIn {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  margin-bottom: 2rem;
}

.login-logo {
  width: 64px;
  height: 64px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.login-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  aspect-ratio: 1 / 1;
}

.login-title {
  font-size: 28px;
  font-weight: 700; /* Bold "Swepearl" */
  color: #101827;
  line-height: 1.2;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.login-title .scanner-text {
  font-weight: 400; /* Light "scanner" */
  color: #4b5563;
}

.brand-desc {
  font-size: 13px;
  color: #4b5563;
  font-weight: 500;
  max-width: 290px;
  line-height: 1.5;
  margin-top: 2px;
}

/* Lang Switcher - Workspace Style */
.lang-switch {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
  width: 100%;
}

.lang-switch span {
  font-size: 0.85rem;
  font-weight: 500;
  color: #9ca3af;
  cursor: pointer;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: color 160ms cubic-bezier(0.4, 0, 0.2, 1);
}

.lang-switch span:hover {
  color: #101827;
}

.lang-switch span.active {
  color: #101827;
  border-bottom-color: #101827;
  font-weight: 600;
}

/* Premium Minimal Cards - Screenshot Style */
.login-option-card {
  background: #ffffff;
  border: 1px solid #eef2f6;
  border-radius: 24px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-option-card.expanded {
  border-color: #e2e8f0;
}

.card-header-btn {
  background: none;
  border: none;
  width: 100%;
  display: flex;
  align-items: center;
  text-align: left;
  padding: 0;
  cursor: pointer;
  color: inherit;
  font-family: inherit;
  outline: none;
}

.card-icon-container {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #eff6ff; /* light blue circle */
  color: #3b429f; /* Swepearl Navy */
  display: flex;
  justify-content: center;
  align-items: center;
  margin-right: 16px;
  flex-shrink: 0;
  font-size: 24px;
}

.card-text-col {
  flex: 1;
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: #101827;
  margin-bottom: 4px;
}

.card-subtitle {
  font-size: 11.5px;
  font-weight: 500;
  color: #6b7280;
  line-height: 1.4;
}

.card-arrow {
  color: #3b429f;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  flex-shrink: 0;
}

.card-arrow .chevron-icon {
  font-size: 20px;
  transition: transform 0.3s ease;
}

/* Expandable Option A Form */
.login-form-expandable-container {
  max-height: 500px;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, margin-top 0.3s ease;
  opacity: 1;
  margin-top: 20px;
  border-top: 1px solid #f1f5f9;
  padding-top: 20px;
}

.login-form-expandable-container.collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  pointer-events: none;
}

/* Inputs and Forms */
.login-form-container {
  width: 100%;
}

.form-group {
  position: relative;
  margin-bottom: 16px;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  pointer-events: none;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.input-wrapper input {
  width: 100%;
  padding: 14px 14px 14px 44px;
  background: #ffffff;
  border: 1px solid #e6e9f2;
  border-radius: 14px;
  font-size: 14px;
  color: #1c1e2e;
  transition: all 0.25s ease;
  font-family: inherit;
  font-weight: 500;
}

.input-wrapper input:focus {
  outline: none;
  border-color: var(--accent-gold);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(59, 66, 159, 0.12);
}

/* Buttons */
.primary-btn {
  width: 100%;
  padding: 14px;
  background: var(--accent-gold-gradient);
  border: none;
  border-radius: 14px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 6px;
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.15);
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(212, 175, 55, 0.22);
}

.primary-btn:active {
  transform: translateY(1px);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.1);
}

/* Option B Pairing layout */
.pairing-instructions {
  text-align: center;
}

.pairing-instructions p {
  font-size: 14px;
  color: #9ca3af;
  line-height: 1.6;
  margin-bottom: 20px;
}

.pairing-code-wrapper {
  margin-bottom: 24px;
}

.pairing-code-label {
  font-size: 12px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.pairing-code-box {
  margin-top: 8px;
  background: #f1f3fa;
  border: 1px dashed rgba(59, 66, 159, 0.3);
  padding: 16px;
  border-radius: 18px;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--accent-gold);
  text-shadow: none;
}

.pairing-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #e6e9f2;
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 12px;
  color: #64748b;
}

.status-indicator-dot {
  width: 6px;
  height: 6px;
  background-color: var(--accent-gold);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-gold);
}

.pulsing {
  animation: pulseScale 1.5s infinite ease-in-out;
}

@keyframes pulseScale {
  0% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 12px var(--accent-gold); }
  100% { transform: scale(1); opacity: 0.5; }
}


/* ========================================== */
/* B. UBER/BOLT-STYLE FULL-BLEED SCANNER VIEW */
/* ========================================== */

/* Full-Bleed Kamera */
.scanner-viewport {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  background-color: #000;
}

.scanner-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scanner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
}



/* Flytande Kiosk Status Badge (Top Left) */
.kiosk-status-badge {
  position: absolute;
  top: 36px;
  left: 92px;
  background: rgba(8, 9, 12, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  z-index: 90;
}

/* Flytande Runda Ikonknappar (Uber style) */
.floating-circle-btn {
  position: absolute;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(250, 250, 250, 0.1) !important;
  color: #cbd5e1 !important; /* light gray */
  border: none !important; /* remove border */
  outline: none !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
  z-index: 100;
}

.floating-circle-btn:hover {
  transform: scale(1.08);
  background: rgba(250, 250, 250, 0.2) !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2) !important;
}

.floating-circle-btn:active {
  transform: scale(0.95);
}

.btn-left {
  position: absolute;
  bottom: calc(100% + 20px);
  left: 24px;
}

.btn-right {
  position: absolute;
  bottom: calc(100% + 20px);
  right: 24px;
}

.settings-gear-btn {
  top: 36px;
  right: 24px;
  background: rgba(8, 9, 12, 0.85) !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Skanner Retikel */
.scanner-guide {
  position: absolute;
  top: 160px; /* Clears both the fixed transparent header bar and the camera prompt bubble completely */
  bottom: 340px; /* Centers dynamically on mobile to prevent overlapping with the feedback-panel */
  left: 0;
  right: 0;
  margin: auto; /* Mathematically centers the reticle vertically and horizontally in visible space */
  width: 240px; /* Reduced from 260px to ensure a spacious look on narrow/short screens */
  height: 240px;
  border: none; /* Radera standardkant - endast hörnbrackets visas! */
  border-radius: 32px;
  box-shadow: 0 0 0 9999px rgba(8, 9, 12, 0.5); /* Outer cut-out overlay */
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.scanner-guide.active {
  box-shadow: 0 0 0 9999px rgba(8, 9, 12, 0.5), 0 0 20px rgba(255, 255, 255, 0.15);
}

.scanner-guide.success {
  box-shadow: 0 0 0 9999px rgba(8, 9, 12, 0.5), 0 0 30px rgba(16, 185, 129, 0.45);
}

.scanner-guide.error {
  box-shadow: 0 0 0 9999px rgba(8, 9, 12, 0.5), 0 0 30px rgba(239, 68, 68, 0.45);
}

/* Guide hörn (Thick white rounded corners från mockupen) */
.scanner-corner {
  position: absolute;
  width: 32px;
  height: 32px;
  border-color: #ffffff;
  border-style: solid;
  transition: border-color 0.3s ease;
}

.scanner-guide.success .scanner-corner { border-color: var(--success-emerald); }
.scanner-guide.error .scanner-corner  { border-color: var(--error-rubin); }

.corner-tl { top: -2px; left: -2px; border-width: 5px 0 0 5px; border-top-left-radius: 32px; }
.corner-tr { top: -2px; right: -2px; border-width: 5px 5px 0 0; border-top-right-radius: 32px; }
.corner-bl { bottom: -2px; left: -2px; border-width: 0 0 5px 5px; border-bottom-left-radius: 32px; }
.corner-br { bottom: -2px; right: -2px; border-width: 0 5px 5px 0; border-bottom-right-radius: 32px; }

/* Lasersvep - Visuellt raderad för en helt ren kamerasökning */
.scanner-laser {
  display: none !important;
}

.scanner-guide.success .scanner-laser {
  background: linear-gradient(90deg, transparent, var(--success-emerald), transparent);
  box-shadow: 0 0 8px var(--success-emerald);
}

.scanner-guide.error .scanner-laser {
  background: linear-gradient(90deg, transparent, var(--error-rubin), transparent);
  box-shadow: 0 0 8px var(--error-rubin);
}

@keyframes laserPulse {
  0% { top: 10%; }
  50% { top: 90%; }
  100% { top: 10%; }
}


/* ========================================== */
/* C. FLYTANDE UBER/BOLT-STYLE BOTTOM SHEET   */
/* ========================================== */
.feedback-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  max-width: 100%;
  background: rgba(255, 255, 255, 0.97); /* Lyxig ren-vit yta som Uber/Bolt! */
  color: #0c0d10; /* Mörk text */
  border-top-left-radius: 32px;
  border-top-right-radius: 32px;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  padding: 24px 24px calc(env(safe-area-inset-bottom, 16px) + 24px) 24px; /* phone safe areas consideration */
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.15);
  z-index: 50;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-bottom: none;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

/* Tablet / Desktop centered layout fallback */
@media (min-width: 768px) {
  .feedback-panel {
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 420px;
    bottom: 24px;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    padding: 24px;
  }

  .scanner-guide {
    top: calc(50% - 130px);
    bottom: auto;
    left: calc(50% - 120px);
    right: auto;
    margin: 0;
    width: 240px;
    height: 240px;
  }
}

/* Svep-streck i toppen av bottenkortet */
.bottom-sheet-notch {
  width: 40px;
  height: 4px;
  background-color: rgba(0, 0, 0, 0.08);
  border-radius: 2px;
  margin-bottom: 20px;
  pointer-events: none;
}

/* Status-kort inuti bottenkortet */
.status-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Huvudrad (Emoji + Rubrik + Pill Badge) */
.bottom-sheet-header-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding-bottom: 16px;
}

.status-icon-wrapper {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #10b981; /* Premium Green background */
  color: #ffffff; /* White icon color */
  border: none;
  font-size: 32px;
  margin-bottom: 0;
  transition: all 0.3s ease;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
  overflow: visible; /* Let the ripple waves pop out! */
}

/* Verifying Loader Background Color */
.verifying .status-icon-wrapper {
  background: #424396 !important;
  color: #ffffff !important;
}

.status-icon-wrapper .status-symbol {
  font-size: 32px;
  color: #ffffff !important;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 12;
}

/* Pulsing and Ripple Waves for Scanning State */
.scanning .status-icon-wrapper {
  background: #10b981;
  color: #ffffff;
  border: none;
  animation: pulseGreenCenter 2s infinite ease-in-out;
}

.scanning .status-icon-wrapper::before,
.scanning .status-icon-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.45); /* translucent green wave */
  z-index: -1;
  pointer-events: none;
  transform-origin: center;
  animation: rippleGreenWave 2s infinite cubic-bezier(0.25, 0, 0, 1);
}

.scanning .status-icon-wrapper::after {
  animation-delay: 1s;
}

@keyframes pulseGreenCenter {
  0% { transform: scale(1); }
  50% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

@keyframes rippleGreenWave {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(2.4); /* ripple wave pops out of the circle */
    opacity: 0; /* and fades out completely */
  }
}

/* Spinner Animation for Verifying State */
.spin-animation {
  animation: spinLoading 1s infinite linear;
}

@keyframes spinLoading {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.success .status-icon-wrapper {
  color: #ffffff;
  background: #10b981;
  border: none;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.error .status-icon-wrapper {
  color: #ffffff;
  background: var(--error-rubin);
  border: none;
  box-shadow: 0 4px 12px rgba(224, 62, 92, 0.2);
}

.refunded .status-icon-wrapper {
  color: #ffffff;
  background: #f97316;
  border: none;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.20);
}

.bottom-sheet-title-col {
  flex: 1;
  text-align: left;
}

.status-title {
  font-size: 20px;
  font-weight: 700;
  color: #0c0d10;
  margin: 0;
  letter-spacing: -0.4px;
}

.bottom-sheet-subtitle {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  display: block;
  margin-top: 1px;
}

/* Status Pill Badges (Bolt-stil) */
.status-pill {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.status-pill.warning {
  background-color: #fef3c7;
  color: #d97706;
}

.status-pill.success {
  background-color: #d1fae5;
  color: #059669;
}

.status-pill.error {
  background-color: #fee2e2;
  color: #dc2626;
}

.status-message {
  font-size: 14px;
  color: #4b5563;
  text-align: center;
  margin: 6px 0 16px 0;
  width: 100%;
  line-height: 1.5;
}

/* Detaljkort */
.coupon-details {
  width: 100%;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 18px;
  padding: 16px;
  margin-top: 4px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  animation: slideUpFade 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  font-size: 13px;
  color: #6b7280;
}

.detail-value {
  font-size: 13px;
  font-weight: 600;
  color: #0c0d10;
}

.detail-value.highlight {
  color: #059669;
}

/* Solid Black Uber-knapp */
.action-button {
  width: 100%;
  margin-top: 18px;
  background: #0c0d10;
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.action-button:hover {
  background: #1b1d24;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.action-button:active {
  transform: scale(0.98);
}


/* ========================================== */
/* D. ADMINISTRATIV SYSTEMMODAL STYLES        */
/* ========================================== */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(12, 13, 16, 0.45);
  z-index: 999;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 28px;
  width: 100%;
  max-width: 440px;
  padding: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  max-height: 90vh;
  overflow-y: auto;
  box-sizing: border-box;
  color: var(--text-dark);
}

.modal-title {
  font-size: var(--font-xl);
  font-weight: 700;
  margin-bottom: 20px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 12px;
  color: var(--text-dark);
}

.modal-card .input-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.modal-card .input-group label {
  font-size: var(--font-xs);
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.modal-card input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--light-gray-bg);
  border-radius: 14px;
  font-size: var(--font-base);
  color: var(--text-dark);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
  font-weight: 500;
  box-sizing: border-box;
}

.modal-card input:focus {
  outline: none;
  border-color: var(--primary-indigo);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(66, 67, 150, 0.12);
}

.grid-inputs {
  display: flex;
  gap: 12px;
}

.grid-inputs > div {
  flex: 1;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.secondary-btn {
  flex: 1;
  padding: 14px;
  background: transparent;
  border: 1px solid var(--light-gray-bg);
  color: var(--text-muted);
  border-radius: 14px;
  font-size: var(--font-base);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  justify-content: center;
  align-items: center;
}

.secondary-btn:hover {
  background: var(--light-gray-bg);
  color: var(--text-dark);
}

.modal-card .primary-btn {
  flex: 1.2;
  margin-top: 0;
  padding: 14px;
  font-size: var(--font-base);
  border-radius: 14px;
  background: var(--accent-gold-gradient);
  color: #ffffff;
  font-weight: 700;
}

.danger-btn {
  width: 100%;
  padding: 14px;
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--error-rubin);
  border-radius: 14px;
  font-size: var(--font-base);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 20px;
}

.danger-btn:hover {
  background: rgba(239, 68, 68, 0.06);
  border-color: rgba(239, 68, 68, 0.35);
  color: var(--error-rubin);
}

/* ========================================== */
/* E. UBER/BOLT EXTENSION FEATURES           */
/* ========================================== */

/* Flytande trigger för manuell inmatning */
.manual-entry-trigger {
  position: absolute;
  bottom: calc(100% + 24px); /* Floats dynamically 24px above bottom sheet, vertically centering with the circle buttons! */
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: #ffffff;
  pointer-events: auto;
  z-index: 100;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.manual-entry-trigger:hover {
  transform: translate(-50%, -2px);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}

.manual-entry-trigger .arrow-up {
  font-size: 11px;
  opacity: 0.9;
  animation: arrowBlink 1.5s infinite ease-in-out;
}

.manual-entry-trigger .trigger-text {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.2px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

@keyframes arrowBlink {
  0% { opacity: 0.3; transform: translateY(1px); }
  50% { opacity: 1; transform: translateY(-2px); }
  100% { opacity: 0.3; transform: translateY(1px); }
}

/* Lyxig status-banner bar i bottenkortet */
.status-banner-bar {
  width: 100%;
  background-color: rgba(0, 0, 0, 0.04);
  border-radius: 16px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  color: #4b5563;
  text-align: center;
  margin-bottom: 16px;
  border: 1px solid rgba(0, 0, 0, 0.02);
}

/* Dolt manuellt inmatningsfält (glider upp lyxigt) */
.manual-input-container {
  width: 100%;
  margin: 4px 0 16px 0;
  overflow: hidden;
  max-height: 200px;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 1;
}

.manual-input-container.hidden {
  max-height: 0;
  margin: 0;
  opacity: 0;
  padding: 0;
  pointer-events: none;
}

.input-wrapper-inline {
  display: flex;
  gap: 8px;
  width: 100%;
}

.input-wrapper-inline input {
  flex: 1;
  padding: 14px 16px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  font-size: 14px;
  background: rgba(0, 0, 0, 0.03);
  color: #0c0d10 !important;
  transition: all 0.25s ease;
  font-family: inherit;
  font-weight: 600;
}

.input-wrapper-inline input:focus {
  outline: none;
  border-color: #7c3aed;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.inline-submit-btn {
  background: #0c0d10;
  color: #fff;
  border: none;
  padding: 14px 22px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.inline-submit-btn:hover {
  background: #1b1d24;
}

.inline-submit-btn:active {
  transform: scale(0.97);
}

/* Multi-Pill Action Row (Uber/Bolt-stil) */
.action-pill-row {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-top: 18px;
}

.action-pill {
  flex: 1;
  border: none;
  height: 50px;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
}

.action-pill:active {
  transform: scale(0.96);
}

.btn-purple {
  background: #7c3aed;
  color: #fff;
}
.btn-purple:hover {
  background: #6d28d9;
  box-shadow: 0 6px 14px rgba(124, 58, 237, 0.25);
}

.btn-blue {
  background: #3b82f6;
  color: #fff;
}
.btn-blue:hover {
  background: #2563eb;
  box-shadow: 0 6px 14px rgba(59, 130, 246, 0.25);
}

.btn-gray {
  background: #4b5563;
  color: #fff;
}
.btn-gray:hover {
  background: #374151;
  box-shadow: 0 6px 14px rgba(75, 85, 99, 0.25);
}

.btn-orange {
  background: #f97316;
  color: #fff;
}
.btn-orange:hover {
  background: #ea580c;
  box-shadow: 0 6px 14px rgba(249, 115, 22, 0.25);
}

.btn-light-gray {
  background: var(--light-gray-bg);
  color: var(--black-ink);
  flex: 4;
}
.btn-light-gray:hover {
  background: #cbd5e1;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.05);
}

.btn-indigo {
  background: var(--primary-indigo);
  color: #fff;
  flex: 6;
}
.btn-indigo:hover {
  background: #343580;
  box-shadow: 0 6px 14px rgba(66, 67, 150, 0.25);
}

/* ========================================== */
/* F. SWEPEARL BRAND LOGO STYLING             */
/* ========================================== */

.brand-logo-img-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 12px;
}

.brand-logo-img {
  height: 58px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.05));
  animation: logoAppear 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.status-icon-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

@keyframes logoAppear {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

/* ========================================== */
/* G. PREMIUM TRANSPARENT GLASSMORPHIC HEADER */
/* ========================================== */
/* ========================================== */
/* G. PREMIUM TRANSPARENT GLASSMORPHIC HEADER */
/* ========================================== */
.scanner-header-bar {
  position: fixed; /* Locked at the top of the viewport at all times */
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  padding-top: calc(max(20px, env(safe-area-inset-top)) + 8px); /* Bulletproof safe area fallback for notches in Safari + PWAs */
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: none;
  z-index: 100;
  box-sizing: border-box;
}

.header-left {
  display: flex;
  align-items: center;
  flex: 1;
  justify-content: flex-start;
}

.header-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.header-logo-icon {
  height: 36px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.05));
}

.header-brand-title {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff !important;
  letter-spacing: -0.3px;
}

.header-right {
  display: flex;
  align-items: center;
  flex: 1;
  justify-content: flex-end;
}

.header-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
}

.header-store-name {
  font-size: 13px;
  font-weight: 400; /* regular weight */
  color: #ffffff !important; /* white color */
  text-align: right;
  margin-top: 1px;
}

.header-app-name {
  font-size: 11px;
  font-weight: 500; /* medium weight */
  color: rgba(255, 255, 255, 0.8) !important; /* slightly translucent white */
  text-align: right;
}

.header-settings-btn {
  background: transparent;
  border: none !important; /* no border */
  outline: none !important;
  box-shadow: none !important;
  color: #ffffff !important; /* white color */
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

.header-settings-btn:hover {
  background: rgba(255, 255, 255, 0.08); /* subtle hover glow instead of solid background */
  transform: rotate(30deg);
}

.header-settings-btn:active {
  transform: scale(0.95);
}

/* Sessionskod / Fjärrstyrning Styling */
.sessionskod-box-container {
  margin-top: 20px;
  width: 100%;
  border-top: 1px solid #f1f5f9;
  padding-top: 20px;
}

.sessionskod-inner-card {
  background: #f4f6fc; /* soft lavender/blue */
  border-radius: 20px;
  padding: 16px;
}

.sessionskod-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.sessionskod-left-side {
  display: flex;
  align-items: center;
}

.sessionskod-padlock-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e0e7ff;
  color: #3b429f;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-right: 12px;
  font-size: 16px;
}

.sessionskod-padlock-circle .material-symbols-rounded {
  font-size: 16px;
}

.sessionskod-title-col {
  text-align: left;
}

.sessionskod-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #101827;
  margin: 0;
}

.sessionskod-subtitle {
  font-size: 10.5px;
  color: #6b7280;
  margin-top: 2px;
}

.sessionskod-timer-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #e0e7ff;
  color: #3b429f;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}

.sessionskod-timer-pill .timer-icon {
  font-size: 14px;
}

.sessionskod-digits-row {
  background: #ffffff;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 12px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.005);
}

.sessionskod-digit-text {
  font-size: 32px;
  font-weight: 800;
  color: #3b429f;
  letter-spacing: 12px; /* CSS-controlled beautiful spacing */
  text-indent: 12px; /* perfectly centers the spaced out text */
  text-align: center;
  font-family: 'Roboto', monospace, system-ui;
  white-space: nowrap; /* CRITICAL: Never wrap or split into multiple lines */
  word-break: keep-all;
  overflow: hidden;
}

.sessionskod-footer-text {
  font-size: 10.5px;
  color: #9ca3af;
  text-align: center;
  margin: 0;
  font-weight: 500;
}

/* Polling Status */
.pairing-status-wrapper {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 11px;
  color: #9ca3af;
  font-weight: 500;
}

/* Updated Login Footer */
.login-footer {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.footer-secure-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #9ca3af;
  font-weight: 500;
}

.footer-secure-row .secure-icon {
  font-size: 14px;
}

.footer-version-text {
  font-size: 10px;
  color: #9ca3af;
  margin: 0;
}

.floating-circle-btn .material-symbols-rounded {
  font-size: 32px; /* larger icons */
  display: flex;
  justify-content: center;
  align-items: center;
  color: #cbd5e1 !important; /* light gray */
}

.manual-entry-trigger .arrow-up.material-symbols-rounded {
  font-size: 20px;
  animation: arrowBlink 1.5s infinite ease-in-out;
}

.header-settings-btn .material-symbols-rounded {
  font-size: 24px; /* larger settings icon */
  display: flex;
  justify-content: center;
  align-items: center;
  color: #ffffff !important; /* white settings icon */
}

/* Premium Danger Button for Logout in settings */
.btn-danger {
  background: var(--error-rubin);
  color: #ffffff;
  border: none;
  padding: 14px;
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  margin-top: 16px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-size: var(--font-base);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-danger:hover {
  background: #dc2626;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}
.btn-danger:active {
  transform: scale(0.98);
}

/* History & Settings Bottom Sheet Overlays */
#history-modal,
#settings-modal {
  display: flex;
  align-items: flex-end; /* Dock card to bottom on mobile! */
  justify-content: center; /* Center horizontally! */
  padding: 0;
}

#history-modal .modal-card,
#settings-modal .modal-card {
  width: 100%;
  max-width: 100%;
  border-radius: 32px 32px 0 0; /* Matches feedback-panel */
  padding: 24px 24px calc(env(safe-area-inset-bottom, 16px) + 24px) 24px; /* Matches feedback-panel padding */
  background: var(--bg-sheet); /* Matches feedback-panel background */
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.15); /* Matches feedback-panel shadow */
  max-height: 70vh; /* Peak drawer up to 70% in max height! */
  box-sizing: border-box;
  color: var(--text-dark);
  border: 1px solid var(--border-glass);
  border-bottom: none;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  z-index: 100;
}

#history-modal.active .modal-card,
#settings-modal.active .modal-card {
  transform: translateY(0);
}

/* History List & Items */
.history-list-container {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.history-empty-text {
  text-align: center;
  color: var(--text-muted);
  font-size: var(--font-base);
  padding: 20px 0;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: var(--bg-dark);
  border-radius: 12px;
  border: 1px solid var(--border-light);
  margin-bottom: 8px;
}

.history-item-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.history-item-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dark);
}

.history-item-code {
  font-size: var(--font-xs);
  font-family: monospace;
  color: var(--text-muted);
}

.history-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.history-item-status {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
}

.history-item-status.status-redeemed {
  color: #047857;
  background: #d1fae5;
}

.history-item-status.status-refunded {
  color: #b45309;
  background: #fef3c7;
}

.history-item-time {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

.history-total-badge {
  background: #e0e7ff;
  color: #4338ca;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: var(--font-sm);
  font-weight: 700;
  border: none;
  display: inline-flex;
  align-items: center;
}

.history-actions {
  margin-top: auto;
  border-top: 1px solid var(--border-light);
  padding-top: 16px;
}

/* Tablet / Desktop centered layout fallback for history & settings sheets */
@media (min-width: 768px) {
  #history-modal,
  #settings-modal {
    padding: 24px; /* Sits 24px from edges, matching feedback-panel bottom: 24px */
    align-items: flex-end; /* Peak drawer style even on desktop */
  }
  
  #history-modal .modal-card,
  #settings-modal .modal-card {
    border-radius: 28px; /* Matches feedback-panel */
    max-width: 420px; /* Matches feedback-panel max-width */
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-glass);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  }
  
  #history-modal.active .modal-card,
  #settings-modal.active .modal-card {
    transform: translateY(0);
  }
}
