.ean-tool {
  margin: 0 0 28px;
  padding: 24px;
  border: 1px solid #bfd6f3;
  border-radius: 14px;
  background: linear-gradient(145deg, #f7fbff 0%, #eef6ff 100%);
  box-shadow: 0 12px 30px rgba(8, 61, 128, .07);
}

.article .ean-tool h2 {
  margin: 0 0 8px;
}

.ean-tool__intro {
  margin: 0 0 20px;
  color: #456486;
}

.ean-tool__form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 12px;
  align-items: end;
}

.ean-tool__field {
  display: grid;
  gap: 7px;
  color: #0a3569;
  font-size: 14px;
  font-weight: 750;
}

.ean-tool__field input {
  min-width: 0;
  height: 48px;
  border-radius: 8px;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .035em;
}

.ean-tool__field input[aria-invalid="true"] {
  border-color: #c8324f;
  background: #fff8fa;
  box-shadow: 0 0 0 3px rgba(200, 50, 79, .1);
}

.ean-tool__hint {
  color: #5d7694;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}

.ean-tool__button {
  min-height: 48px;
  border: 1px solid #0867f2;
  border-radius: 8px;
  padding: 10px 20px;
  color: #fff;
  background: #0867f2;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: background .15s, box-shadow .15s, transform .15s;
}

.ean-tool__button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #0759d1;
  box-shadow: 0 7px 16px rgba(8, 103, 242, .18);
}

.ean-tool__button:focus-visible {
  outline: 3px solid rgba(20, 120, 255, .23);
  outline-offset: 2px;
}

.ean-tool__button:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.ean-tool__result {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  padding: 12px 14px;
  border: 1px solid #cbdcf0;
  border-radius: 9px;
  color: #244e7d;
  background: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.ean-tool__result--success {
  border-color: #a9d8bd;
  color: #17643a;
  background: #eefaf3;
}

.ean-tool__result--error {
  border-color: #efb6c1;
  color: #a42440;
  background: #fff2f5;
}

.ean-tool__privacy,
.ean-tool__notice {
  margin: 14px 0 0;
  color: #526d8d;
  font-size: 13px;
  line-height: 1.55;
}

.ean-tool__notice {
  padding-top: 14px;
  border-top: 1px solid #d8e6f6;
}

.ean-tool__notice strong {
  color: #0a3569;
}

.ean-scan-guide {
  margin: 28px 0;
  padding: 24px;
  border: 1px solid #d7e4f3;
  border-radius: 12px;
  background: #fff;
}

.article .ean-scan-guide h2 {
  margin: 0 0 8px;
}

.ean-scan-guide > p {
  color: #526d8d;
}

.article .ean-scan-checklist {
  display: grid;
  gap: 11px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ean-scan-checklist li {
  position: relative;
  padding-left: 29px;
}

.ean-scan-checklist li::before {
  content: "✓";
  position: absolute;
  top: 1px;
  left: 0;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #16784b;
  font-size: 12px;
  font-weight: 900;
}

.ean-scan-checklist strong {
  color: #0a3569;
}

@media (max-width: 640px) {
  .ean-tool,
  .ean-scan-guide {
    padding: 20px;
  }

  .ean-tool__form {
    grid-template-columns: 1fr;
  }

  .ean-tool__button,
  .ean-tool__result {
    grid-column: 1;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ean-tool__button {
    transition: none;
  }
}

/* Keep the hint below the controls without lowering the submit button. */
.ean-tool__form > .ean-tool__hint { grid-column: 1 / -1; }
@media (min-width: 1201px) {
  .article-modern .ean-tool__button { grid-column: 2; grid-row: 1; }
}
