/* ==========================================================================
   Impression — Boomai
   Tema claro, alinhado à identidade visual da landing page da Boomai
   (fundo branco/cinza claro, roxo sólido #5800D0, headlines em sans bold).
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800;900&family=Inter+Tight:wght@400;500;600;700&display=swap');

:root {
  /* Marca — extraído da landing page da Boomai */
  --roxo:        #5800D0;
  --roxo-escuro: #4200A0;
  --roxo-claro:  #6810D8;
  --roxo-vivo:   #A850F8;
  --preto:       #000000;

  --gradiente:      linear-gradient(100deg, var(--roxo), var(--roxo-claro));
  --gradiente-suave: linear-gradient(100deg, rgba(88,0,208,.08), rgba(104,16,216,.08));

  /* Superfícies */
  --fundo:      #FFFFFF;
  --fundo-header:#ECECEC;
  --fundo-alto: #F8F8F8;
  --painel:     #FFFFFF;
  --painel-alto:#F1EEFA;
  --linha:      #E7E4EF;
  --linha-forte:#D6D0E6;

  /* Texto */
  --texto:      #17102A;
  --texto-medio:#5B5570;
  --texto-fraco:#918C9E;

  --ok:    #17A673;
  --alerta:#B45E00;
  --erro:  #D6314A;

  --raio:    14px;
  --raio-g:  22px;
  --sombra:  0 18px 45px -22px rgba(23,16,42,.22);

  --sans-display: 'Poppins', system-ui, sans-serif;
  --sans:  'Inter Tight', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--fundo);
  color: var(--texto);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Brilho de fundo: um eco discreto do roxo da marca */
body::before {
  content: '';
  position: fixed;
  inset: -20% -10% auto -10%;
  height: 55vh;
  background:
    radial-gradient(50% 55% at 15% 0%, rgba(88,0,208,.05), transparent 70%),
    radial-gradient(45% 55% at 85% 5%, rgba(168,80,248,.06), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

a { color: var(--roxo); text-decoration: none; }
a:hover { color: var(--roxo-escuro); }

:focus-visible {
  outline: 2px solid var(--roxo);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Layout ─────────────────────────────────────────────────────────────── */

.envelope { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; }
.container { width: min(1180px, 100% - 3rem); margin-inline: auto; }

@media (max-width: 640px) {
  .container { width: calc(100% - 2rem); }
}

/* ── Cabeçalho ──────────────────────────────────────────────────────────── */

.cabecalho {
  position: sticky; top: 0; z-index: 40;
  background: var(--fundo-header);
  border-bottom: 1px solid var(--linha);
}
.cabecalho .container {
  display: flex; align-items: center; gap: 1.5rem;
  height: 76px;
}
.marca { display: flex; align-items: center; gap: .65rem; }
.marca img { height: 40px; width: auto; display: block; }
.marca .nome {
  font-family: var(--sans-display);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -.01em;
  line-height: 1;
  color: var(--texto);
}
.nav { margin-left: auto; display: flex; align-items: center; gap: .3rem; }
.nav a {
  padding: .55rem .9rem; border-radius: 9px;
  color: var(--texto-medio); font-weight: 600; font-size: .92rem;
}
.nav a:hover { color: var(--texto); background: var(--painel-alto); }
.nav a.ativo { color: var(--roxo); background: var(--painel-alto); }
.nav a.botao { color: #fff; }
.nav a.botao:hover { color: #fff; background: var(--roxo-escuro); }
.nav-divisor { width: 1px; height: 22px; background: var(--linha-forte); margin: 0 .3rem; }

.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--gradiente);
  display: grid; place-items: center;
  font-size: .78rem; font-weight: 700; color: #fff;
  letter-spacing: .02em;
}

/* ── Tipografia ─────────────────────────────────────────────────────────── */

h1, h2, h3 {
  font-family: var(--sans-display);
  font-weight: 800;
  line-height: 1.1;
  margin: 0;
  letter-spacing: -.015em;
}
h1 { font-size: clamp(2.1rem, 4.6vw, 3.2rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.85rem); }
h3 { font-size: 1.15rem; font-weight: 700; }

.subtitulo { color: var(--texto-medio); max-width: 62ch; margin: .8rem 0 0; font-size: 1.02rem; }

.rotulo {
  display: block; font-size: .82rem; font-weight: 600;
  color: var(--texto-medio); margin-bottom: .4rem;
}
/* Uppercase só nos rótulos de controle do estúdio (Idioma, Voz, Velocidade) —
   nos formulários de autenticação fica pesado demais. */
.controles .rotulo, .painel .campo:first-of-type ~ .rotulo {
  text-transform: uppercase; font-size: .76rem; letter-spacing: .04em; font-weight: 700;
}

/* ── Formulários ────────────────────────────────────────────────────────── */

input[type=text], input[type=email], input[type=password], input[type=search],
textarea, select {
  width: 100%; padding: .72rem .9rem;
  background: var(--fundo-alto);
  border: 1.5px solid var(--linha);
  border-radius: var(--raio);
  color: var(--texto);
  font-family: var(--sans); font-size: .95rem;
  transition: border-color .16s, background .16s;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--roxo);
  background: #fff;
}
input::placeholder, textarea::placeholder { color: var(--texto-fraco); }
input[type=search] { -webkit-appearance: none; appearance: none; }
input[type=search]::-webkit-search-cancel-button { cursor: pointer; }
textarea { resize: vertical; min-height: 130px; line-height: 1.65; }

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235B5570' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.4rem;
}

.ajuda { font-size: .82rem; color: var(--texto-fraco); margin-top: .35rem; }
.erro-campo { font-size: .84rem; color: var(--erro); margin-top: .35rem; }

.campo { margin-bottom: 1.1rem; }

/* ── Botões ─────────────────────────────────────────────────────────────── */

.botao {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .75rem 1.35rem; border: none; border-radius: 999px;
  font-family: var(--sans); font-size: .95rem; font-weight: 700;
  cursor: pointer; transition: transform .12s, box-shadow .18s, background .16s;
  color: #fff; background: var(--roxo);
  box-shadow: 0 10px 24px -12px rgba(88,0,208,.55);
}
.botao:hover { transform: translateY(-1px); background: var(--roxo-escuro); color: #fff; }
.botao:active { transform: translateY(0); }
.botao[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

.botao-vazado {
  background: transparent; color: var(--texto);
  border: 1.5px solid var(--linha-forte); box-shadow: none;
}
.botao-vazado:hover { background: var(--painel-alto); color: var(--texto); }

.botao-texto {
  background: none; border: none; box-shadow: none;
  color: var(--texto-medio); padding: .45rem .6rem; border-radius: var(--raio);
}
.botao-texto:hover { color: var(--roxo); background: var(--painel-alto); }

.botao-largo { width: 100%; }

/* ── Painéis ────────────────────────────────────────────────────────────── */

.painel {
  background: var(--painel);
  border: 1px solid var(--linha);
  border-radius: var(--raio-g);
  padding: 1.6rem;
  box-shadow: var(--sombra);
}

/* ── Estúdio ────────────────────────────────────────────────────────────── */

.estudio { padding: 2.6rem 0 4rem; }

.estudio-cabeca { margin-bottom: 2rem; }
.estudio-cabeca h1 { font-size: clamp(1.7rem, 3.2vw, 2.3rem); }

.compositor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 1.2rem;
  align-items: stretch;
}
@media (max-width: 940px) {
  .compositor { grid-template-columns: 1fr; }
  .editor textarea { min-height: 220px; }
}

.editor { position: relative; display: flex; }
.editor textarea {
  min-height: 340px; height: 100%; font-size: 1.02rem;
  border-radius: var(--raio-g); padding: 1.3rem 1.4rem 3rem;
  background: var(--fundo-alto);
  box-shadow: var(--sombra);
}
.contador {
  position: absolute; right: 1.2rem; bottom: 1rem;
  font-size: .8rem; color: var(--texto-fraco);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.contador.perto { color: var(--alerta); }
.contador.estourou { color: var(--erro); }

/* minmax(0, 1fr) é essencial aqui: sem isso, o grid usa uma coluna implícita
   dimensionada pelo CONTEÚDO (auto), e um texto longo em .voz-meta (que usa
   white-space: nowrap) força a coluna a crescer além dos 330px que o grid
   pai (.compositor) reservou — o painel "vaza" pra fora do card. */
.controles { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.15rem; }

/* Velocidade */
.velocidade-topo {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: .5rem;
}
.velocidade-valor {
  font-variant-numeric: tabular-nums; font-weight: 700;
  color: var(--roxo); font-size: .9rem;
}
input[type=range] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px; border-radius: 3px; padding: 0;
  background: linear-gradient(90deg, var(--roxo) var(--pct,25%), var(--linha-forte) var(--pct,25%));
  border: none;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; cursor: pointer; border: 3px solid var(--roxo);
  box-shadow: 0 2px 8px rgba(88,0,208,.35);
}
input[type=range]::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; cursor: pointer; border: 3px solid var(--roxo);
}
.velocidade-marcas {
  display: flex; justify-content: space-between;
  font-size: .74rem; color: var(--texto-fraco); margin-top: .4rem;
}

/* Seletor de vozes */
/* minmax(0, 1fr) pela mesma razao de .controles: sem isso a coluna
   implicita do grid cresce pra caber o texto nowrap de .voz-meta (ex.:
   "Voz masculina brasileira, tom conversacional"), empurrando a lista
   pra fora do card e criando a barra de rolagem horizontal indesejada. */
.vozes-lista {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: .45rem;
  max-height: 260px; overflow-y: auto; overflow-x: hidden;
  padding-right: .25rem;
}
.vozes-lista::-webkit-scrollbar { width: 6px; }
.vozes-lista::-webkit-scrollbar-thumb {
  background: var(--linha-forte); border-radius: 3px;
}

.voz-opcao {
  display: flex; align-items: center; gap: .7rem;
  padding: .6rem .7rem; border-radius: 11px;
  border: 1.5px solid transparent; cursor: pointer;
  transition: background .14s, border-color .14s;
}
.voz-opcao:hover { background: var(--painel-alto); }
.voz-opcao.escolhida {
  background: var(--gradiente-suave);
  border-color: var(--roxo);
}
.voz-opcao input { position: absolute; opacity: 0; pointer-events: none; }

.voz-selo {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  font-size: .8rem; font-weight: 700; color: #fff;
  background: var(--gradiente);
}
.voz-opcao:not(.escolhida) .voz-selo { background: var(--painel-alto); color: var(--texto-medio); }

.voz-info { min-width: 0; flex: 1; }
.voz-nome {
  font-weight: 700; font-size: .92rem;
  display: flex; align-items: center; gap: .4rem;
}
.voz-meta {
  /* É um <span> (inline por padrão) — sem display:block aqui, o
     overflow/ellipsis abaixo simplesmente não tem efeito nenhum, e o
     texto longo (ex.: descrição do Alex) vaza na largura real do
     conteúdo, empurrando o card e criando a barra horizontal. */
  display: block;
  font-size: .78rem; color: var(--texto-fraco);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.etiqueta-custom {
  font-size: .64rem; font-weight: 700; padding: .1rem .45rem;
  border-radius: 5px; background: var(--roxo); color: #fff;
  text-transform: uppercase; letter-spacing: .02em;
}

/* ── Player ─────────────────────────────────────────────────────────────── */

/*
 * O player tem duas linhas empilhadas (coluna), não uma linha só:
 *   .player-linha  → botão + onda + ações, centralizados entre si
 *   .player-tempo  → "0:00 / 0:02", abaixo, alinhado sob a onda
 *
 * Isso importa porque botão e onda precisam ter o MESMO centro vertical.
 * Se o tempo entrasse na mesma linha flex que a onda (empilhado dentro do
 * mesmo item), a "coluna" onda+tempo ficaria mais alta que o botão, e o
 * flex centralizaria essa coluna inteira — deixando a onda visivelmente
 * acima do centro do botão, puxada pelo peso do texto de tempo abaixo dela.
 */
.player {
  display: flex; flex-direction: column; gap: .4rem;
  padding: .85rem 1rem;
  background: var(--fundo-alto);
  border: 1px solid var(--linha);
  border-radius: var(--raio);
}
.player.destaque {
  background: var(--painel);
  padding: 1.15rem 1.25rem;
  border-radius: var(--raio-g);
  box-shadow: var(--sombra);
}

.player-linha { display: flex; align-items: center; gap: .95rem; }

.btn-play {
  width: 44px; height: 44px; flex-shrink: 0;
  border: none; border-radius: 50%; cursor: pointer;
  background: var(--roxo);
  display: grid; place-items: center;
  transition: transform .13s, background .14s;
  box-shadow: 0 8px 20px -10px rgba(88,0,208,.55);
}
.btn-play:hover { transform: scale(1.06); background: var(--roxo-escuro); }
.btn-play svg { width: 17px; height: 17px; fill: #fff; }
.player.destaque .btn-play { width: 52px; height: 52px; }

.onda-area { flex: 1; min-width: 0; display: flex; align-items: center; }
.onda {
  width: 100%; height: 42px; display: block;
  cursor: pointer; border-radius: 4px;
}
.player.destaque .onda { height: 60px; }

/* Alinhada sob a onda: mesmo recuo do botão à esquerda, mesmo recuo das
   ações à direita, para os números ficarem exatamente sob a faixa de onda. */
.player-tempo {
  display: flex; justify-content: space-between;
  font-size: .74rem; color: var(--texto-fraco);
  font-variant-numeric: tabular-nums;
  padding-left: calc(44px + .95rem);
  padding-right: calc(34px + .2rem);
}
.player.destaque .player-tempo {
  padding-left: calc(52px + .95rem);
  padding-right: calc(34px + .2rem);
}

.player-acoes { display: flex; gap: .2rem; flex-shrink: 0; }
.acao-icone {
  width: 34px; height: 34px; border: none; border-radius: 9px;
  background: transparent; color: var(--texto-fraco);
  cursor: pointer; display: grid; place-items: center;
  transition: background .14s, color .14s;
}
.acao-icone:hover { background: var(--painel-alto); color: var(--roxo); }
.acao-icone svg { width: 16px; height: 16px; }

/* ── Histórico ──────────────────────────────────────────────────────────── */

.historico { margin-top: 3.4rem; }
.historico-cabeca {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.2rem;
  padding-bottom: .9rem; border-bottom: 1px solid var(--linha);
}

.cartoes { display: grid; gap: .9rem; }

.cartao {
  background: var(--painel);
  border: 1px solid var(--linha);
  border-radius: var(--raio-g);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--sombra);
}
.cartao-topo {
  display: flex; align-items: flex-start; gap: .85rem; margin-bottom: .9rem;
}
.cartao-texto {
  flex: 1; min-width: 0;
  color: var(--texto); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.cartao-meta {
  display: flex; flex-wrap: wrap; gap: .5rem .9rem;
  font-size: .78rem; color: var(--texto-fraco); margin-top: .45rem;
}
.cartao-meta span { display: inline-flex; align-items: center; gap: .3rem; }

.cartao-novo { animation: entra .45s cubic-bezier(.2,.8,.3,1); }
@keyframes entra {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: none; }
}

/* ── Vazio ──────────────────────────────────────────────────────────────── */

.vazio {
  text-align: center; padding: 3.2rem 1.5rem;
  border: 1.5px dashed var(--linha-forte);
  border-radius: var(--raio-g);
  color: var(--texto-medio);
  background: var(--fundo-alto);
}
.vazio h3 { margin-bottom: .5rem; color: var(--texto); }

/* ── Avisos ─────────────────────────────────────────────────────────────── */

.aviso {
  display: flex; gap: .75rem; align-items: flex-start;
  padding: .9rem 1.05rem; border-radius: var(--raio);
  border: 1.5px solid var(--linha-forte);
  background: var(--fundo-alto);
  font-size: .9rem; margin-bottom: 1.2rem;
  color: var(--texto);
  transition: opacity .25s ease, transform .25s ease;
}
.aviso.aviso-saindo { opacity: 0; transform: translateY(-6px); }
.aviso-texto { flex: 1; min-width: 0; }
.aviso-fechar {
  flex-shrink: 0; margin-left: auto;
  width: 26px; height: 26px; padding: 0;
  border: none; border-radius: 7px; background: transparent;
  color: var(--texto-fraco); cursor: pointer;
  display: grid; place-items: center;
  transition: background .14s, color .14s;
}
.aviso-fechar:hover { background: rgba(0,0,0,.06); color: var(--texto); }
.aviso-fechar svg { width: 15px; height: 15px; }
.aviso-ok    { border-color: rgba(23,166,115,.35);  background: rgba(23,166,115,.08); }
.aviso-erro  { border-color: rgba(214,49,74,.35);   background: rgba(214,49,74,.08); }
.aviso-alerta{ border-color: rgba(180,94,0,.35);    background: rgba(180,94,0,.08); }
.aviso svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }

/* ── Autenticação ───────────────────────────────────────────────────────── */

.auth {
  flex: 1; display: grid; place-items: center;
  padding: 3rem 1.5rem;
  background: var(--fundo-alto);
}
.auth-caixa { width: min(430px, 100%); }
.auth-cabeca { text-align: center; margin-bottom: 1.8rem; }
.auth-cabeca h1 { font-size: 2rem; }
.auth-cabeca p { color: var(--texto-medio); margin: .6rem 0 0; }
.auth-rodape {
  text-align: center; margin-top: 1.4rem;
  font-size: .9rem; color: var(--texto-medio);
}

.selo-email {
  width: 62px; height: 62px; margin: 0 auto 1.2rem;
  border-radius: 18px; display: grid; place-items: center;
  background: var(--gradiente-suave);
  border: 1.5px solid var(--roxo);
}
.selo-email svg { width: 27px; height: 27px; stroke: var(--roxo); }

/* ── Rodapé ─────────────────────────────────────────────────────────────── */

.rodape {
  background: var(--preto);
  color: #B8B2C8;
  padding: 2.6rem 0;
  font-size: .85rem;
  margin-top: auto;
}
.rodape-conteudo {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1.5rem; flex-wrap: wrap;
}
.rodape-marca { display: flex; align-items: center; gap: .9rem; }
.rodape-simbolo { width: 40px; height: 40px; flex-shrink: 0; display: block; }
.rodape-tagline {
  margin: 0 0 .15rem; color: #EDEAF7; font-weight: 600; font-size: .92rem;
}
.rodape-email { color: #B8B2C8; font-size: .85rem; }
.rodape-email:hover { color: #fff; }
.rodape-copy { margin: 0; color: #7A7488; font-size: .82rem; }
.rodape a { color: #B8B2C8; }
.rodape a:hover { color: #fff; }

@media (max-width: 560px) {
  .rodape-conteudo { flex-direction: column; align-items: flex-start; }
}

/* ── Estados de carga ───────────────────────────────────────────────────── */

.girando { animation: gira 1s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }

.pulsando { animation: pulsa 1.4s ease-in-out infinite; }
@keyframes pulsa { 50% { opacity: .45; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
