/* App-wide CSS moved into the bundle so hosting doesn't need to serve app.css separately. */
@font-face {
  font-family: 'PoppinsLight';
  src: url('/app/static/fonts/poppins-light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'PoppinsMedium';
  src: url('/app/static/fonts/poppins-medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
/* React app overrides to ensure legacy CSS positions elements correctly */
html, body {
  display: block !important;
  align-items: initial !important;
  justify-content: initial !important;
  height: 100%;
  margin: 0;
  overflow: hidden;            /* prevent page scrolling in camera view */
  overscroll-behavior: contain;/* avoid rubber-banding on mobile */
  touch-action: none;          /* disable scroll gestures while measuring */
  font-family: 'Poppins', Arial, sans-serif;
  background: #ffffff;
  color: #303030;
}
/* Ensure main fills viewport for camera layout */
main { position: relative; width: 100%; height: 100%; max-height: 100vh; }
/* Custom brand font */
@font-face {
  font-family: 'Olney';
  src: url('/app/static/fonts/olney_light.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
#root {
  height: 100%;
  min-height: 100vh;
  position: relative;
}
/* Welcome page layout fixes */
.welcome-page {
  position: relative;
  min-height: 100vh;
  font-family: 'PoppinsLight', sans-serif;
}
.welcome-page .header {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  background: transparent !important;
}
/* Global: consistent header icon positions across pages */
.exit-button-class {
  position: absolute !important;
  top: 1vh !important;
  right: 3vw !important;
  width: 24px !important;
  height: 24px !important;
}
.back-arrow {
  position: absolute !important;
  top: 1vh !important;
  left: 3vw !important;
  width: 24px !important;
  height: 24px !important;
}
.welcome-page .center-div {
  position: relative !important;
  top: 18vh !important;
  margin: 0 auto;
  width: min(90vw, 980px) !important;
}
.welcome-page .center-bottom-button {
  position: fixed !important;
  left: 0;
  right: 0;
  bottom: 24px !important;
  text-align: center !important;
  padding: 0 16px;
  z-index: 1000 !important;
}
.welcome-page .center-bottom-button button {
  width: min(90vw, 520px) !important;
}
/* Welcome page: Start button styling */
.welcome-page #language-button {
  background-color: #242628 !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 200px !important;
  height: 56px !important;
  min-height: 52px !important;
  font-size: 18px !important;
  font-family: 'PoppinsLight', sans-serif !important;
  padding: 10px 20px !important;
}
.welcome-page h1 {
  font-family: 'Poppins', sans-serif !important;
  font-weight: 600 !important;
  font-size: 28px !important;
  line-height: 36px !important;
  color: #303030 !important;
  margin: 24px auto 0 auto !important; /* add space from image; center horizontally */
  width: min(80vw, 520px) !important;   /* increase left/right margins by narrowing text block */
  padding: 0 4vw !important;            /* additional side padding for small screens */
}
@media (min-width: 768px) {
  .welcome-page #language-button { font-size: 36px !important; height: 7vh !important; }
  .welcome-page h1 { font-size: 54px !important; line-height: 72px !important; margin-top: 36px !important; width: min(60vw, 720px) !important; padding: 0 !important; }
}
.welcome-page #qr-div {
  display: flex;
  align-items: center;
  justify-content: center;
  transform: none !important;
}
.welcome-page .center-bottom-button p {
  color: #3C3C4399 !important;
  text-align: left !important;
  font-size: 1.25vh !important;
  font-weight: 500 !important;
  font-family: 'PoppinsLight', sans-serif !important;
  width: min(90vw, 520px) !important;
  margin: 0 auto 8px auto !important;
}
.welcome-page .dialog-wrapper {
  position: fixed !important;
}
.welcome-page .back-arrow { left: 3vw !important; top: 1vh !important; }
/* Camera page minor fixes */
.camera-container {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100vh;
  overflow: hidden;
  background: #000;
}
/* Camera base layout */
#cameraPreview,
#processCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#cameraPreview { z-index: 1; background: #000; display: block; }
#processCanvas { z-index: 2; pointer-events: none; display: block; }
/* Error message at top */
#errmessage { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); color: #d32f2f; z-index: 10; text-align: center; }
/* Hand camera notify banner styles */
#notify-top-container{ position: fixed; top: 16px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 12px; z-index: 9999; pointer-events: none; }
.notify-banner{ pointer-events: auto; width: 80vw; max-width: 80vw; background: #000000; color: var(--nb-text,#fff); border: 3px solid var(--nb-border,#ff4d4f); border-radius: 10px; padding: 14px 18px; display: grid; gridTemplateColumns: auto 1fr auto; align-items: center; gap: 14px; box-shadow: 0 6px 30px rgba(0,0,0,.12); font-family: system-ui,-apple-system, Segoe UI, Roboto, Arial, sans-serif; font-size: clamp(14px, 2.1vw, 20px); line-height: 1.35; background-clip: padding-box; }
.nb-icon{ width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--nb-icon-bg,#ffe8e8); color: var(--nb-icon,#ff4d4f); font-weight: 700; font-size: 16px; }
.nb-message{ font-weight: 500; }
.nb-close{ border: 0; background: transparent; font-size: 22px; line-height: 1; cursor: pointer; color: #888; padding: 4px; }
.nb-close:hover{ color: #444; }
.notify-banner.enter{ animation: nb-slide-in 180ms ease-out both; }
.notify-banner.exit { animation: nb-slide-out 160ms ease-in both; }
@keyframes nb-slide-in{ from { transform: translateY(-14px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes nb-slide-out{ from { transform: translateY(0); opacity: 1; } to { transform: translateY(-14px); opacity: 0; } }
/* Permission card */
.container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 80vw;
  /* top: 30vh; */
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
}
/* Center the permissions popup on camera screens */
.camera-page .container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90vw;
  z-index: 1000;
}
.card {
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  max-width: 400px;
  width: 100%;
  text-align: center;
  color: #333 !important; /* ensure text in card is dark, overriding global body color */
}
.card-header { color: #fff; padding: 20px; font-size: 16px; line-height: 22px; }
.card-body { padding: 16px; }
.access-item { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; }
.access-icon img { width: 5.47vw !important; max-width: 40px; display: block; }
.access-text { color: #333 !important; margin-left: 6px !important; font-size: 1.6vh !important; }
/* Switch */
.switch { position: relative; display: inline-block; width: 12.44vw; max-width: 60px; height: 3.2vh; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .3s; border-radius: calc(3.2vh / 2); height: 100%; padding: 0 0.4vh; box-sizing: border-box; }
.slider:before { position: absolute; content: ""; height: calc(3.2vh - 0.8vh); width: calc(3.2vh - 0.8vh); left: 0.4vh; top: 50%; transform: translateY(-50%); background-color: white; transition: left .3s, background-color .3s; border-radius: 50%; }
input:checked + .slider { background-color: #262626; }
input:checked + .slider:before { left: calc(100% - (3.2vh - 0.8vh) - 0.4vh); }
input:disabled + .slider { background-color: #e0e0e0; cursor: not-allowed; }
input:checked:disabled + .slider { background-color: #262626; cursor: not-allowed; }
input:checked:disabled + .slider:before { background-color: white; }
/* Loading */
#loadingContainer { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; display: flex; align-items: center; justify-content: center; background-color: rgba(0,0,0,.6); z-index: 1000; }
.loading-content { text-align: center; }
.loading-text { color: #fff; font-size: 16px; margin-top: 10px; }
.loading-gif { height: 15vh; }
/* Overlays */
.hand_image_overlay, .foot_image_overlay {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 10;
  /* Do not show overlays until permissions are granted */
  display: none;
  visibility: hidden;
}
#hand_wrong, #hand_correct { visibility: hidden; }
#foot_overlay { visibility: hidden; }
/* Foot overlay positions as in legacy */
/* Keep sizes from legacy, positions will be set dynamically when camera starts */
#foot_overlay { position: absolute; width: 50vw; z-index: 3; }
/* Info page fixes to match legacy */
.info-page .header {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: #ffffff !important;
  display: flex;
  align-items: center;
  padding-top: 1.6vh !important;   /* tighter header height on info */
  padding-bottom: 1.6vh !important;
}
.info-page .title {
  color: #000000 !important;
  text-align: left !important;
  margin-left: calc(3vw + 36px) !important; /* icon (24px) + gap */
  font-size: 16px !important;              /* smaller title text */
  font-weight: normal !important;
}
.info-page .center-div {
  position: relative !important;
  top: calc(env(safe-area-inset-top, 0px) + 56px) !important; /* align just below TopBar */
}
.info-page .back-arrow { left: 3vw !important; top: 50% !important; transform: translateY(-50%) !important; }
.info-page .exit-button-class { right: 3vw !important; top: 50% !important; transform: translateY(-50%) !important; }
.info-page .center-bottom-button {
  position: fixed !important;
  left: 0;
  right: 0;
  bottom: 24px !important;
  text-align: center !important;
  z-index: 1000 !important;
}
.info-page .center-bottom-button p {
  color: #000000 !important;
}
/* Info page: Continue button styling */
.info-page #language-button {
  background-color: #242628 !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 200px !important;
  height: 56px !important;
  min-height: 52px !important;
  font-size: 18px !important;
  font-family: 'Olney', sans-serif !important;
  padding: 10px 20px !important;
  width: min(90vw, 520px) !important;
}
@media (min-width: 768px) {
  .info-page #language-button { font-size: 36px !important; height: 7vh !important; }
}
/* Input sizing and alignment for Info page */
.info-page .grid-container {
  display: block !important;
  width: 100% !important;
}
.info-page .item-text {
  text-align: left !important;
  padding-left: 5% !important;
  margin-top: 12px !important;
  color: #000000 !important;
}
.info-page .measure-inputs {
  display: flex !important;               /* block-level for centering */
  align-items: center !important;
  width: 90vw !important;                 /* requested viewport width */
  margin: 8px auto !important;            /* center horizontally */
  border-radius: 200px !important;        /* fully rounded */
  height: 52px !important;
  min-height: 52px !important;
  background: #ffffff !important;
  border: 1px solid #CCCCCC !important;   /* 1px gray border */
  box-sizing: border-box !important;
  padding-right: 20px !important;         /* space for caret at end */
}
.info-page .measure-inputs:focus-within {
  outline: none !important;
  border: 1px solid #CCCCCC !important;   /* keep same on focus */
}
.info-page .measure-inputs input {
  border: none !important;
  outline: none !important;
  background: transparent !important;
  width: 100% !important;
  height: 52px !important;
  line-height: 52px !important;
  border-radius: 200px !important;
  padding-left: 20px !important;
  font-family: 'Poppins', sans-serif !important;
  font-size: 16px !important;
  color: #000000 !important;              /* black input color */
}
@media (min-width: 768px) {
.info-page .measure-inputs input { padding-left: 35px !important; }
}
/* Tutorial page styles (adapted) */
.tutorial-page .upper_side { position: relative; left: 0; width: 100vw; }
.tutorial-page #upper_video { width: 100%; height: 100%; object-fit: cover; }
.tutorial-page .middle_side { position: relative; width: 100vw; box-sizing: border-box; }
.tutorial-page #middle_side_title { font-size: 18px; font-weight: normal; display: contents; }
.tutorial-page #progress_text { position: absolute; right: 5vw; top: 10px; color: #323232; background: #FAC748; border-radius: 3px; padding: 5px 10px; font-size: 14px; }
.tutorial-page #middle_side_text { font-size: 14px; margin-top: 15px; }
.tutorial-page .instructions { display: none; line-height: 1.6; font-size: 14px; margin: 10px 0 12px; }
.tutorial-page .instructions ul { list-style-type: disc; padding-left: 20px; margin: 0; }
.tutorial-page .instructions li { margin-bottom: 12px; }
.tutorial-page .checklist-item-container { background: #fff; border-radius: 5px; box-shadow: 0 2px 8px rgba(0,0,0,.1); overflow: hidden; width: 90vw; margin: 10px auto; }
.tutorial-page .checklist-item { display: flex; align-items: center; padding: 12px 10px; }
.tutorial-page .icon { background: #242628; padding: 10px; border-radius: 4px; display: flex; align-items: center; justify-content: center; margin-right: 10px; }
.tutorial-page .icon img { width: 32px; height: 32px; }
.tutorial-page .text { flex-grow: 1; font-size: 14px; color: #333; width: 80%; }
.tutorial-page .checkmark { width: 24px; height: 24px; border-radius: 4px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 16px; margin-left: 5px; margin-right: 8px; border: 2px solid rgb(172,172,172); }
.tutorial-page .checkmark img { display: none; }
.tutorial-page .checkmark.checked { background: #000; border-color: #000; }
.tutorial-page .checkmark.checked img { display: block; }
.tutorial-page #continue_button { position: fixed; left: 0; right: 0; bottom: 24px; margin: 0 auto; width: min(90vw, 520px); height: 56px; border-radius: 200px; border: 0; background: #242628; color: #fff; font-family: 'Olney', sans-serif; font-size: 18px; }
.tutorial-page #continue_button.active { background: #242628; }
.tutorial-page .hand-tutorial-body { width: min(560px, 100%); margin: 0 auto; flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.tutorial-page .hand-check-card { display: flex; align-items: center; gap: 8px; width: 100%; border: none; cursor: pointer; text-align: left; font: inherit; color: inherit; background: #f2f4f8; border: 1px solid #d5dae3; border-radius: 12px; padding: 10px 12px; box-shadow: none; transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease; -webkit-tap-highlight-color: transparent; user-select: none; }
.tutorial-page .hand-check-card:hover { background: #e9edf5; border-color: #c7cdd9; }
.tutorial-page .hand-check-card:focus-visible { outline: 3px solid rgba(36,38,40,0.35); outline-offset: 4px; }
.tutorial-page .hand-check-card.checked { background: #e6e9f2; border-color: #b7bfd0; }
.tutorial-page .hand-check-card__icon { width: 48px; height: 48px; border-radius: 10px; background: #242628; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tutorial-page .hand-check-card__icon img { width: 28px; height: 28px; display: block; }
.tutorial-page .hand-check-card__label { font-size: 12px; line-height: 18px; color: #242628; flex: 1; font-family: 'Poppins', sans-serif; font-weight: 500; }
.tutorial-page .hand-check-card__check { width: 14px; height: 14px; border-radius: 4px; border: 2px solid #b7bfd0; background: #fff; display: inline-flex; align-items: center; justify-content: center; transition: background 0.2s ease, border-color 0.2s ease; }
.tutorial-page .hand-check-card__check img { width: 8px; height: 8px; display: block; opacity: 0; transition: opacity 0.2s ease; filter: brightness(0); }
.tutorial-page .hand-check-card__check.checked { background: #242628; border-color: #242628; }
.tutorial-page .hand-check-card__check.checked img { opacity: 1; filter: brightness(100); }
/* Foot capture floating button */
.capture-button { position: absolute; bottom: calc(env(safe-area-inset-bottom, 0px) + 100px); left: 50%; transform: translateX(-50%); width: 80px; height: 80px; border-radius: 50%; background: #fff; cursor: pointer; transition: box-shadow .3s ease, opacity .3s ease, transform .2s ease; z-index: 20; visibility: hidden; box-shadow: 0 0 0 6px rgba(255,255,255,.6); }
.capture-button.can-take { opacity: 1; pointer-events: auto; box-shadow: 0 0 0 6px rgba(255,255,255,.4), 0 0 5px rgba(0,0,0,.2); }
.capture-button.cannot-take { opacity: .25; pointer-events: none; box-shadow: 0 0 0 6px rgba(255,255,255,.4), 0 0 5px rgba(0,0,0,.2); }
/* Make tutorial header visible over video */
.tutorial-page .header {
  position: fixed !important;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: transparent !important;
  padding-top: 1.6vh !important;
  padding-bottom: 1.6vh !important;
  display: flex; align-items: center;
}
/* remove old global icon positions in favor of 1vh/3vw */
.info-page {
  min-height: 100vh;
}
/* Global header padding for all screens */
.header {
  padding-top: 3.6vh !important;
  padding-bottom: 3.6vh !important;
  display: flex;
  align-items: center;
}
/* Result (foot) page styles adapted from legacy */
.result-page { background: #ffffff; min-height: 100vh; }
.result-page .container { width: 90vw; margin: 0 auto; }
.result-page .header { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 16px); width: 100vw; display: flex; justify-content: center; }
.result-page .exit-button-class { position: absolute; right: 3vw; width: 24px; height: 24px; cursor: pointer; }
.result-page .center-div { text-align: center; color: #000000; }
.result-page .item { border-radius: 10px; display: flex; align-items: center; padding: 20px; background-color: #fff; margin-bottom: 20px; }
.result-page .recommended-size { margin-top: 5px; font-size: 1.75vh; border: 1px solid gray; border-radius: 5px; padding: 5px; width: fit-content; }
.result-page .size_text { color: #242628; font-weight: bold; }
.result-page .dialog-wrapper { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,.5); align-items: center; justify-content: center; display: none; z-index: 1000; }
.result-page .dialog { background: #fff; border-radius: 10px; box-shadow: 0 4px 6px rgba(0,0,0,.2); width: 80vw; max-width: 350px; text-align: center; }
.result-page #dialog_header { background: #242628; border-top-left-radius: 10px; border-top-right-radius: 10px; }
.result-page .dialog h2 { padding: 20px; color: #fff; margin: 0 0 10px; }
.result-page .dialog p { font-size: 14px; padding: 0 20px; color: #333; margin: 20px 0; }
.result-page .buttons { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; padding: 0 20px 20px; }
.result-page .buttons button { width: 100%; height: 5vh; min-height: 44px; padding: 10px; border: none; font-size: 16px; cursor: pointer; }
.result-page .buttons .cancel { background: #242628; color: #fff; border-radius: 40px; }
.result-page .buttons .leave { background: transparent; color: #000000; }
.result-page .center-bottom-button { position: fixed; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom, 0px) + 16px); width: 100%; text-align: center; z-index: 100; }
.result-page #rating-button { font-family: 'Olney', sans-serif; font-size: 18px; padding: 10px 20px; color: #fff; background: #242628; border-radius: 40px; border: 0; width: 90vw; min-height: 52px; }
/* Ensure content doesn't get hidden behind fixed bottom bar */
.result-page .container { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 120px); }

