/* RESET BÁSICO */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI",
    Roboto, sans-serif;
  /* background: radial-gradient(circle at top, #111827 0, #020617 45%, #000 100%); */
  color: #e5e7eb;
}

/* LAYOUT GERAL */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* TOPO */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 22px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  flex-direction: column;
}

.brand-main {
  font-weight: 600;
  font-size: 1.1rem;
}

.brand-sub {
  font-size: 0.8rem;
  color: #9ca3af;
}

.device-id-box {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: #cbd5f5;
}

#device-id-text {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco,
    Consolas, "Liberation Mono", "Courier New", monospace;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.8);
}

/* MAIN */
.layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr);
  gap: 24px;
  padding: 18px 20px 24px;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

/* COLUNAS */
.simulator-column,
.controls-column {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.simulator-column h2,
.controls-column h2 {
  font-size: 1rem;
  font-weight: 600;
  color: darkgray;
  letter-spacing: 0.02em;
}

/* DISPOSITIVO */
.device-wrapper {
  /* flex: 1; */
  display: flex;
  justify-content: center;
  align-items: center;
}

.device {
  background: radial-gradient(circle at top, #111827 0, #020617 60%, #000 100%);
  padding: 18px;
  border-radius: 18px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.device-body {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

/* TELA EPAPER (200x200) – estilizada */
.epaper-screen {
  width: min(260px, 80vw);
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  background: #f4f4f1;
  border: 3px solid #111827;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.35);
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.epaper-inner {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  border: 1px solid #9ca3af;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #111827;
  font-size: 12px;
}

.epaper-header {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #6b7280;
  display: flex;
  justify-content: space-between;
}

.epaper-intention {
  min-height: 32px;
  font-size: 0.6rem;
  font-weight: 600;
  color: #111827;
  line-height: 1.3;
}

.epaper-suggestion {
  flex: 1;
  font-size: 0.6rem;
  line-height: 1.4;
  padding: 4px 0;
  display: flex;
  align-items: center;
}

/* PROGRESSO */
.epaper-progress {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: #111827;
  transition: width 0.3s ease-out;
}

.progress-label {
  font-size: 10px;
  color: #4b5563;
}

/* RODAPÉ DA TELA */
.epaper-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  font-size: 10px;
  margin-top: 4px;
}

.footer-column {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.footer-label {
  color: #6b7280;
}

.footer-feedback-labels {
  text-align: right;
}

/* COLUNA DOS BOTÕES FÍSICOS */
.button-column {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.device-btn {
  width: 32px;
  height: 48px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.9);
  background: radial-gradient(circle at top, #1f2937 0, #020617 80%);
  color: #e5e7eb;
  font-size: 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.8);
  transition: transform 0.06s ease-out, box-shadow 0.06s ease-out,
    background 0.1s ease-out;
}

.device-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.8);
  background: radial-gradient(circle at bottom, #020617 0, #111827 80%);
}

.like-btn {
  border-color: rgba(52, 211, 153, 0.9);
}

.dislike-btn {
  border-color: rgba(248, 113, 113, 0.9);
}

/* CARDS / CONTROLES */
.card {
  background: rgba(15, 23, 42, 0.95);
  border-radius: 12px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.7);
}

.card h3 {
  font-size: 0.95rem;
  font-weight: 600;
}

.card-description {
  font-size: 0.8rem;
  color: #9ca3af;
}

/* FORM ELEMENTS */
label {
  font-size: 0.8rem;
  color: #cbd5f5;
}

textarea,
select {
  width: 100%;
  margin-top: 4px;
  margin-bottom: 6px;
  padding: 8px 9px;
  font-size: 0.85rem;
  border-radius: 8px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: #020617;
  color: #e5e7eb;
  resize: vertical;
}

textarea:focus,
select:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.6);
}

/* BOTÕES GERAIS */
.btn-primary,
.btn-secondary,
.btn-small {
  border: none;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  transition: background 0.1s ease-out, transform 0.06s ease-out,
    box-shadow 0.06s ease-out;
}

.btn-primary {
  background: linear-gradient(to right, #4f46e5, #6366f1);
  color: #e5e7eb;
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.65);
}

.btn-primary:active {
  transform: translateY(1px);
  box-shadow: 0 3px 8px rgba(79, 70, 229, 0.7);
}

.btn-secondary {
  background: rgba(31, 41, 55, 0.9);
  color: #e5e7eb;
  border: 1px solid rgba(75, 85, 99, 0.9);
}

.btn-small {
  padding: 5px 10px;
  font-size: 0.78rem;
  background: rgba(31, 41, 55, 0.9);
  color: #e5e7eb;
  border: 1px solid rgba(75, 85, 99, 0.9);
}

/* STATUS / MENSAGENS */
.status-text {
  min-height: 18px;
  font-size: 0.76rem;
  margin-top: 4px;
  color: #9ca3af;
}

.status-text.ok {
  color: #22c55e;
}

.status-text.error {
  color: #f97373;
}

.hint {
  font-size: 0.78rem;
  color: #9ca3af;
}

/* HISTÓRICO */
.history-list {
  margin-top: 6px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 3px;
  font-size: 0.76rem;
}

.history-item {
  padding: 6px 4px;
  border-bottom: 1px solid rgba(31, 41, 55, 0.9);
}

.history-item:last-child {
  border-bottom: none;
}

.history-item span.label {
  display: inline-block;
  min-width: 70px;
  color: #9ca3af;
}

/* FOOTER */
.page-footer {
  padding: 8px 20px 10px;
  font-size: 0.75rem;
  color: #6b7280;
  border-top: 1px solid rgba(15, 23, 42, 0.9);
  background: rgba(2, 6, 23, 0.96);
}
