* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background: #0f3d73;
  color: #fff;
  font-family: Arial, Helvetica, sans-serif;
}
body {
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: 8px 12px 10px;
}

.rf-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.rf-logo {
  display: block;
  height: 28px;
  width: auto;
  max-width: 70%;
  object-fit: contain;
  object-position: left center;
}
.rf-badge {
  padding: 4px 8px;
  border-radius: 4px;
  background: #1a508c;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.rf-form { margin: 0 0 10px; }
.rf-label {
  display: block;
  margin-bottom: 4px;
  color: #b8cce0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
#scanInput {
  width: 100%;
  height: 48px;
  padding: 0 10px;
  border: 2px solid #3d6a9e;
  border-radius: 8px;
  background: #0a162a;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
  outline: none;
}
#scanInput:focus { border-color: #b8f25a; }

.rf-result {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 0;
}
.rf-hint {
  margin: 0;
  color: #8aa0c4;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.18em;
}
.rf-status {
  margin: 0;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.rf-price {
  margin: 0;
  color: #b8f25a;
  font-size: 72px;
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.04em;
  white-space: nowrap;
}
.rf-promo {
  display: inline-block;
  margin: 12px 0 0;
  padding: 7px 12px;
  border-radius: 20px;
  background: #e31c23;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.rf-name {
  margin: 18px 0 0;
  max-width: 100%;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 700;
}
.rf-class {
  margin: 0 0 10px;
  max-width: 100%;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0.02em;
}
.rf-meta {
  margin: 8px 0 0;
  color: #b8cce0;
  font-size: 14px;
}

.rf-print {
  display: none;
  align-self: stretch;
  width: 100%;
  height: 64px;
  margin-top: 18px;
  flex-shrink: 0;
  border: 0;
  border-radius: 8px;
  background: #b8f25a;
  color: #0f3d73;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.06em;
  touch-action: manipulation;
}
.is-ok .rf-print { display: block; }
.rf-print:disabled { opacity: 0.6; }

.rf-foot {
  margin: 8px 0 0;
  color: #8aa0c4;
  text-align: center;
  font-size: 12px;
}

.is-idle .rf-status,
.is-idle .rf-price,
.is-idle .rf-promo,
.is-idle .rf-name,
.is-idle .rf-class,
.is-idle .rf-meta { display: none; }

.is-wait .rf-hint,
.is-ok .rf-hint,
.is-err .rf-hint { display: none; }

.is-wait .rf-status { color: #b8cce0; }
.is-err .rf-status { color: #ffd36a; }
.is-err .rf-price,
.is-err .rf-promo { display: none; }

[hidden] { display: none !important; }

@media (max-width: 400px) {
  .rf-price { font-size: 58px; }
  .rf-hint { font-size: 22px; }
}
