:root {
  --bg: #f2efe9;
  --bg-deep: #ded5c7;
  --panel: #fffdfb;
  --panel-strong: #efeadf;
  --text: #2f2d2c;
  --muted: #625d5a;
  --line: #d9d4cc;
  --accent: #ab9061;
  --accent-dark: #7b6852;
  --success: #2d7d4f;
  --danger: #b64a3f;
  --terracotta: #a24f44;
  --blue: #326b9e;
  --green: #6d7d6a;
  --shadow: 0 12px 28px rgba(44, 39, 32, 0.12);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: Georgia, "Times New Roman", serif; background: var(--bg); color: var(--text); }
body { padding: 20px; }
button, input, select, textarea { font-family: "Segoe UI", Arial, sans-serif; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }

.mpa-professor {
  max-width: 1400px;
  margin: 0 auto;
  background: rgba(255,255,255,0.3);
}

.topo-professor {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: linear-gradient(120deg, var(--panel) 0%, #f8f0e5 100%);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 18px 24px;
  margin-bottom: 18px;
}

.marca-obra {
  display: flex;
  align-items: center;
  gap: 14px;
}

.selo-obra {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid var(--accent-dark);
  border-radius: 50%;
  color: var(--accent-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .04em;
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
}

.topo-professor h1 {
  margin: 0;
  font-size: clamp(1.8rem, 2vw, 2.5rem);
}

.subtitulo-obra {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: .98rem;
  font-style: italic;
}

.introducao-obra {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin-bottom: 18px;
  padding: 24px 28px;
  border-left: 5px solid var(--terracotta);
  background: linear-gradient(115deg, #e8ded0, #f7f1e8 72%);
  box-shadow: inset 0 -1px 0 rgba(123, 104, 82, .2);
}

.introducao-texto { max-width: 720px; }

.introducao-obra h2 {
  margin: 4px 0 8px;
  color: var(--accent-dark);
  font-size: clamp(1.55rem, 2.5vw, 2.25rem);
  font-weight: 500;
}

.introducao-obra p:not(.eyebrow) {
  max-width: 650px;
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.legenda-obra {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  color: var(--muted);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: .82rem;
  font-weight: 700;
  white-space: nowrap;
}

.legenda-obra span { display: inline-flex; align-items: center; gap: 7px; }

.ponto-legenda {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.ponto-terracota { background: var(--terracotta); }
.ponto-azul { background: var(--blue); }
.ponto-verde { background: var(--green); }

.controles-topo, .grupo, .modal-acoes, .opcoes-acessibilidade {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 16px 20px;
  margin-bottom: 18px;
}

.btn {
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid #5f5a56;
  background: white;
  color: var(--text);
  font-weight: 700;
  transition: .2s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn.ativo,
.btn-principal {
  background: var(--accent);
  border-color: var(--accent-dark);
  color: #fff;
}

.btn-ghost {
  background: #f4f1ec;
}

.grupo-arquivos {
  justify-content: flex-end;
}

.upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 10px;
  background: #f3efe9;
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

input[type="file"] { display: none; }

.layout-professor {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(280px, 0.8fr);
  gap: 18px;
}

.painel-imagem, .painel-lista {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.cena-wrapper {
  background: #ece8e3;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

.cena {
  position: relative;
  width: 100%;
  min-height: 560px;
  background: linear-gradient(135deg, #fbfaf9, #efeae1);
  overflow: hidden;
  touch-action: none;
}

#imagemPrincipal {
  width: 100%;
  height: 100%;
  min-height: 560px;
  object-fit: cover;
  object-position: center;
  display: block;
}

.hotspot {
  position: absolute;
  width: 42px;
  height: 42px;
  border: 3px solid rgba(255,255,255,0.9);
  border-radius: 999px;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  color: white;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(0,0,0,0.18);
  z-index: 3;
}

.hotspot.arrastando { box-shadow: 0 0 0 4px rgba(255,255,255,0.7), 0 12px 30px rgba(0,0,0,.25); }
.hotspot.acerto { background: var(--success) !important; }
.hotspot.erro { background: var(--danger) !important; }

.alvo-sombra {
  position: absolute;
  width: 56px;
  height: 56px;
  border: 2px dashed rgba(0,0,0,0.35);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.5;
}

.status-bar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  color: var(--muted);
  font-weight: 600;
}

.painel-lista h2 {
  margin: 0 0 14px;
}

.lista-hotspots {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.item-hotspot {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #faf8f4;
}

.item-hotspot > strong {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: .95rem;
}

.item-hotspot div strong { display: block; margin-bottom: 4px; }
.item-hotspot span { color: var(--muted); font-size: .9rem; }

.acoes-item {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.acoes-item button {
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: white;
}

.opcoes-acessibilidade {
  margin-top: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 16px 20px;
}

.opcoes-acessibilidade label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(35, 29, 25, 0.5);
  padding: 20px;
  z-index: 50;
}

.modal.aberto { display: flex; }

.modal-conteudo {
  width: min(760px, 92vw);
  max-height: 90vh;
  overflow: auto;
  background: var(--panel);
  border-radius: 18px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  padding: 20px;
}

.info-conteudo { width: min(620px, 92vw); }

.modal-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.modal-header h3 { margin: 0; }

#formHotspot {
  display: grid;
  gap: 14px;
}

.grid-duas-colunas {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 600;
  color: var(--text);
}

input, select, textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 42px;
  width: 100%;
  padding: 10px 12px;
  background: white;
  color: var(--text);
}

textarea { min-height: 90px; resize: vertical; }

.avaliacao-panel {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 14px 16px;
  display: none;
}

body.modo-avaliacao .avaliacao-panel { display: block; }

@media (max-width: 900px) {
  .layout-professor { grid-template-columns: 1fr; }
  .topo-professor { flex-direction: column; align-items: flex-start; }
  .toolbar { flex-direction: column; }
  .grupo-arquivos { justify-content: flex-start; }
  .introducao-obra { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 600px) {
  body { padding: 12px; }
  .marca-obra { align-items: flex-start; }
  .selo-obra { width: 44px; height: 44px; }
  .subtitulo-obra { font-size: .9rem; }
  .grid-duas-colunas { grid-template-columns: 1fr; }
  .cena { min-height: 420px; }
  #imagemPrincipal { min-height: 420px; }
}
