:root {
  --rosa:       #C2185B;
  --rosa-forte: #8E1248;
  --rosa-claro: #FBD7E6;
  --texto:      #262626;
  --apagado:    #767676;
  --linha:      #ECECEC;
  --fundo:      #FFFFFF;
  --slot:       15px;   /* altura de 15 minutos */
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'Poppins', system-ui, sans-serif;
  color: var(--texto);
  background: var(--fundo);
  min-height: 100dvh;
}

.oculto { display: none !important; }

/* ---------------------------------------------------------- telas de entrada */

.tela-cheia {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: linear-gradient(160deg, #FFF5F9 0%, #FFFFFF 60%);
}

.cartao {
  width: min(400px, 100%);
  display: grid;
  gap: 14px;
  padding: 28px 24px 24px;
  border: 1px solid var(--linha);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(194, 24, 91, .08);
}

.marca {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  color: var(--rosa);
  text-align: center;
}

.subtitulo {
  margin-top: -10px;
  text-align: center;
  color: var(--apagado);
  font-size: 14px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.aviso {
  font-size: 13px;
  color: var(--apagado);
  background: #FFF5F9;
  border-radius: 12px;
  padding: 12px 14px;
  line-height: 1.5;
}

label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--apagado);
}

input, select {
  font: inherit;
  color: var(--texto);
  padding: 12px 14px;
  border: 1px solid var(--linha);
  border-radius: 12px;
  background: #fff;
  width: 100%;
}

input:focus, select:focus { outline: 2px solid var(--rosa-claro); border-color: var(--rosa); }

.botao {
  font: inherit;
  font-weight: 600;
  padding: 14px;
  border: 0;
  border-radius: 12px;
  background: var(--rosa);
  color: #fff;
  cursor: pointer;
}

.botao:active { background: var(--rosa-forte); }
.botao:disabled { opacity: .5; cursor: default; }

.botao.fantasma { background: transparent; color: var(--apagado); font-weight: 500; }

.erro { color: #C0281B; font-size: 13px; min-height: 18px; text-align: center; }

/* ---------------------------------------------------------- topo da agenda */

.topo {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #fff;
  border-bottom: 1px solid var(--linha);
  padding: env(safe-area-inset-top) 12px 8px;
}

.topo-linha {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  padding-top: 8px;
}

.data { text-align: center; line-height: 1.25; }
.data strong { display: block; font-size: 17px; }
.data span { font-size: 12px; color: var(--apagado); }

.icone {
  font-size: 26px;
  line-height: 1;
  background: none;
  border: 0;
  color: var(--rosa);
  cursor: pointer;
  padding: 6px;
}

.topo-acoes { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.espacador { flex: 1; }

.pilula {
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--rosa-claro);
  background: #FFF5F9;
  color: var(--rosa);
  cursor: pointer;
  width: auto;
}

.pilula.fantasma { background: #fff; border-color: var(--linha); color: var(--apagado); }

/* ---------------------------------------------------------- grade */

.grade {
  display: grid;
  grid-template-columns: 52px repeat(var(--salas, 2), 1fr);
  padding: 0 12px 24px;
  position: relative;
}

.cabecalho-sala {
  position: sticky;
  top: 92px;
  z-index: 4;
  background: #fff;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 0;
  border-bottom: 1px solid var(--linha);
}

.hora {
  grid-column: 1;
  font-size: 11px;
  color: var(--apagado);
  text-align: right;
  padding-right: 8px;
  transform: translateY(-6px);
}

.celula {
  border-top: 1px solid var(--linha);
  cursor: pointer;
}

.celula.meia { border-top-style: dashed; border-top-color: #F6F6F6; }
.celula:active { background: #FFF5F9; }

.reserva {
  margin: 1px 2px;
  padding: 5px 7px;
  border-radius: 8px;
  background: var(--rosa-claro);
  border-left: 3px solid var(--rosa);
  font-size: 11px;
  line-height: 1.3;
  overflow: hidden;
  cursor: pointer;
  z-index: 2;
}

.reserva.minha { background: var(--rosa); border-left-color: var(--rosa-forte); color: #fff; }
.reserva strong { display: block; font-weight: 600; }
.reserva span { opacity: .8; }

.rodape { text-align: center; font-size: 12px; color: var(--apagado); padding: 0 16px 32px; }

/* ---------------------------------------------------------- folha */

.folha {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(0, 0, 0, .35);
  display: grid;
  align-items: end;
}

.folha-conteudo {
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
  display: grid;
  gap: 12px;
  max-height: 88dvh;
  overflow-y: auto;
}

.puxador {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--linha);
  margin: 4px auto 8px;
}

.folha-conteudo h2 { font-family: 'Playfair Display', serif; font-size: 22px; }
.folha-conteudo h3 { font-size: 14px; margin-top: 10px; color: var(--apagado); }
.folha-sub { font-size: 13px; color: var(--apagado); margin-top: -8px; }

#form-profissional { display: grid; gap: 12px; border-top: 1px solid var(--linha); padding-top: 14px; }

.lista-equipe { list-style: none; display: grid; gap: 8px; }

.lista-equipe li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  padding: 10px 12px;
  background: #FAFAFA;
  border-radius: 10px;
}

.lista-equipe em { font-style: normal; font-size: 11px; color: var(--rosa); font-weight: 600; }

/* ---------------------------------------------------------- avulsos */

.aviso-flutuante {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 30;
  background: var(--texto);
  color: #fff;
  font-size: 13px;
  padding: 12px 18px;
  border-radius: 999px;
  max-width: calc(100% - 32px);
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
}

.girando {
  width: 34px;
  height: 34px;
  border: 3px solid var(--rosa-claro);
  border-top-color: var(--rosa);
  border-radius: 50%;
  animation: girar .8s linear infinite;
}

@keyframes girar { to { transform: rotate(360deg); } }

@media (min-width: 720px) {
  .grade { max-width: 860px; margin: 0 auto; }
  .topo { padding-inline: 24px; }
  .folha { align-items: center; justify-items: center; }
  .folha-conteudo { border-radius: 20px; width: min(420px, 92vw); }
}

/* ---------------------------------------------------------- abas e listas do estúdio */

.abas { display: flex; gap: 6px; background: #F6F6F6; border-radius: 999px; padding: 4px; }

.aba {
  flex: 1;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--apagado);
  cursor: pointer;
}

.aba.ativa { background: #fff; color: var(--rosa); font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.08); }

#form-login, #form-cadastro { display: grid; gap: 14px; }

.lista { list-style: none; display: grid; gap: 6px; }

.lista li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  padding: 10px 12px;
  background: #FAFAFA;
  border-radius: 10px;
}

.lista em { font-style: normal; font-size: 11px; color: var(--rosa); font-weight: 600; }

.remover {
  font: inherit;
  font-size: 12px;
  background: none;
  border: 0;
  color: var(--apagado);
  text-decoration: underline;
  cursor: pointer;
  padding: 2px 4px;
}

.linha-form { display: flex; gap: 8px; align-items: center; }
.linha-form input, .linha-form select { flex: 1; }
.linha-form .ate { font-size: 13px; color: var(--apagado); }

.bloco-form { display: grid; gap: 10px; }

.botao.curto { padding: 12px 16px; white-space: nowrap; }

/* A barra de ações não pode estourar a largura do celular. */
.topo-acoes { flex-wrap: wrap; }
#escolher-data { max-width: 150px; flex: 0 1 auto; min-width: 0; }

/* ---------------------------------------------------------- assinatura */
.faixa-assinatura {
  display: block; margin-top: 10px; padding: 8px 12px; border-radius: 10px;
  font-size: 13px; font-weight: 600; text-decoration: none;
  background: #FFF5F9; color: var(--rosa-forte); border: 1px solid var(--rosa-claro);
}
.faixa-assinatura.vencida { background: #FDECEA; color: #A42A1C; border-color: #F5C2BC; }
