:root {
  --sber-green: #21a038;
  --sber-green-dark: #0d8522;
  --sber-lime: #a6ff00;
  --sky: #5ecfff;
  --ink: #0f1f17;
  --muted: rgba(15, 31, 23, 0.72);
  --card: rgba(255, 255, 255, 0.92);
  --accent: #ff4fa3;
  --video-aspect: 9 / 16;
  --radius: 22px;
  /* Киоск: физический экран 1008×672, прибит к верхнему левому углу */
  --kiosk-w: 1008px;
  --kiosk-h: 672px;
  --kiosk-scale: 1;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: "SB Sans Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: #0a1a12;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}

.shell {
  position: relative;
  z-index: 1;
  width: var(--kiosk-w);
  height: var(--kiosk-h);
  padding: 0;
  overflow: hidden;
  transform: scale(var(--kiosk-scale));
  transform-origin: top left;
  flex-shrink: 0;
  background: #dff6e8;
}

.kiosk-bg-video,
.kiosk-bg-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.kiosk-bg-video {
  object-fit: cover;
  z-index: 0;
}

.kiosk-bg-fallback {
  z-index: 0;
  background:
    radial-gradient(circle at 30% 20%, rgba(166, 255, 0, 0.35), transparent 45%),
    radial-gradient(circle at 75% 30%, rgba(94, 207, 255, 0.45), transparent 40%),
    linear-gradient(160deg, #b8f5c8 0%, #7ee8ff 55%, #e8ffd6 100%);
}

.kiosk-bg-video[data-ready="true"] + .kiosk-bg-fallback {
  opacity: 0;
  transition: opacity 0.45s ease;
}

.kiosk-screen {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}

.kiosk-screen.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.kiosk-screen.is-hiding {
  opacity: 0;
  pointer-events: none;
}

.kiosk-panel {
  padding: 20px 28px 24px;
  display: flex;
  flex-direction: column;
  background: transparent;
  box-shadow: none;
}

/* —— Старт (Figma Frame 2147223866) —— */
.kiosk-start {
  color: #fff;
}

.kiosk-brand-logo {
  position: absolute;
  left: 40px;
  top: 40px;
  z-index: 8;
  width: 185px;
  height: 103px;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  transition: left 0.45s ease, top 0.45s ease, width 0.45s ease, height 0.45s ease;
}

.kiosk-start-logo-glow {
  position: absolute;
  inset: 0;
  z-index: 7;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.45s ease;
}

.kiosk-start-logo-glow::before,
.kiosk-start-logo-glow::after {
  position: absolute;
  content: "";
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
  pointer-events: none;
}

.kiosk-start-logo-glow::before {
  left: 207.27px;
  top: 104.95px;
  width: 609.262px;
  height: 371.383px;
  background-image: url("/static/assets/figma/ui/logo-ellipse-28862.svg");
}

.kiosk-start-logo-glow::after {
  left: 172px;
  top: 123px;
  width: 625.066px;
  height: 381.017px;
  background-image: url("/static/assets/figma/ui/logo-ellipse-28863.svg");
}

.shell[data-screen="start"] .kiosk-start-logo-glow {
  opacity: 1;
}

.kiosk-logo-backplate {
  position: absolute;
  left: 178px;
  top: 406px;
  z-index: 7;
  width: 698px;
  height: 407px;
  pointer-events: none;
  opacity: 0;
  background: url("/static/assets/figma/ui/logo-backplate.svg") center / 100% 100% no-repeat;
  transition: opacity 0.45s ease, left 0.45s ease, top 0.45s ease, width 0.45s ease, height 0.45s ease;
}

.shell[data-screen="start"] .kiosk-logo-backplate {
  left: 178px;
  top: 406px;
  width: 698px;
  height: 407px;
  z-index: 1;
  opacity: 1;
}

.shell[data-screen="capture"] .kiosk-logo-backplate,
.shell[data-screen="processing"] .kiosk-logo-backplate {
  left: 269px;
  top: -84px;
  width: 470px;
  height: 274px;
  z-index: 7;
  opacity: 1;
}

.shell[data-screen="capture"] .kiosk-brand-logo,
.shell[data-screen="processing"] .kiosk-brand-logo {
  left: 436px;
  top: 41px;
  width: 135.497px;
  height: 75.623px;
  z-index: 8;
}

.shell[data-screen="start"] .kiosk-brand-logo {
  left: 252px;
  top: 168px;
  width: 505px;
  height: 282px;
  z-index: 8;
}

.shell[data-screen="result"] .kiosk-brand-logo {
  left: 551px;
  top: 68px;
  width: 143px;
  height: 81px;
  z-index: 6;
}

.start-tagline {
  position: absolute;
  left: 257px;
  top: 521px;
  width: 491px;
  height: 101px;
  margin: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50.502px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12.194px);
  color: #122654;
  text-align: center;
  font-size: 35.946px;
  font-weight: 600;
  line-height: 0.98;
  text-shadow: none;
  white-space: nowrap;
}

.start-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 16px;
  margin: 0;
  z-index: 3;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  opacity: 0.85;
}

/* —— Камера (Figma Frame 2147223874) —— */
.kiosk-capture {
  background: transparent;
}

.capture-stage {
  position: absolute;
  left: 215px;
  top: 143px;
  width: 579px;
}

.capture-frame {
  position: relative;
  width: 579px;
  height: 387px;
  border-radius: 18px;
}

.camera-probe-slot {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 640px;
  height: 480px;
  overflow: hidden;
  opacity: 0.001;
  pointer-events: none;
}

.camera-rig {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.camera-rig video,
.camera-rig canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.camera-rig video {
  opacity: 0;
}

.camera-rig--probe video,
.camera-rig--probe canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.capture-tagline {
  margin: 26px 0 0;
  text-align: center;
  font-size: 43.774px;
  font-weight: 600;
  line-height: 0.98;
  color: #122654;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.capture-overlay-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}

.capture-overlay-back {
  z-index: 2;
}

.capture-overlay-front {
  z-index: 6;
}

#screen-capture {
  position: relative;
  z-index: 4;
}

.capture-overlay-layer .overlay-flower-wrap,
.result-overlay-layer .overlay-flower-wrap {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.capture-overlay-layer .overlay-flower-transform,
.result-overlay-layer .overlay-flower-transform {
  position: relative;
  flex: none;
}

.capture-overlay-layer .overlay-flower-crop,
.result-overlay-layer .overlay-flower-crop {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.capture-overlay-layer .overlay-flower,
.result-overlay-layer .overlay-flower {
  position: absolute;
  max-width: none;
  pointer-events: none;
  user-select: none;
}

@keyframes overlay-float {
  from {
    transform: translate(0, 0) rotate(0deg);
  }
  to {
    transform: translate(var(--sway, 6px), var(--bob, 10px)) rotate(var(--rot, 4deg));
  }
}

.panel,
.kiosk-panel {
  margin-top: 0;
  flex: 1;
  min-height: 0;
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
}

.hidden {
  display: none !important;
}

.frame {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: #000;
}

#screen-processing,
#screen-error {
  align-items: stretch;
  justify-content: center;
}

#preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}

#preview-canvas {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
}

.kiosk-result .result-portrait {
  position: relative;
  overflow: hidden;
  border-radius: inherit;
}


.frame-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 28px 12px 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
}

.smile-status {
  margin: 14px 0 0;
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  color: var(--sber-green-dark);
}

.smile-ring {
  --smile-pct: 0%;
  position: absolute;
  inset: 10px;
  border-radius: 16px;
  pointer-events: none;
  box-shadow: inset 0 0 0 4px rgba(33, 160, 56, 0.35);
  background: linear-gradient(
    to top,
    rgba(33, 160, 56, 0.35) var(--smile-pct),
    transparent var(--smile-pct)
  );
  transition: background 0.12s ease;
}

.actions {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

button,
.upload {
  display: block;
  width: 100%;
  padding: 16px 18px;
  border: 0;
  border-radius: 16px;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), #ff7b4a);
  color: #fff;
  box-shadow: 0 8px 24px rgba(255, 79, 163, 0.35);
}

.btn-primary {
  background: linear-gradient(135deg, var(--sber-green), var(--sber-green-dark));
  color: #fff;
  box-shadow: 0 8px 24px rgba(33, 160, 56, 0.35);
}

.upload {
  background: #eef9f1;
  color: var(--ink);
  font-weight: 700;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

/* Processing */
#screen-processing {
  background: transparent;
  backdrop-filter: none;
}

.processing-hero {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.processing-status {
  position: absolute;
  left: 181px;
  width: 647px;
  height: 123px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 44px;
  border-radius: 62px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(15px);
}

.processing-status--previous {
  top: 182px;
  opacity: 0;
}

.processing-status--current {
  top: 269px;
  opacity: 1;
}

.processing-status--previous.is-leaving {
  animation: processing-status-leave 0.8s ease forwards;
}

.processing-status--current.is-entering {
  animation: processing-status-enter 0.62s ease forwards;
}

@keyframes processing-status-enter {
  from {
    opacity: 0;
    transform: translateY(76px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes processing-status-leave {
  from {
    opacity: 0.8;
    transform: translateY(87px);
  }
  to {
    opacity: 0;
    transform: translateY(0);
  }
}

.status-main {
  margin: 0;
  max-width: 100%;
  color: #122654;
  font-size: 43.774px;
  font-weight: 600;
  line-height: 0.98;
  text-align: center;
  white-space: nowrap;
  transform-origin: center center;
}

/* Result — Figma Frame 2147223878 (1008×672) */
.kiosk-result {
  background: transparent;
}

.result-overlay-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}

.result-overlay-back {
  z-index: 2;
}

.result-overlay-front {
  z-index: 4;
}

.kiosk-result .result-bg-fallback {
  position: absolute;
  left: 161px;
  top: 40px;
  width: 704px;
  height: 567px;
  z-index: 1;
  display: block;
  border-radius: 35px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(17px);
}

.result-portrait-wrap {
  position: absolute;
  left: 180px;
  top: 57px;
  width: 352px;
  height: 529px;
  z-index: 3;
  overflow: hidden;
  border-radius: 24px;
  background: #bababa;
}

.kiosk-result .result-portrait {
  width: 100%;
  height: 100%;
}

.result-portrait-wrap .result-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 46%;
}

.result-qr-panel {
  display: none;
}

.result-qr-card {
  position: absolute;
  left: 551px;
  top: 178px;
  width: 286px;
  height: 286px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 21px;
  border-radius: 22px;
  background: #fff;
}

#qr {
  display: block;
  width: 244px;
  height: 245px;
  border-radius: 14px;
}

.result-cta-banner {
  position: absolute;
  left: 551px;
  top: 489px;
  width: 283px;
  height: 58px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
}

.result-cta-text {
  margin: 0;
  text-align: left;
  font-size: 18.415px;
  font-weight: 600;
  line-height: 0.98;
  color: #122654;
}

.result-countdown {
  display: none;
}

#countdown-sec {
  font-weight: 900;
  color: var(--sber-green-dark);
}

#screen-error {
  text-align: center;
  justify-content: center;
}

.error-title {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 900;
  color: #c41e3a;
}

#error-text {
  margin: 0 0 16px;
  color: #8b1232;
  line-height: 1.4;
}

@media (max-height: 700px) {
  .brand .lead {
    display: none;
  }
}
