:root {
  --bg-main: #1f1f22;
  --bg-panel: #2c2c2f;
  --accent: #ffd369;
  --input-bg: #3a3a3d;
  --btn-back: #3d3d3d;
  --btn-back-hover: #4a4a4a;
  --btn-next: #4ea8ff;
  --btn-next-hover: #379cfb;
  --text-main: #f2f2f2;
  --btn-warn: #ffb347;
  --btn-warn-hover: #e69f2f;
  --info-box-bg: #2b2b2b;
  --info-box-border: #ffcc00;
  --progress-bg: #444444;
  --progress-bar: #00d1b2;
  --placeholder-text: #bccac1;
  --step-shadow: rgba(0, 0, 0, 0.5);
  --border-default: #555555;
  --highlight-white: #ffffff;
  --light-text: #dddddd;
}

.input::placeholder {
  color: var(--placeholder-text);
  opacity: 1;
}

html, body {
  min-height: 100%;
  margin: 0;
  padding: 0;
  background: var(--bg-main);
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: 'Segoe UI', sans-serif;
  color: var(--text-main);
  overflow-x: hidden;
}

#app {
  width: 100%;
  max-width: 420px;
}

.language-switcher {
  position: fixed;
  top: 12px;
  right: 16px;
  z-index: 1000;
}

#language-selector {
  background-color: transparent;
  color: var(--highlight-white);
  border: 1px solid var(--highlight-white);
  padding: 4px 28px 4px 8px;
  font-weight: bold;
  font-size: 14px;
  border-radius: 4px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg%20fill%3D%22white%22%20height%3D%2220%22%20viewBox%3D%220%200%2024%2024%22%20width%3D%2220%22%20xmlns%3D%22http://www.w3.org/2000/svg%22%3E%3Cpath%20d%3D%22M7%2010l5%205%205-5z%22/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 16px;
}

#language-selector option {
  background: var(--bg-panel);
  color: var(--highlight-white);
}

.step {
  display: none;
  background: var(--bg-panel);
  padding: 2rem;
  border-radius: 20px;
  box-shadow: 0 0 20px var(--step-shadow);
  text-align: center;
  color: var(--text-main);
}

.step.active {
  display: block;
}

.step h2 {
  color: var(--accent);
}

.input,
.button {
  margin-top: 1rem;
}

.input {
  background-color: var(--input-bg);
  border: 1px solid var(--border-default);
  color: var(--text-main);
  padding: 0.6rem 1rem;
  border-radius: 6px;
  width: 100%;
  font-size: 1rem;
}

video,
canvas {
  max-width: 100%;
  margin: 0 0;
  border-radius: 10px;
}

.info-box {
  background: var(--info-box-bg);
  border-left: 5px solid var(--info-box-border);
  padding: 1rem;
  margin: 1rem 0;
  color: var(--text-main);
  border-radius: 10px;
  font-size: 0.95rem;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.3);
}

.info-box strong {
  color: var(--highlight-white);
  font-weight: 600;
}

.progress-container {
  width: 100%;
  height: 10px;
  background-color: var(--progress-bg);
  border-radius: 20px;
  overflow: hidden;
  margin-top: 10px;
  margin-bottom: 1rem;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background-color: var(--progress-bar);
  border-radius: 20px;
  transition: width 0.2s linear;
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  text-align: center;
  line-height: 1.2;
  transition: background-color 0.2s ease-in-out, box-shadow 0.2s;
  backdrop-filter: none !important;
  filter: none !important;
}

.button.is-light {
  background-color: var(--btn-back) !important;
  color: var(--light-text);
  border: none !important;
}

.button.is-info {
  background-color: var(--btn-next) !important;
  color: var(--highlight-white);
  border: 4px solid var(--highlight-white) !important;
}

.button.is-warning {
  background-color: var(--btn-warn);
  color: black;
  border: none;
}

.button.is-warning:hover,
.button.is-warning:active {
  background-color: var(--btn-warn-hover);
}

.button.is-light:hover,
.button.is-light:active {
  background-color: var(--btn-back-hover) !important;
}

.button.is-info:hover,
.button.is-info:active {
  background-color: var(--btn-next-hover) !important;
}

.video-mask-container {
  position: relative;
  display: inline-block;
  aspect-ratio: 16 / 9;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: none;
  width: 100%;
}

.video-mask-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.oval-mask-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  -webkit-mask-image: radial-gradient(ellipse 20.5% 48% at 50% 50%, transparent 0%, transparent 60%, black 60%);
  mask-image: radial-gradient(ellipse 20.5% 48% at 50% 50%, transparent 0%, transparent 60%, black 60%);
  -webkit-mask-composite: destination-out;
  mask-composite: exclude;
  background-image: radial-gradient(ellipse 20.5% 48% at 50% 50%, transparent 59%, white 60%, white 63%, transparent 64%);
  z-index: 10;
  pointer-events: none;
}

.step-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.step-controls {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
}

.step-controls .buttons,
.step .buttons.is-centered {
  display: flex;
  justify-content: center;
  gap: 0.1rem;
  flex-wrap: wrap;
}

.nav-buttons {
  display: flex;
  justify-content: space-between;
  gap: 0.1rem;
  margin-top: 0;
}

.nav-buttons .button {
  flex: 1;
  min-width: 40%;
}

@media screen and (orientation: landscape) {
  #app {
    max-width: 97vw;
  }

  .step-content {
    flex-direction: row;
    gap: 2rem;
    align-items: center;
    justify-content: center;
  }

  .step-media {
    flex: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .step-controls {
    flex: 1;
    gap: 0.5rem;
  }

  .info-box {
    font-size: 0.73rem !important;
    padding: 0.75rem;
    margin: 0;
  }

  .step-controls .buttons,
  .step-controls .nav-buttons,
  .step .buttons.is-centered {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
  }
}

@media screen and (min-width: 1024px) {
  #app {
    max-width: 75vw;
  }

  .info-box {
    font-size: 1.2rem !important;
    padding: 0.75rem;
    margin: 0;
  }
}


#orientation-warning {
    position: absolute;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    z-index: 1000;
}

.passport-video-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    overflow: hidden;
}

.passport-video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.passport-mask-overlay {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    aspect-ratio: 1.41 / 1; 
    margin: auto;
    right: 0;
    bottom: 0;
    border: 3px dashed rgba(255, 255, 255, 0.7);
    border-radius: 6px;
    pointer-events: none;
    z-index: 10;
}

#orientation-warning-step3 {
    position: absolute;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    z-index: 1000;
}