/* ================================================================
   FONT — Aeroport
   Place Aeroport.woff2 + Aeroport.woff in frontend/fonts/
================================================================ */
@font-face {
  font-family: 'Aeroport';
  src: url('./fonts/Aeroport.woff2') format('woff2'),
       url('./fonts/Aeroport.woff')  format('woff');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Aeroport';
  src: url('./fonts/Aeroport-Bold.woff2') format('woff2'),
       url('./fonts/Aeroport-Bold.woff')  format('woff');
  font-weight: 700;
  font-style: normal;
}

/* ================================================================
   RESET
================================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ================================================================
   BODY
   Dark blue background, everything centered
================================================================ */
html, body {
  width: 100%;
  min-height: 100%;
  background-color: #081a3e;   /* hardcoded — no var() fallback needed */
}

body {
  font-family: 'Aeroport', sans-serif;
  color: #ffffff;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;          /* anchor for the fixed overlay */
}

/* ================================================================
   SCREENS
   All hidden by default. Only .active is shown.
   Each screen is a full-viewport flex column, centered.
================================================================ */
.screen {
  display: none;               /* hidden */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 28px;
  max-width: 440px;
  width: 100%;
  min-height: 100vh;
}

.screen.active {
  display: flex;               /* visible */
}

/* ================================================================
   ACCENT LINE — cyan bar above headings
================================================================ */
.accent-line {
  width: 48px;
  height: 4px;
  background: #00b1eb;
  border-radius: 2px;
  margin: 0 auto 28px auto;
}

/* ================================================================
   TYPOGRAPHY
================================================================ */
h1 {
  font-family: 'Aeroport', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 14px;
  line-height: 1.3;
}

p {
  font-family: 'Aeroport', sans-serif;
  font-size: 16px;
  color: #c8d8f0;
  margin-bottom: 24px;
  line-height: 1.7;
}

/* ================================================================
   INSTRUCTION LIST
================================================================ */
ul {
  list-style: none;
  margin-bottom: 32px;
  text-align: left;
  width: 100%;
}

ul li {
  font-size: 15px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(0, 177, 235, 0.18);
  color: #c8d8f0;
  display: flex;
  align-items: center;
  gap: 12px;
}

ul li:last-child {
  border-bottom: none;
}

/* ================================================================
   BUTTONS

   Primary  → orange  #ef7d00
   Secondary → outlined cyan #00b1eb
================================================================ */
button {
  width: 100%;
  padding: 16px;
  font-family: 'Aeroport', sans-serif;
  font-size: 16px;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  background-color: #ef7d00;   /* orange — hardcoded */
  color: #ffffff;
  cursor: pointer;
  margin-bottom: 12px;
  letter-spacing: 0.3px;
  transition: background-color 0.2s, transform 0.1s;
  -webkit-appearance: none;    /* reset iOS default button styles */
  appearance: none;
}

button:hover  { background-color: #d46e00; }
button:active { transform: scale(0.98); }

button.secondary {
  background-color: transparent;
  border: 2px solid #00b1eb;
  color: #00b1eb;
}

button.secondary:hover {
  background-color: rgba(0, 177, 235, 0.1);
}

/* ================================================================
   CAMERA VIDEO
================================================================ */
video {
  width: 100%;
  border-radius: 16px;
  margin-bottom: 20px;
  background: #000000;
  border: 2px solid rgba(0, 177, 235, 0.3);
}

/* ================================================================
   SPINNER
================================================================ */
.spinner {
  width: 52px;
  height: 52px;
  border: 4px solid rgba(0, 177, 235, 0.2);
  border-top-color: #00b1eb;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 28px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ================================================================
   RESULT SCREENS
================================================================ */
.result-icon {
  font-size: 64px;
  margin-bottom: 16px;
  line-height: 1;
}

/* Allowed — green title */
#screen-result.allowed h1 {
  color: #50af47;
}

/* Denied — orange title */
#screen-result.denied h1 {
  color: #ef7d00;
}

/* ================================================================
   COUNTDOWN BAR
   A thin bar that drains from full to empty over N seconds
================================================================ */
.countdown-wrap {
  width: 100%;
  margin-top: 32px;
}

.countdown-label {
  font-size: 12px;
  color: #00b1eb;
  margin-bottom: 8px;
  opacity: 0.8;
}

.countdown-bar-track {
  width: 100%;
  height: 4px;
  background: rgba(0, 177, 235, 0.15);
  border-radius: 2px;
  overflow: hidden;
}

.countdown-bar-fill {
  height: 100%;
  width: 100%;
  background: #00b1eb;
  border-radius: 2px;
  /* The JS sets width to 0% over N seconds using this transition */
  transition: width linear;
}

/* ================================================================
   DECLINE THANK-YOU SCREEN
   Shows after user refuses consent — just "Thank you" + countdown
================================================================ */
#screen-thankyou-decline h1 {
  font-size: 36px;
  margin-bottom: 16px;
}

#decline-countdown-label {
  font-size: 14px;
  color: #00b1eb;
  opacity: 0.8;
}

/* ================================================================
   EXPIRED OVERLAY
   Full-screen dark cover shown when the session expires.
   Sits on top of everything.

   IMPORTANT: hidden by default with display:none.
   JS adds class .visible to show it.
================================================================ */
#expired-overlay {
  display: none;               /* hidden — JS adds .visible to show */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background-color: #081a3e;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
  z-index: 9999;
}

#expired-overlay.visible {
  display: flex;
}

#expired-overlay h1 {
  color: #00b1eb;
  margin-bottom: 12px;
}

#expired-overlay p {
  color: #c8d8f0;
  font-size: 15px;
}

/* ================================================================
   CAMERA WRAPPER
   Stacks video and canvas on top of each other using CSS grid.
   Both occupy the same grid cell so they overlap perfectly.
================================================================ */
.camera-wrapper {
  position: relative;
  width: 100%;
  margin-bottom: 20px;
}

/* Video fills the wrapper */
.camera-wrapper video {
  width: 100%;
  border-radius: 16px;
  display: block;
  margin-bottom: 0;    /* override the global video margin */
  border: none;        /* border handled by overlay canvas */
  background: #000;
  transform: scaleX(-1); /* mirror the video for a more natural selfie view */ 
}

.camera-wrapper canvas#photo-preview {
  width: 100%;
  border-radius: 16px;
  display: block;
  background: #000;
  transform: scaleX(-1);   /* mirror to match what user saw live */
}

/* Canvas sits exactly on top of the video */
.camera-wrapper canvas#overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 16px;
  pointer-events: none;   /* clicks pass through to video/button */
}

/* Text feedback pill below the oval */
.face-feedback {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(8, 26, 62, 0.82);
  color: #ffffff;
  font-family: 'Aeroport', sans-serif;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: 0.3px;
  backdrop-filter: blur(4px);
  transition: color 0.2s;
}

/* ================================================================
   CAPTURE BUTTON STATES
================================================================ */

/* Disabled — grayed out, not clickable */
#btn-capture:disabled {
  background-color: #2a3a5a;
  color: #5a7aaa;
  cursor: not-allowed;
  transform: none;
}

/* Ready — pulses gently to invite the tap */
#btn-capture.ready {
  background-color: #50af47;   /* green */
  animation: pulse-ready 1.2s ease-in-out infinite;
}

@keyframes pulse-ready {
  0%, 100% { box-shadow: 0 0 0 0   rgba(80, 175, 71, 0.5); }
  50%       { box-shadow: 0 0 0 12px rgba(80, 175, 71, 0);  }
}