/* ==========================================================================
   SITE BIO, O CONSTRUTOR

   Duas colunas fixas na altura da tela: os blocos à esquerda, a página de
   verdade à direita. A prévia é um iframe com o mesmo PHP que vai para o ar,
   por isso ela ganha o lugar nobre e não encolhe: quem monta uma página
   precisa olhar para a página, não para o formulário.
   ========================================================================== */

.bio-estudio {
  display: flex;
  flex-direction: column;
  gap: 14px;
  /* Desconta o cabeçalho do painel para o estúdio caber sem rolar a página. */
  height: calc(100vh - 150px);
  min-height: 560px;
}

/* --- Barra de cima: endereço, dispositivo e publicação --------------------- */
.bio-barra {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 12px 14px; box-shadow: var(--shadow-sm);
}
.bio-barra-endereco { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.bio-barra-acoes { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.bio-selo {
  font-size: 11.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  padding: 5px 10px; border-radius: var(--r-pill);
  background: var(--status-warning-bg, #FEF9C3); color: var(--status-warning-text, #854D0E);
  white-space: nowrap;
}
.bio-selo.no-ar { background: var(--status-success-bg, #DCFCE7); color: var(--status-success-text, #166534); }

.bio-url {
  display: inline-flex; align-items: center; gap: 6px; max-width: 420px;
  border: 1px dashed var(--line); background: var(--surface-2);
  border-radius: var(--r-pill); padding: 7px 14px;
  font-family: inherit; font-size: 13px; color: var(--text); font-weight: 600;
  cursor: pointer; transition: border-color .15s, color .15s;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bio-url:hover { border-color: var(--blue); color: var(--blue); }

.bio-mini {
  border: 1px solid var(--line); background: var(--surface);
  border-radius: var(--r-pill); padding: 6px 12px;
  font-family: inherit; font-size: 12.5px; font-weight: 600; color: var(--text-2);
  cursor: pointer; transition: background .15s, color .15s;
}
.bio-mini:hover { background: var(--surface-2); color: var(--text); }

.bio-dispositivos { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 3px; }
.bio-disp {
  border: 0; background: transparent; border-radius: var(--r-pill);
  padding: 6px 14px; font-family: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--text-2); cursor: pointer; transition: background .15s, color .15s;
}
.bio-disp.ativo { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* --- Corpo: editor e palco ------------------------------------------------ */
.bio-corpo {
  display: grid; grid-template-columns: 400px minmax(0, 1fr);
  gap: 16px; flex: 1; min-height: 0;
}
.bio-editor {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  overflow-y: auto; overscroll-behavior: contain; padding: 6px;
}
.bio-carregando { color: var(--text-2); font-size: 13px; padding: 18px; margin: 0; }

/* --- Palco da prévia ------------------------------------------------------ */
.bio-palco {
  display: grid; place-items: center; min-height: 0;
  background:
    radial-gradient(circle at 50% 0%, rgba(250, 57, 9,.07), transparent 60%),
    var(--bg);
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px;
  overflow: auto;
}
/* A moldura imita o aparelho porque o site é feito para o celular: julgar o
   resultado numa janela larga daria uma impressão que o cliente nunca terá. */
.bio-moldura {
  width: 390px; height: 100%; max-height: 780px;
  background: var(--ink); border-radius: 38px; padding: 10px;
  box-shadow: 0 24px 60px rgba(17,17,20,.22), 0 0 0 1px rgba(17,17,20,.06);
  transition: width .22s ease, border-radius .22s ease, padding .22s ease;
}
.bio-moldura[data-disp="tablet"] { width: 768px; border-radius: 26px; }
.bio-moldura[data-disp="cheio"] { width: 100%; max-height: none; border-radius: 16px; padding: 6px; }
.bio-tela { width: 100%; height: 100%; border: 0; border-radius: 30px; background: #050407; display: block; }
.bio-moldura[data-disp="tablet"] .bio-tela { border-radius: 18px; }
.bio-moldura[data-disp="cheio"] .bio-tela { border-radius: 12px; }

/* --- Bloco do editor ------------------------------------------------------ */
.bio-bloco {
  border: 1px solid var(--line); border-radius: var(--r-md);
  margin-bottom: 8px; background: var(--surface); overflow: hidden;
  transition: border-color .15s, box-shadow .15s, opacity .15s;
}
.bio-bloco.aberto { border-color: var(--border-orange, rgba(250, 57, 9,.3)); box-shadow: var(--shadow-sm); }
.bio-bloco.oculto .bio-bloco-nome { color: var(--text-3); text-decoration: line-through; }
.bio-bloco.arrastando { opacity: .45; }
.bio-bloco.alvo { border-color: var(--blue); border-style: dashed; }

.bio-bloco-cabeca {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; cursor: pointer; user-select: none;
}
.bio-bloco-cabeca:hover { background: var(--surface-2); }
.bio-pegador {
  display: grid; place-items: center; width: 20px; height: 24px;
  color: var(--text-3); cursor: grab; flex-shrink: 0;
}
.bio-pegador:active { cursor: grabbing; }
.bio-pegador.travado { opacity: .3; cursor: default; }
.bio-bloco-icone { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--blue-soft); color: var(--blue); flex-shrink: 0; }
.bio-bloco-texto { flex: 1; min-width: 0; }
.bio-bloco-nome { font-size: 13.5px; font-weight: 700; color: var(--text); display: block; }
.bio-bloco-resumo { font-size: 11.5px; color: var(--text-3); display: block; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bio-bloco-botoes { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.bio-icone-btn {
  display: grid; place-items: center; width: 28px; height: 28px;
  border: 0; background: transparent; border-radius: 8px;
  color: var(--text-3); cursor: pointer; transition: background .15s, color .15s;
}
.bio-icone-btn:hover { background: var(--line-2); color: var(--text); }
.bio-icone-btn:disabled { opacity: .25; cursor: default; }
.bio-icone-btn.ligado { color: var(--blue); }
/* O cofre de ícones tem uma seta só, apontando para baixo. Subir é a mesma
   seta virada, e não um SVG novo que sairia do padrão do painel. */
.bio-icone-btn--subir svg { transform: rotate(180deg); }

.bio-bloco-corpo { padding: 4px 12px 14px; border-top: 1px solid var(--line-2); }

/* --- Campos --------------------------------------------------------------- */
.bio-campo { margin-top: 12px; }
.bio-campo > label,
.bio-rotulo { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.bio-campo input[type="text"],
.bio-campo input[type="url"],
.bio-campo input[type="time"],
.bio-campo textarea,
.bio-campo select {
  width: 100%; font-family: inherit; font-size: 13.5px; color: var(--text);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 9px 11px; transition: border-color .15s;
}
.bio-campo input:focus, .bio-campo textarea:focus, .bio-campo select:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--kortei-orange-glow, rgba(250, 57, 9,.18));
}
.bio-campo textarea { resize: vertical; min-height: 78px; line-height: 1.55; }
.bio-dica { font-size: 11.5px; color: var(--text-3); margin: 5px 0 0; line-height: 1.5; }
.bio-dica strong { color: var(--text-2); font-weight: 600; }
.bio-erro { font-size: 11.5px; color: var(--red); margin: 5px 0 0; }
.bio-ok { font-size: 11.5px; color: var(--green); margin: 5px 0 0; }

/* Interruptor de linha */
.bio-switch { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.bio-switch:last-child { border-bottom: 0; }
.bio-switch-texto { font-size: 13px; color: var(--text); font-weight: 500; }
.bio-switch-texto small { display: block; font-size: 11.5px; color: var(--text-3); font-weight: 400; margin-top: 1px; }
.bio-switch input { appearance: none; width: 40px; height: 23px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; flex-shrink: 0; transition: background .18s; }
.bio-switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .18s; }
.bio-switch input:checked { background: var(--blue); }
.bio-switch input:checked::after { transform: translateX(17px); }

/* --- Imagens -------------------------------------------------------------- */
.bio-imagem { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.bio-imagem-previa {
  width: 66px; height: 66px; border-radius: var(--r-sm); flex-shrink: 0;
  background: var(--surface-2) center/cover no-repeat;
  border: 1px solid var(--line); display: grid; place-items: center;
  color: var(--text-3); font-size: 10.5px; text-align: center; overflow: hidden;
}
.bio-imagem-acoes { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bio-imagem-linha { display: flex; flex-wrap: wrap; gap: 6px; }
/* A miniatura da foto do topo é redonda porque é assim que ela aparece no
   site. Miniatura quadrada esconderia um enquadramento que corta a testa. */
.bio-imagem-previa--circulo { border-radius: 50%; }
.bio-imagem-previa[ondblclick] { cursor: pointer; }
.bio-imagem-acoes .bio-dica { margin: 0; }

/* Galeria da estrutura */
.bio-galeria { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.bio-foto { position: relative; aspect-ratio: 5 / 4; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); cursor: grab; }
.bio-foto img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.bio-foto.arrastando { opacity: .4; }
.bio-foto-remover {
  position: absolute; top: 4px; right: 4px; width: 24px; height: 24px;
  display: grid; place-items: center; border: 0; border-radius: 50%;
  background: rgba(9,9,9,.62); color: #fff; cursor: pointer; opacity: 0; transition: opacity .15s;
}
.bio-foto:hover .bio-foto-remover { opacity: 1; }
.bio-vazio { grid-column: 1 / -1; font-size: 12px; color: var(--text-3); padding: 14px; text-align: center; border: 1px dashed var(--line); border-radius: var(--r-sm); }

/* Botão de enviar arquivo, escondendo o input feio do navegador */
.bio-enviar { position: relative; overflow: hidden; display: inline-flex; }
.bio-enviar input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }

/* --- Serviços e redes ----------------------------------------------------- */
.bio-lista { margin-top: 10px; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.bio-linha { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-bottom: 1px solid var(--line-2); }
.bio-linha:last-child { border-bottom: 0; }
.bio-linha-nome { flex: 1; min-width: 0; font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bio-linha-nome small { display: block; color: var(--text-3); font-size: 11.5px; }
.bio-linha input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--blue); cursor: pointer; flex-shrink: 0; }

.bio-rede { display: flex; align-items: center; gap: 9px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.bio-rede:last-child { border-bottom: 0; }
.bio-rede-marca { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 7px; flex-shrink: 0; }
.bio-rede input[type="url"] { flex: 1; min-width: 0; }

/* --- Horários da semana --------------------------------------------------- */
.bio-dia { display: grid; grid-template-columns: 78px 1fr; gap: 8px; align-items: center; padding: 6px 0; }
.bio-dia-nome { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.bio-turnos { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bio-turnos input[type="time"] { width: 96px; }
.bio-fechado { font-size: 12px; color: var(--text-3); }

/* --- Telas estreitas ------------------------------------------------------ */
@media (max-width: 1180px) {
  .bio-corpo { grid-template-columns: 340px minmax(0, 1fr); }
  .bio-moldura { width: 340px; }
}
@media (max-width: 900px) {
  .bio-estudio { height: auto; }
  .bio-corpo { grid-template-columns: minmax(0, 1fr); }
  .bio-editor { max-height: none; overflow: visible; }
  .bio-palco { height: 620px; }
  .bio-moldura { width: 100%; max-width: 390px; }
}
