:root {
  --wine: #6f2f2f;
  --wine-2: #8a3b3b;
  --bg: #e9e9ea;
  --text: rgba(0, 0, 0, 0.78);
  --muted: rgba(0, 0, 0, 0.55);
  --muted2: rgba(0, 0, 0, 0.45);
  --border: rgba(0, 0, 0, 0.1);
}

body.theme-dark {
  --wine: #f26f8f;
  --wine-2: #ff8cab;
  --bg: #0f172a;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --muted2: #9ca3af;
  --border: #1f2937;
}

body {
  background: var(--bg);
}

/* página */
.validar-page {
  width: min(980px, 92vw);
  margin: 36px auto;
  background: #fff;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.1);
  padding: 26px 28px 22px;
  position: relative;
  overflow: hidden;
}

body.theme-dark .validar-page {
  background: #111827;
  border: 1px solid var(--border);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.45);
}

/* barra vinho no topo (igual figma) */
.validar-page::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 10px;
  background: linear-gradient(
    90deg,
    var(--primary-light),
    var(--primary),
    var(--primary-dark)
  );
}

body.theme-dark .validar-page::before {
  background: var(--wine-2);
}

/* header */
.validar-header {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-top: 6px;
  margin-bottom: 18px;
}

.validar-header__icon {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex: 0 0 auto;
  margin-top: 2px;
}

.validar-header__text h1 {
  margin: 0 0 6px 0;
  font-size: 22px;
  font-weight: 800;
  color: var(--wine);
}

body.theme-dark .validar-header__text h1 {
  color: var(--wine-2);
}

.helper-bullets {
  margin-top: 28px;
  margin-bottom: 28px;
  font-size: 12px;
  line-height: 1.45;
}

.helper-bullets ul {
  margin: 0;
  padding-left: 16px;
}

.helper-bullets li {
  margin-bottom: 4px; /* evita espaçamento excessivo entre bullets */
}

@media (max-width: 720px) {
  .validar-page {
    padding: 22px 18px 20px;
  }

  .validar-header {
    flex-wrap: wrap;
  }

  .validar-header__text h1 {
    font-size: 20px;
  }

  .helper-bullets {
    margin-top: 16px;
    margin-bottom: 18px;
    font-size: 12px;
  }

  .validar-row {
    grid-template-columns: 1fr;
  }

  .btn-buscar {
    width: 100%;
  }

  .actions-bottom {
    justify-content: center;
  }
}

/* alert */
.alert {
  margin: 10px 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.03);
  color: var(--text);
}
.alert.success {
  border-color: rgba(30, 140, 80, 0.3);
  background: rgba(30, 140, 80, 0.08);
}
.alert.error {
  border-color: rgba(190, 30, 30, 0.3);
  background: rgba(190, 30, 30, 0.08);
}

body.theme-dark .alert {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border);
  color: var(--text);
}

/* form (input + botão na mesma linha) */
.validar-form {
  margin-top: 14px;
}

/*  input + botão alinhados (igual figma) */
.validar-row {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  align-items: start;
}

.validar-field label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted2);
}

.validar-field input {
  width: 100%;
  height: 56px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 0 12px;
  font-size: 14px;
  outline: none;
  background: rgba(0, 0, 0, 0.02);
}

body.theme-dark .validar-field input {
  background: #0f1b2d;
  border-color: var(--border);
  color: var(--text);
}

.validar-field input:focus {
  border-color: rgba(111, 47, 47, 0.45);
  box-shadow: 0 0 0 4px rgba(111, 47, 47, 0.1);
  background: #fff;
}

body.theme-dark .validar-field input:focus {
  border-color: var(--wine-2);
  box-shadow: 0 0 0 4px rgba(242, 111, 143, 0.18);
  background: #111827;
}

.field-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted2);
}

/* botão buscar (igual figma: vinho, grande, com sombra leve) */
.btn {
  border: none;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-buscar {
  width: 100%;
  height: 56px;
  border-radius: 10px;
  border: 1.5px solid #65262f;
  border-color: #65262f;
  background: #ac3748;

  color: #fff;
  box-shadow: 0 10px 24px rgba(111, 47, 47, 0.2);
  padding: 0 18px;
  margin-top: 23px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-buscar .btn-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  filter: brightness(10);
}

.btn-buscar:hover {
  filter: brightness(0.96);
}
.btn-buscar:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

body.theme-dark .btn-buscar {
  background: var(--primary-light);
  border-color: var(--primary-light);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55);
}

body.theme-dark .btn-buscar:hover {
  filter: brightness(1.05);
}

.btn-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  display: none;
  animation: spin 0.9s linear infinite;
}
.btn-buscar.loading .btn-spinner {
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* botão voltar (outline, embaixo à direita) */
.actions-bottom {
  margin-top: 28px;
  display: flex;
  width: 100%;
}
.actions-right {
  justify-content: flex-end;
}

.btn-voltar {
  width: 187px;
  height: 56px;
  padding: 0 18px;
  border-radius: 10px;

  background: #fff;
  border: 1.5px solid #65262f;
  color: var(--primary-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 800;
}

.btn-voltar:hover {
  background: var(--primary);
  color: #fff;
}

body.theme-dark .btn-voltar {
  background: #111827;
  border: 2px solid var(--border);
  color: #ffff;
}

body.theme-dark .btn-voltar:hover {
  background: var(--primary);
  border-color: var(--wine);
  color: #ffff;
}

.validar-result {
  margin-top: 14px;
}

.validar-box {
  width: min(520px, 100%);
  border: 1px solid rgba(80, 190, 105, 0.65);
  background: rgba(80, 190, 105, 0.1);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.65;
  color: rgba(0, 0, 0, 0.7);
}

.validar-box p {
  margin: 6px 0;
  color: black;
}

body.theme-dark .validar-box {
  background: rgba(80, 190, 105, 0.16);
  border-color: rgba(80, 190, 105, 0.8);
  color: var(--text);
}

body.theme-dark .validar-box p {
  color: var(--text);
}

.validar-status {
  margin-bottom: 10px !important;
}

.validar-status strong {
  font-weight: 700;
  color: rgba(0, 0, 0, 0.72);
}

body.theme-dark .validar-status strong {
  color: #ffffff;
}

.validar-ok {
  font-weight: 800;
  color: rgba(35, 140, 70, 1);
}
