/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  font-family: 'Open Sans', Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  color: #000;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

input, select, textarea, button { font-family: inherit; }

.hidden { display: none !important; }

/* ============================================
   SPLASH LOADER — covers page during async restore
   ============================================ */
.splash-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: linear-gradient(160deg, #1a3a4a 0%, #116b57 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.35s ease;
}
.splash-loader.fade-out {
  opacity: 0;
  pointer-events: none;
}
.splash-loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}
.splash-logo {
  display: block;
  width: 220px;
  height: auto;
  opacity: 0.9;
}
.splash-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(255,255,255,0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: splash-spin 0.7s linear infinite;
}
@keyframes splash-spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   MOBILE APP VIEW
   ============================================ */
.mobile-view {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.bg-image {
  position: absolute;
  inset: 0;
  background: url('/assets/images/background.jpg') center center / cover no-repeat;
  z-index: 0;
}

.bg-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.15);
  z-index: 1;
}

/* --- Progress bar --- */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255,255,255,0.2);
  z-index: 100;
  display: none;
}
.progress-bar.visible { display: block; }
.progress-fill {
  height: 100%;
  background: #17db4e;
  width: 0%;
  transition: width 0.4s ease;
}

/* --- Steps --- */
.step {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: none;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.step.active { display: flex; }

.step-header {
  position: sticky;
  top: 0;
  background: linear-gradient(135deg, #1a3a4a, #116b57);
  color: #fff;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  padding: 14px 16px;
  z-index: 20;
  border-bottom: 2px solid rgba(255,255,255,0.15);
}

.step-content {
  position: relative;
  z-index: 10;
  flex: 1;
  padding: 20px 16px 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.step-content.centered-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.step-content .btn-footer {
  position: sticky;
  bottom: 0;
  z-index: 50;
  width: calc(100% + 32px);
  margin: auto -16px 0 -16px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #e8e8e8;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.btn-footer .btn-primary,
.btn-footer .btn-secondary {
  width: 100%;
  max-width: 360px;
  margin: 0;
}
.btn-footer .btn-link {
  margin: 0;
}

/* Form steps get a solid white bg — applied to .step
   so the background fills the entire screen edge-to-edge, top-to-bottom */
#step-traveler-type,
#step-manage-travelers,
#step-scan-passport-splash,
#step-passport-manual,
#step-passport-photo,
#step-face-scan-splash,
#step-verify-data,
#step-contact,
#step-destination,
#step-flight-arrival,
#step-departure-question,
#step-departure,
#step-customs,
#step-review,
#step-signature,
#step-complete {
  background: #fff;
}

/* --- Landing page --- */
.landing-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 15px;
}

.logo-wrapper {
  width: 90%;
  max-width: 360px;
  margin-bottom: 0;
}

.logo {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0.83;
}

/* Frosted card on landing */
.card.frosted {
  background-color: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 16px 2px rgba(0, 0, 0, 0.35);
  border-radius: 10px;
  padding: 10px 0 20px;
  width: 94%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.welcome-text {
  font-size: 15px;
  font-weight: 400;
  color: #fff;
  text-align: center;
  line-height: 1.4;
  max-width: 320px;
  width: 100%;
  padding: 0 10px;
  margin: 15px 0 10px;
}

.disclaimer-text {
  font-size: 10px;
  font-weight: 400;
  font-style: italic;
  color: #fff;
  text-align: center;
  line-height: 1.4;
  max-width: 320px;
  width: 100%;
  padding: 0 10px;
  margin: 5px 0;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary {
  display: block;
  width: 100%;
  max-width: 340px;
  background-color: #116b57;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  line-height: 1;
  border: none;
  border-radius: 10px;
  padding: 14px 24px;
  margin: 8px auto;
  cursor: pointer;
  transition: background 200ms, opacity 200ms;
}
.btn-primary:hover { background-color: #0e5a49; }
.btn-primary:active { background-color: #0a4538; }

.btn-start {
  background-color: rgba(255, 255, 255, 0.8);
  color: #000;
  border: 1px solid #5b5b5b;
  font-size: 15px;
  font-weight: 600;
  border-radius: 10px;
  padding: 12px 24px;
  margin: 5px 0;
  width: 85%;
  max-width: 320px;
  cursor: pointer;
  transition: background 200ms;
  text-decoration: none;
  text-align: center;
}
.btn-start:hover { background-color: rgba(255,255,255,0.95); }

.btn-secondary {
  display: block;
  width: 100%;
  max-width: 340px;
  background-color: #fff;
  color: #116b57;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  border: 2px solid #116b57;
  border-radius: 10px;
  padding: 12px 24px;
  margin: 8px auto;
  cursor: pointer;
  transition: background 200ms;
}
.btn-secondary:hover { background-color: #f0faf5; }

.btn-back {
  flex: 0 0 auto;
  background: #e0e0e0;
  color: #333;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  cursor: pointer;
  transition: background 200ms;
}
.btn-back:hover { background-color: #d0d0d0; }

.btn-back-top {
  margin-bottom: 12px;
}

.btn-link {
  background: none;
  border: none;
  color: #116b57;
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  margin: 8px auto;
  display: block;
}

.btn-row {
  display: flex;
  gap: 12px;
  align-items: center;
  position: sticky;
  bottom: 0;
  z-index: 50;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  margin: auto -16px 0 -16px;
  width: calc(100% + 32px);
  border-top: 1px solid #e8e8e8;
}
.btn-row .btn-primary { flex: 1; margin: 0; }
.btn-row .btn-back { flex: 0 0 auto; }
.btn-row .btn-primary.btn-full { flex: 1; width: 100%; }

.btn-continue {
  margin-top: 20px;
}

/* ============================================
   TRAVELER TYPE CARDS
   ============================================ */
.type-card {
  background: rgba(255,255,255,0.85);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.type-card:hover, .type-card:active {
  border-color: #116b57;
  box-shadow: 0 2px 12px rgba(17,107,87,0.2);
}

.type-desc {
  font-size: 12px;
  color: #555;
  margin-bottom: 10px;
  text-align: center;
}

.type-option {
  display: flex;
  align-items: center;
  gap: 12px;
}

.type-icon { font-size: 28px; }

.type-option strong { font-size: 16px; }

.type-sub { font-size: 12px; color: #555; }

.or-divider {
  text-align: center;
  color: #888;
  font-size: 14px;
  font-weight: 600;
  margin: 4px 0;
}

/* ============================================
   MANAGE TRAVELERS
   ============================================ */
.form-title {
  font-size: 17px;
  font-weight: 700;
  color: #1a3a4a;
  margin-bottom: 12px;
}

.info-box {
  background: #f0faf5;
  border-left: 4px solid #116b57;
  border-radius: 6px;
  padding: 12px;
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.5;
}

.warning-text {
  color: #c0392b;
  margin-top: 8px;
}

.instruction-text {
  font-size: 13px;
  color: #666;
  text-align: center;
  margin-bottom: 12px;
}

.btn-add-traveler {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: #fff;
  border: 2px dashed #bbb;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  cursor: pointer;
  margin-bottom: 8px;
  transition: border-color 0.2s;
}
.btn-add-traveler:hover { border-color: #116b57; }

.plus-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e8f5e9;
  color: #116b57;
  font-size: 18px;
  font-weight: 700;
}

/* Traveler card in the list */
.traveler-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.traveler-card .traveler-photo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  overflow: hidden;
}
.traveler-card .traveler-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.traveler-card .traveler-info {
  flex: 1;
  min-width: 0;
}
.btn-edit-traveler {
  flex: 0 0 auto;
  background: #e8f5f1;
  color: #116b57;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid #116b57;
  border-radius: 8px;
  padding: 6px 14px;
  cursor: pointer;
  transition: background 200ms;
}
.btn-edit-traveler:hover {
  background: #d0ebe4;
}
.traveler-card .traveler-name {
  font-weight: 600;
  font-size: 14px;
}
.traveler-card .traveler-passport {
  font-size: 12px;
  color: #666;
}

/* ============================================
   PROGRESSIVE DISCLOSURE ARROW
   ============================================ */
.dest-arrow-indicator {
  display: none;
  text-align: center;
  padding: 2px 0 6px;
  color: #116b57;
  font-size: 20px;
  opacity: 0.7;
  animation: dest-arrow-bounce 1s ease-in-out 3;
}
.dest-arrow-indicator.visible {
  display: block;
}
.dest-arrow-indicator.no-animate {
  animation: none;
  opacity: 0.5;
}
@keyframes dest-arrow-bounce {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(6px); opacity: 1; }
}

/* ============================================
   FORM FIELDS
   ============================================ */
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
  color: #000;
  -webkit-user-select: text;
  user-select: text;
  transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #116b57;
  box-shadow: 0 0 0 2px rgba(17,107,87,0.15);
}
/* Date inputs: constrain to container width, match height of other fields */
.form-group input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  min-width: 0;
  min-height: 44px;
}
/* intl-tel-input wrapper: stretch to full width */
.form-group .iti {
  display: block;
  width: 100%;
}

/* ============================================
   SEARCHABLE DROPDOWN
   ============================================ */
.search-dropdown {
  position: relative;
}
.search-dropdown input {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
  color: #000;
  -webkit-user-select: text;
  user-select: text;
  transition: border-color 0.2s;
}
.search-dropdown input:focus {
  outline: none;
  border-color: #116b57;
  box-shadow: 0 0 0 2px rgba(17,107,87,0.15);
}
.search-dropdown-list {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 100;
  max-height: 200px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #ccc;
  border-top: none;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  -webkit-overflow-scrolling: touch;
}
.search-dropdown.open .search-dropdown-list {
  display: block;
}
.search-dropdown.open input {
  border-radius: 8px 8px 0 0;
}
.search-dropdown-item {
  padding: 10px 12px;
  font-size: 15px;
  color: #333;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
}
.search-dropdown-item:last-child {
  border-bottom: none;
}
.search-dropdown-item:active,
.search-dropdown-item.highlighted {
  background: #e8f5f1;
  color: #116b57;
}
.search-dropdown-empty {
  padding: 10px 12px;
  font-size: 14px;
  color: #999;
  font-style: italic;
}

/* ============================================
   SPLASH / CAMERA SCREENS
   ============================================ */
.splash-icon { font-size: 56px; margin-bottom: 16px; }
.splash-text { font-size: 14px; color: #444; max-width: 320px; margin: 8px auto 12px; }
.splash-sub { font-size: 12px; color: #888; max-width: 300px; margin: 4px auto 16px; }

.scan-content { padding: 0; display: flex; flex-direction: column; }

.camera-container {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 300px;
  background: #000;
  overflow: hidden;
}
.camera-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Hide until stream is ready — prevents iOS play-button flash and zoom glitch */
  opacity: 0;
  transition: opacity 0.25s ease;
}
.camera-container video.stream-ready {
  opacity: 1;
}
/* Remove iOS default video styling */
.camera-container video::-webkit-media-controls {
  display: none !important;
}
.camera-container video::-webkit-media-controls-panel {
  display: none !important;
}
.camera-container video::-webkit-media-controls-play-button {
  display: none !important;
}
.scan-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.scan-frame {
  border: 3px solid rgba(255,255,255,0.7);
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.4);
}
.passport-frame {
  width: 80%;
  max-width: 320px;
  aspect-ratio: 1.42 / 1;
  border-radius: 8px;
}
.scan-instruction {
  color: #fff;
  font-size: 13px;
  margin-top: 16px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

/* Face scan step: full-screen dark, no scroll */
#step-face-scan {
  background: #000 !important;
  overflow: hidden !important;
}

/* ============================================
   FACE SCAN CAMERA — Full-screen dark UI
   ============================================ */
.face-cam-ui {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-flex-direction: column;
  flex-direction: column;
  background: #000;
  z-index: 15;
}

/* Top bar — close, timer */
.face-cam-top {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-box-pack: justify;
  -webkit-justify-content: space-between;
  justify-content: space-between;
  padding: 12px 16px;
  z-index: 30;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
}
.face-cam-close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  cursor: pointer;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
}
.face-cam-timer {
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  min-height: 22px;
  -webkit-box-flex: 1;
  -webkit-flex: 1;
  flex: 1;
  letter-spacing: 0.5px;
}
.face-cam-timer.timer-active {
  color: #4caf50;
}
.face-cam-top-spacer { width: 40px; -webkit-flex-shrink: 0; flex-shrink: 0; }

/* Camera viewport — fills remaining space */
.face-cam-viewport {
  position: relative;
  -webkit-box-flex: 1;
  -webkit-flex: 1 1 0%;
  flex: 1 1 0%;
  min-height: 0;
  overflow: hidden;
  background: #000;
}
.face-cam-viewport video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  -webkit-transition: opacity 0.25s ease;
  transition: opacity 0.25s ease;
  -webkit-transform: scaleX(-1);
  transform: scaleX(-1);
}
.face-cam-viewport video.stream-ready {
  opacity: 1;
}
.face-cam-viewport video::-webkit-media-controls { display: none !important; }
.face-cam-viewport video::-webkit-media-controls-panel { display: none !important; }
.face-cam-viewport video::-webkit-media-controls-play-button { display: none !important; }

/* Oval guide overlay — centered in viewport */
.face-cam-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  pointer-events: none;
}
.face-cam-guide {
  position: relative;
  width: 220px;
  height: 280px;
}
.face-cam-oval {
  width: 100%;
  height: 100%;
  border: 3px solid rgba(255,255,255,0.6);
  border-radius: 50%;
  -webkit-box-shadow: 0 0 0 9999px rgba(0,0,0,0.45);
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.45);
  -webkit-transition: border-color 0.3s ease, border-width 0.3s ease, box-shadow 0.3s ease;
  transition: border-color 0.3s ease, border-width 0.3s ease, box-shadow 0.3s ease;
}
.face-cam-oval.face-detected {
  border-color: #4caf50;
  -webkit-box-shadow: 0 0 0 9999px rgba(0,0,0,0.45), 0 0 20px 4px rgba(76,175,80,0.35);
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.45), 0 0 20px 4px rgba(76,175,80,0.35);
}
.face-cam-oval.face-capturing {
  border-color: #4caf50;
  border-width: 5px;
  -webkit-box-shadow: 0 0 0 9999px rgba(0,0,0,0.45), 0 0 30px 8px rgba(76,175,80,0.5);
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.45), 0 0 30px 8px rgba(76,175,80,0.5);
}
.face-cam-oval.face-too-close {
  border-color: #ff6b35;
  -webkit-box-shadow: 0 0 0 9999px rgba(0,0,0,0.45), 0 0 16px 4px rgba(255,107,53,0.35);
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.45), 0 0 16px 4px rgba(255,107,53,0.35);
}
.face-cam-oval.face-too-far {
  border-color: #ffc107;
  -webkit-box-shadow: 0 0 0 9999px rgba(0,0,0,0.45), 0 0 16px 4px rgba(255,193,7,0.3);
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.45), 0 0 16px 4px rgba(255,193,7,0.3);
}

/* Instructions area */
.face-cam-instructions {
  padding: 16px 20px 8px;
  text-align: center;
  z-index: 30;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
}
.face-cam-instruction-text {
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  margin: 0;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
  -webkit-transition: color 0.3s ease;
  transition: color 0.3s ease;
  min-height: 22px;
}
.face-cam-instruction-text.face-ok {
  color: #4caf50;
  font-weight: 600;
}
.face-cam-status {
  color: rgba(255,255,255,0.5);
  font-size: 12px;
  margin: 6px 0 0;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  min-height: 16px;
}

/* Bottom bar — capture + camera switch */
.face-cam-bottom {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-box-pack: justify;
  -webkit-justify-content: space-between;
  justify-content: space-between;
  padding: 12px 32px 20px;
  z-index: 30;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
}
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .face-cam-bottom {
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }
}
.face-cam-bottom-spacer { width: 48px; -webkit-flex-shrink: 0; flex-shrink: 0; }

/* Capture button — large shutter-style */
.face-cam-capture {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 4px solid #fff;
  background: transparent;
  cursor: pointer;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  padding: 0;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
}
.face-cam-capture:active {
  -webkit-transform: scale(0.92);
  transform: scale(0.92);
}
.face-cam-capture-ring {
  display: block;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #fff;
}

/* Camera switch button */
.face-cam-switch {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  cursor: pointer;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
}
.face-cam-switch svg { pointer-events: none; }
.scan-content .btn-primary,
.scan-content .btn-link {
  position: relative;
  z-index: 20;
  margin: 12px auto;
}

/* ============================================
   PASSPORT SCAN CAMERA — Full-screen dark UI (MRZ Scanner)
   ============================================ */
#step-passport-scan {
  background: #000 !important;
  overflow: hidden !important;
}
.passport-cam-ui {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-flex-direction: column;
  flex-direction: column;
  background: #000;
  z-index: 15;
}

/* Top bar — close, status */
.passport-cam-top {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-box-pack: justify;
  -webkit-justify-content: space-between;
  justify-content: space-between;
  padding: 12px 16px;
  z-index: 30;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
}
.passport-cam-close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  cursor: pointer;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
}
.passport-cam-status {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  min-height: 22px;
  -webkit-box-flex: 1;
  -webkit-flex: 1;
  flex: 1;
  letter-spacing: 0.3px;
}
.passport-cam-status.mrz-found {
  color: #4caf50;
}
.passport-cam-top-spacer { width: 40px; -webkit-flex-shrink: 0; flex-shrink: 0; }

/* Camera viewport */
.passport-cam-viewport {
  position: relative;
  -webkit-box-flex: 1;
  -webkit-flex: 1 1 0%;
  flex: 1 1 0%;
  min-height: 0;
  overflow: hidden;
  background: #000;
}
.passport-cam-viewport video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  -webkit-transition: opacity 0.25s ease;
  transition: opacity 0.25s ease;
}
.passport-cam-viewport video.stream-ready {
  opacity: 1;
}
.passport-cam-viewport video::-webkit-media-controls { display: none !important; }
.passport-cam-viewport video::-webkit-media-controls-panel { display: none !important; }
.passport-cam-viewport video::-webkit-media-controls-play-button { display: none !important; }

/* Passport guide overlay */
.passport-cam-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  pointer-events: none;
}
.passport-cam-guide {
  position: relative;
  width: 88%;
  max-width: 360px;
  /* Passport aspect ratio ~1.42:1 (ID-3 format: 125mm x 88mm) */
  aspect-ratio: 1.42 / 1;
}
/* Fallback for browsers without aspect-ratio (older iOS) */
@supports not (aspect-ratio: 1 / 1) {
  .passport-cam-guide {
    height: 0;
    padding-bottom: 70.4%; /* 1/1.42 ≈ 70.4% */
  }
}
.passport-cam-frame {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 2px solid rgba(255,255,255,0.6);
  border-radius: 10px;
  -webkit-box-shadow: 0 0 0 9999px rgba(0,0,0,0.5);
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.5);
  -webkit-transition: border-color 0.3s ease, border-width 0.3s ease, box-shadow 0.3s ease;
  transition: border-color 0.3s ease, border-width 0.3s ease, box-shadow 0.3s ease;
}
.passport-cam-frame.mrz-detected {
  border-color: #4caf50;
  -webkit-box-shadow: 0 0 0 9999px rgba(0,0,0,0.5), 0 0 20px 4px rgba(76,175,80,0.3);
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.5), 0 0 20px 4px rgba(76,175,80,0.3);
}
.passport-cam-frame.mrz-capturing {
  border-color: #4caf50;
  border-width: 4px;
  -webkit-box-shadow: 0 0 0 9999px rgba(0,0,0,0.5), 0 0 30px 8px rgba(76,175,80,0.5);
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.5), 0 0 30px 8px rgba(76,175,80,0.5);
}
.passport-cam-frame.mrz-invalid {
  border-color: #ff6b35;
  -webkit-box-shadow: 0 0 0 9999px rgba(0,0,0,0.5), 0 0 16px 4px rgba(255,107,53,0.3);
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.5), 0 0 16px 4px rgba(255,107,53,0.3);
}

/* MRZ zone highlight at bottom of passport frame */
.passport-cam-mrz-zone {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  height: 22%;
  border: 1px dashed rgba(255,255,255,0.35);
  border-radius: 0 0 8px 8px;
  overflow: hidden;
}
.mrz-scan-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: -webkit-linear-gradient(left, transparent, rgba(76,175,80,0.8), transparent);
  background: linear-gradient(90deg, transparent, rgba(76,175,80,0.8), transparent);
  top: 0;
  opacity: 0;
}
.mrz-scan-line.scanning {
  opacity: 1;
  -webkit-animation: mrz-scan-sweep 1.5s ease-in-out infinite;
  animation: mrz-scan-sweep 1.5s ease-in-out infinite;
}
@-webkit-keyframes mrz-scan-sweep {
  0% { top: 0; }
  50% { top: 100%; }
  100% { top: 0; }
}
@keyframes mrz-scan-sweep {
  0% { top: 0; }
  50% { top: 100%; }
  100% { top: 0; }
}

/* Instructions area */
.passport-cam-instructions {
  padding: 16px 20px 8px;
  text-align: center;
  z-index: 30;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
}
.passport-cam-instruction-text {
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  margin: 0;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
  -webkit-transition: color 0.3s ease;
  transition: color 0.3s ease;
  min-height: 22px;
}
.passport-cam-instruction-text.mrz-ok {
  color: #4caf50;
  font-weight: 600;
}
.passport-cam-detail {
  color: rgba(255,255,255,0.5);
  font-size: 12px;
  margin: 6px 0 0;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  min-height: 16px;
}

/* Bottom bar */
.passport-cam-bottom {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  padding: 8px 32px 20px;
  z-index: 30;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
}
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .passport-cam-bottom {
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }
}
.passport-cam-manual-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  padding: 10px 16px;
}
.passport-cam-manual-btn:active {
  color: #fff;
}

/* ============================================
   PASSPORT PHOTO
   ============================================ */
/* Scanned passport preview on details page */
.passport-scan-preview {
  margin: 0 0 16px;
  text-align: center;
}
.passport-scan-preview img {
  max-width: 100%;
  border-radius: 8px;
  border: 2px solid #059669;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.photo-preview-container { margin: 16px 0; }
.photo-placeholder {
  width: 140px;
  height: 180px;
  border: 2px dashed #ccc;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  font-size: 13px;
  overflow: hidden;
  margin: 0 auto;
}
.photo-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================
   VERIFY DATA
   ============================================ */
.verify-selfie-container {
  text-align: center;
  margin-bottom: 16px;
}
.verify-selfie-wrapper {
  position: relative;
  display: inline-block;
  cursor: pointer;
  border-radius: 50%;
}
.verify-selfie {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #116b57;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  display: block;
}
.selfie-retake-overlay {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 0 0 60px 60px;
  width: 100%;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  pointer-events: none;
}
.retake-icon {
  font-size: 13px;
}
.retake-label {
  font-size: 11px;
}
.verify-card {
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 16px;
}
.verify-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid #eee;
  font-size: 13px;
}
.verify-row:last-child { border-bottom: none; }
.verify-label { color: #777; font-weight: 600; }
.verify-value { color: #222; text-align: right; max-width: 55%; }

/* ============================================
   CUSTOMS YES/NO
   ============================================ */
.customs-question {
  background: #f9f9f9;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
}
.q-text { font-size: 13px; color: #333; margin-bottom: 10px; }

/* --- Departure Method Picker --- */
.departure-method-prompt {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  text-align: center;
  margin: 4px 0 16px;
}
.departure-method-buttons {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}
.dep-method-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 12px;
  border: 2px solid #ddd;
  border-radius: 12px;
  background: #fff;
  font-size: 15px;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  transition: all 0.2s ease;
}
.dep-method-btn svg {
  width: 32px;
  height: 32px;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.dep-method-btn:hover {
  border-color: #116b57;
  color: #116b57;
}
.dep-method-btn:hover svg {
  opacity: 0.9;
}
.dep-method-btn.selected {
  border-color: #116b57;
  background: #e8f5ef;
  color: #116b57;
}
.dep-method-btn.selected svg {
  opacity: 1;
  stroke: #116b57;
}

.yn-buttons { display: flex; gap: 10px; }
.btn-yn {
  flex: 1;
  padding: 10px;
  border: 2px solid #ccc;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-yn.selected-yes {
  background: #e8f5e9;
  border-color: #4caf50;
  color: #2e7d32;
}
.btn-yn.selected-no {
  background: #ffebee;
  border-color: #ef5350;
  color: #c62828;
}

/* ============================================
   REVIEW
   ============================================ */
.review-section {
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  margin-bottom: 10px;
  overflow: hidden;
  flex-shrink: 0;
}
.review-heading {
  background: #1a3a4a;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.review-heading:active { background: #15303d; }
.review-heading-title { flex-shrink: 0; }
.review-summary {
  flex: 1;
  font-weight: 400;
  font-size: 12px;
  color: rgba(255,255,255,0.65);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
  padding-right: 4px;
}
.review-chevron {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-right: 2px solid rgba(255,255,255,0.6);
  border-bottom: 2px solid rgba(255,255,255,0.6);
  transform: rotate(45deg);
  transition: transform 0.25s ease;
  margin-top: -2px;
}
.review-section.open .review-chevron {
  transform: rotate(-135deg);
  margin-top: 2px;
}
.review-body {
  font-size: 13px;
  display: none;
  padding: 12px 14px;
}
.review-section.open .review-body {
  display: block;
}
.review-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid #eee;
}
.review-row:last-child { border-bottom: none; }
.review-label { color: #777; font-size: 12px; }
.review-value { color: #222; font-weight: 600; font-size: 13px; text-align: right; }
.btn-review-edit {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 8px 0;
  background: none;
  border: 1.5px solid #116b57;
  border-radius: 8px;
  color: #116b57;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 200ms, color 200ms;
}
.btn-review-edit:hover { background: #116b57; color: #fff; }
.btn-review-edit:active { background: #0e5a49; color: #fff; }
.btn-row-review-edit {
  display: flex;
  gap: 12px;
  align-items: center;
  position: sticky;
  bottom: 0;
  z-index: 50;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 12px 16px;
  margin: auto -16px 0 -16px;
  width: calc(100% + 32px);
  border-top: 1px solid #e8e8e8;
}
.btn-row-review-edit .btn-primary { flex: 1; margin: 0; }
.btn-row-review-edit .btn-back { flex: 0 0 auto; }

/* ============================================
   SIGNATURE
   ============================================ */
.signature-container {
  width: 100%;
  height: 200px;
  border: 2px solid #ccc;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  margin: 12px 0;
}
.signature-container canvas {
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* ============================================
   COMPLETE / QR CODE
   ============================================ */
.complete-content { background: rgba(255,255,255,0.95) !important; }
.complete-check {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #4caf50;
  color: #fff;
  font-size: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.qr-container {
  background: #fff;
  padding: 16px;
  border-radius: 10px;
  margin: 16px auto;
  display: inline-block;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.qr-container canvas { display: block; }
.qr-instruction { font-size: 13px; color: #555; margin-bottom: 8px; }
.confirmation-id { font-size: 14px; font-weight: 700; color: #1a3a4a; margin-bottom: 20px; }

/* ============================================
   DESKTOP VIEW — hidden, app works on all screens
   ============================================ */
.desktop-view { display: none !important; }

@media screen and (min-width: 768px) {
  html, body {
    background: #1a3a4a;
    overflow: hidden;
  }
  .mobile-view {
    position: fixed;
    inset: 0;
    width: 430px;
    margin: 0 auto;
    box-shadow: 0 0 40px rgba(0,0,0,0.5);
    border-left: 1px solid rgba(255,255,255,0.1);
    border-right: 1px solid rgba(255,255,255,0.1);
  }
  .progress-bar {
    width: 430px;
    left: 50%;
    transform: translateX(-50%);
  }
}
