/* =============================================================================
 * PsychoTeam · Plataforma — ESTILO (marca, mobile-first)
 * Preto #111110 · Dourado #F2B807 · cards claros.
 * ========================================================================== */
:root {
  --preto: #111110;
  --preto-2: #1c1b19;
  --dourado: #F2B807;
  --dourado-esc: #d9a406;
  --fundo: #f6f5f1;
  --card: #ffffff;
  --linha: #eceae4;
  --texto: #1c1b19;
  --muted: #8a877e;
  --erro: #d64545;
  --ok: #1baf7a;
  --raio: 16px;
  --sombra: 0 6px 24px rgba(17, 17, 16, 0.08);
  --fonte: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--fonte);
  color: var(--texto);
  background: var(--fundo);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

/* ---- Botões ------------------------------------------------------------ */
.btn {
  border: 0; border-radius: 12px; padding: 12px 18px; font-weight: 600; font-size: 15px;
  transition: transform .06s ease, filter .15s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn--cta { background: var(--dourado); color: var(--preto); }
.btn--cta:hover { filter: brightness(1.05); }
.btn--ghost { background: transparent; color: var(--texto); border: 1px solid var(--linha); }
.btn--ghost:hover { background: #efeee9; }
.btn--sm { padding: 8px 12px; font-size: 13px; }

/* ---- LOGIN ------------------------------------------------------------- */
.login {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 500px at 50% -10%, #26251f 0%, var(--preto) 60%);
}
.login__card {
  width: 100%; max-width: 380px; background: var(--card); border-radius: 22px;
  padding: 28px 24px; box-shadow: 0 20px 60px rgba(0,0,0,.35); text-align: center;
}
.login__logo { width: 76px; height: 76px; object-fit: contain; margin: 0 auto 8px; }
.login__title { font-size: 22px; margin: 4px 0 2px; }
.login__sub { color: var(--muted); margin: 0 0 20px; font-size: 14px; }
.login__form { display: grid; gap: 12px; text-align: left; }
.cf-box { display: flex; justify-content: center; min-height: 0; }
.cf-box:empty { display: none; }
.login__form label { font-size: 13px; font-weight: 600; color: #4a473f; display: grid; gap: 6px; }
.login__form input {
  border: 1px solid var(--linha); border-radius: 12px; padding: 12px 14px; font-size: 15px; width: 100%;
}
.login__form input:focus { outline: 2px solid var(--dourado); border-color: transparent; }
.login__form .btn { width: 100%; margin-top: 2px; }
.login__demo {
  margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--linha);
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; font-size: 12px; color: var(--muted);
}
.login__demo strong { flex-basis: 100%; color: #4a473f; }
.chip {
  border: 1px solid var(--linha); background: #faf9f6; border-radius: 999px;
  padding: 7px 12px; font-size: 12px; font-weight: 600; color: var(--texto);
}
.chip:hover { border-color: var(--dourado); }
.login__note { font-size: 11.5px; color: var(--muted); margin: 16px 0 0; line-height: 1.5; }

/* ---- TOPBAR ------------------------------------------------------------ */
.topbar {
  background: var(--preto); color: #fff; display: flex; align-items: center;
  justify-content: space-between; padding: 12px 16px; position: sticky; top: 0; z-index: 10;
}
.topbar__brand { display: flex; align-items: center; gap: 10px; }
.topbar__logo { width: 34px; height: 34px; object-fit: contain; }
.topbar__name { font-weight: 700; letter-spacing: .2px; }
.topbar__user { display: flex; align-items: center; gap: 12px; }
.topbar__who { font-size: 13px; color: #cfccc2; }
.topbar .btn--ghost { color: #fff; border-color: #3a3833; }
.topbar .btn--ghost:hover { background: #2a2823; }

/* ---- PAGE -------------------------------------------------------------- */
.page { max-width: 900px; margin: 0 auto; padding: 20px 16px 64px; }
.h1 { font-size: 22px; margin: 8px 0 2px; }
.h2 { font-size: 16px; margin: 0; }
.muted { color: var(--muted); font-size: 13px; margin: 2px 0 0; }
.dash-head { margin-bottom: 14px; }
.card { background: var(--card); border-radius: var(--raio); box-shadow: var(--sombra); border: 1px solid var(--linha); }

/* ---- PR CARDS ---------------------------------------------------------- */
.pr-cards { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 4px 0 18px; }
.pr-card { padding: 16px; border-left: 5px solid var(--cor); }
.pr-card__lift { font-size: 13px; font-weight: 700; color: #4a473f; text-transform: uppercase; letter-spacing: .4px; }
.pr-card__pr { font-size: 30px; font-weight: 800; line-height: 1.1; margin-top: 4px; display: flex; align-items: baseline; gap: 8px; }
.pr-card__tag { font-size: 11px; font-weight: 700; color: var(--cor); background: color-mix(in srgb, var(--cor) 14%, white); padding: 3px 8px; border-radius: 999px; letter-spacing: .3px; }
.pr-card__sub { font-size: 13px; color: #55524a; margin-top: 6px; }
.pr-card__delta { font-size: 12px; font-weight: 700; margin-top: 6px; }
.pr-card__delta.up { color: var(--ok); }
.pr-card__delta.down { color: var(--erro); }

/* ---- PR card: real + edição inline ------------------------------------ */
.pr-card__comp { font-size: 10px; font-weight: 700; color: var(--muted); background: #efeee9; padding: 2px 7px; border-radius: 999px; vertical-align: middle; text-transform: none; letter-spacing: 0; }
.pr-card__real { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12.5px; color: #55524a; min-height: 30px; }
.pr-edit { border: 1px solid var(--linha); background: #faf9f6; border-radius: 8px; padding: 3px 9px; font-size: 11.5px; font-weight: 600; color: var(--texto); }
.pr-edit:hover { border-color: var(--dourado); }
.pr-input { border: 1px solid var(--dourado); border-radius: 8px; padding: 5px 8px; font-size: 14px; width: 80px; font-family: inherit; }
.pr-ok, .pr-cancel { border: 1px solid var(--linha); background: #fff; border-radius: 8px; width: 30px; height: 30px; font-weight: 700; }
.pr-ok { color: var(--ok); border-color: var(--ok); }
.pr-cancel { color: var(--erro); }

/* ---- PR card: exercício de competição --------------------------------- */
.pr-card__compex { display: block; margin-top: 10px; font-size: 11px; font-weight: 700; color: #6a675e; text-transform: uppercase; letter-spacing: .3px; }
.pr-card__compex.muted { text-transform: none; font-weight: 400; font-size: 12px; }
.pr-card__compex .comp-sel { display: block; margin-top: 4px; width: 100%; border: 1px solid var(--linha); border-radius: 8px; padding: 7px 8px; font-size: 12.5px; font-family: inherit; font-weight: 400; text-transform: none; background: #fff; }
.pr-card__compex .comp-sel:focus { outline: 2px solid var(--dourado); border-color: transparent; }

/* ---- Meus dados: e-mail + zona de exclusão ---------------------------- */
.dados-sub { font-size: 12.5px; margin-top: 2px; }
.dados-email { font-size: 11.5px; margin-top: 2px; }
.dados-email-nota { opacity: .8; }
.dados-danger { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--linha); }

/* ---- Meus PRs por variação -------------------------------------------- */
.var-card { padding: 16px; margin-bottom: 18px; }
.var-list { margin-top: 12px; display: grid; gap: 6px; }
.var-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 10px 12px; background: #faf9f6; border: 1px solid var(--linha); border-radius: 10px; }
.var-nome { font-weight: 600; font-size: 13.5px; }
.var-est { font-size: 14px; font-weight: 700; text-align: right; white-space: nowrap; }
.var-est small { font-size: 10px; font-weight: 400; color: var(--muted); display: block; }
.var-real { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #55524a; white-space: nowrap; }

/* ---- Flexões (card do painel) ---------------------------------------- */
.flex-card { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 16px; padding: 16px 18px; }
.flex-card__sub { font-size: 12.5px; margin-top: 3px; max-width: 380px; }
.flex-card__num { display: flex; align-items: baseline; gap: 16px; white-space: nowrap; }
.flex-reps { font-size: 26px; font-weight: 800; line-height: 1; }
.flex-reps small, .flex-score small { display: block; font-size: 10px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-top: 3px; }
.flex-score { font-size: 22px; font-weight: 800; line-height: 1; color: var(--dourado-esc, #b8860b); }
.flex-card__edit { white-space: nowrap; }
@media (max-width: 560px) {
  .flex-card { grid-template-columns: 1fr auto; }
  .flex-card__edit { grid-column: 1 / -1; }
}

/* ---- Adicionar PR de exercício ---------------------------------------- */
.var-add { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--linha); }
.add-pr-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; margin-top: 10px; align-items: center; }
.add-pr-row input, .add-pr-row select { border: 1px solid var(--linha); border-radius: 10px; padding: 9px 10px; font-size: 14px; font-family: inherit; background: #fff; }
.add-pr-row input:focus, .add-pr-row select:focus { outline: 2px solid var(--dourado); border-color: transparent; }
.add-pr-row input[type=number] { width: 100px; }

/* ---- Ranking por exercício -------------------------------------------- */
.ex-rank-sel { border: 1px solid var(--linha); border-radius: 10px; padding: 7px 10px; font-size: 13px; font-family: inherit; background: #fff; max-width: 220px; }
.ex-rank-sel:focus { outline: 2px solid var(--dourado); border-color: transparent; }

/* ---- CHART ------------------------------------------------------------- */
.chart-card { padding: 16px; margin-bottom: 18px; }
.chart-card__head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.chart-wrap { position: relative; height: 320px; }
.legend { display: flex; gap: 6px; flex-wrap: wrap; }
.legend__item { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--linha); background: #faf9f6; border-radius: 999px; padding: 5px 11px; font-size: 12px; font-weight: 600; color: var(--texto); }
.legend__item--off { opacity: .4; text-decoration: line-through; }
.legend__swatch { width: 18px; height: 0; border-top: 3px solid var(--cor); display: inline-block; }
.legend__swatch--dash { border-top-style: dashed; }
.legend__swatch--dot { border-top-style: dotted; border-top-width: 4px; }

/* ---- FORM -------------------------------------------------------------- */
.form-card { padding: 16px; }
.form-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.sem-select { font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.sem-select select, .fld select, .fld input {
  border: 1px solid var(--linha); border-radius: 10px; padding: 9px 10px; font-size: 14px; font-family: inherit; background: #fff;
}
.sem-select select:focus, .fld select:focus, .fld input:focus { outline: 2px solid var(--dourado); border-color: transparent; }
.lift-forms { display: grid; gap: 12px; }
.lift-form { border: 1px solid var(--linha); border-radius: 12px; padding: 12px; border-left: 5px solid var(--cor); }
.lift-form__head { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 10px; }
.lift-form__head .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--cor); }
.lift-form__head .alvo { margin-left: auto; font-size: 11.5px; color: var(--muted); font-weight: 600; background: #faf9f6; border: 1px solid var(--linha); padding: 3px 8px; border-radius: 999px; }
.lift-form__row { display: grid; grid-template-columns: 1fr; gap: 8px; }
.fld { display: grid; gap: 4px; font-size: 11.5px; font-weight: 700; color: #6a675e; text-transform: uppercase; letter-spacing: .3px; }
.lift-form__est { margin-top: 8px; font-size: 12.5px; color: #55524a; }
.lift-form__est b { color: var(--texto); font-size: 14px; }
.form-actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.form-hint { font-size: 12px; color: var(--muted); }

/* ---- COACH GRID -------------------------------------------------------- */
.grid-alunos { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 12px; }
.aluno-card { text-align: left; padding: 16px; display: grid; gap: 10px; }
.aluno-card:hover { border-color: var(--dourado); transform: translateY(-1px); transition: .12s; }
.aluno-card__top { display: flex; align-items: center; gap: 12px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--preto); color: var(--dourado); font-weight: 800; display: grid; place-items: center; font-size: 18px; }
.aluno-card__nome { font-weight: 700; }
.aluno-card__meta { font-size: 12px; color: var(--muted); }
.aluno-card__total { font-size: 13px; color: #55524a; }
.aluno-card__total b { font-size: 15px; }

/* ---- TOASTS ------------------------------------------------------------ */
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 50; width: min(92vw, 420px); }
.toast { background: var(--preto); color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 14px; text-align: center; opacity: 0; transform: translateY(10px); transition: .3s; box-shadow: var(--sombra); }
.toast.show { opacity: 1; transform: translateY(0); }
.toast--erro { background: #7a1f1f; }
.toast--ok { border-left: 4px solid var(--dourado); }

/* ---- SIGNUP (autocadastro) -------------------------------------------- */
.login__card--wide { max-width: 460px; }
.login__ou { display: flex; align-items: center; gap: 10px; margin: 14px 0 10px; color: var(--muted); font-size: 12px; }
.login__ou::before, .login__ou::after { content: ''; flex: 1; height: 1px; background: var(--linha); }
.btn--signup { width: 100%; }
.aviso-nome { background: #fff7dd; border: 1px solid var(--dourado); border-radius: 12px; padding: 10px 12px; font-size: 12.5px; text-align: left; margin: 0 0 14px; line-height: 1.5; }
.lin2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lin3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.sec-label { font-size: 12.5px; font-weight: 600; color: #4a473f; margin: 6px 0 0; text-align: left; }

/* ---- COACH bar (voltar + excluir) ------------------------------------- */
.coach-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.btn--danger { background: transparent; color: var(--erro); border: 1px solid #eecccc; }
.btn--danger:hover { background: var(--erro); color: #fff; border-color: var(--erro); }

/* ---- Peso corporal semanal -------------------------------------------- */
.bw-field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: #4a473f; background: #faf9f6; border: 1px solid var(--linha); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; }
.bw-field input { border: 1px solid var(--linha); border-radius: 10px; padding: 9px 10px; font-size: 15px; font-family: inherit; max-width: 160px; }
.bw-field input:focus { outline: 2px solid var(--dourado); border-color: transparent; }
.bw-field .muted { font-weight: 400; font-size: 11.5px; }

/* ---- TABS (aluno) ------------------------------------------------------ */
.tabs { display: inline-flex; gap: 4px; background: #efeee9; border-radius: 999px; padding: 4px; margin-bottom: 6px; }
.tab { border: 0; background: transparent; padding: 8px 16px; border-radius: 999px; font-weight: 700; font-size: 13px; color: #6a675e; }
.tab--on { background: var(--preto); color: #fff; }

/* ---- Meus dados (editar cadastro) ------------------------------------- */
.dados-card { padding: 14px 16px; margin-bottom: 12px; }
.dados-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.dados-head .muted { font-size: 12.5px; }
.dados-edit { display: grid; gap: 10px; margin-top: 12px; }
.dados-edit label { font-size: 12px; font-weight: 600; color: #4a473f; display: grid; gap: 5px; }
.dados-edit input, .dados-edit select { border: 1px solid var(--linha); border-radius: 10px; padding: 9px 10px; font-size: 14px; font-family: inherit; background: #fff; }
.dados-edit input:focus, .dados-edit select:focus { outline: 2px solid var(--dourado); border-color: transparent; }
.dados-edit .btn { justify-self: start; }

/* ---- SWITCH de compartilhar ------------------------------------------- */
.share-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--card); border: 1px solid var(--linha); border-radius: var(--raio); padding: 12px 16px; margin-bottom: 16px; box-shadow: var(--sombra); }
.share-row .muted { font-size: 12.5px; }
.switch { position: relative; display: inline-block; width: 50px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch__slider { position: absolute; inset: 0; background: #cfccc2; border-radius: 999px; transition: .2s; }
.switch__slider::before { content: ''; position: absolute; height: 22px; width: 22px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .switch__slider { background: var(--dourado); }
.switch input:checked + .switch__slider::before { transform: translateX(22px); }

/* ---- METRIC SWITCH (lentes do gráfico) -------------------------------- */
.metric-switch { display: inline-flex; gap: 4px; background: #efeee9; border-radius: 10px; padding: 3px; flex-wrap: wrap; }
.ms { border: 0; background: transparent; padding: 7px 11px; border-radius: 8px; font-size: 12.5px; font-weight: 700; color: #6a675e; }
.ms--on { background: #fff; color: var(--texto); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.chart-caption { font-size: 12.5px; color: var(--muted); margin: 4px 0 8px; }
.chart-foot { font-size: 11.5px; color: var(--muted); margin: 8px 0 0; }
.legend__extra { font-size: 10px; font-weight: 700; color: var(--muted); background: #efeee9; padding: 1px 5px; border-radius: 999px; }

/* ---- EXTRAS no formulário --------------------------------------------- */
.custom-ex { border: 1px solid var(--linha); border-radius: 10px; padding: 9px 10px; font-size: 14px; font-family: inherit; width: 100%; margin-top: 8px; }
.custom-ex.hidden { display: none; }
.hidden { display: none; }
.extras-block { border-top: 1px dashed var(--linha); margin-top: 16px; padding-top: 14px; }
.extras-head { font-size: 14px; margin-bottom: 10px; }
.extras-head .muted { font-size: 12px; }
.extra-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr auto; gap: 8px; margin-bottom: 8px; align-items: center; }
.extra-row input, .extra-row select { border: 1px solid var(--linha); border-radius: 10px; padding: 9px 10px; font-size: 14px; font-family: inherit; background: #fff; width: 100%; }
.extra-del { border: 1px solid var(--linha); background: #faf9f6; border-radius: 10px; width: 38px; height: 38px; color: var(--erro); font-weight: 700; }
.extra-del:hover { border-color: var(--erro); }

/* ---- COMPARAÇÕES / RANKING -------------------------------------------- */
.rank-card { padding: 16px; margin-bottom: 16px; }
.rank-card .h2 .muted { font-weight: 400; }
.rank-list { margin-top: 12px; display: grid; gap: 6px; }
.rank-row { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: #faf9f6; border: 1px solid var(--linha); }
.rank-row--eu { background: color-mix(in srgb, var(--dourado) 14%, white); border-color: var(--dourado); }
.rank-pos { font-weight: 800; color: var(--muted); text-align: center; }
.rank-row:nth-child(1) .rank-pos { color: var(--dourado); }
.rank-nome { font-weight: 600; font-size: 14px; }
.rank-voce { font-size: 10px; font-weight: 800; background: var(--preto); color: var(--dourado); padding: 2px 6px; border-radius: 999px; vertical-align: middle; }
.rank-val { font-size: 14px; text-align: right; }
.rank-val .muted { font-size: 12px; }
.rank-nota { font-size: 11.5px; color: var(--muted); margin: 12px 0 0; line-height: 1.5; }
.nudge { background: #fff7dd; border: 1px solid var(--dourado); border-radius: 12px; padding: 12px 14px; font-size: 13px; margin-bottom: 16px; }
.badge-share { color: var(--dourado); font-weight: 800; }

/* ---- RESPONSIVO (desktop) --------------------------------------------- */
@media (min-width: 640px) {
  .pr-cards { grid-template-columns: repeat(3, 1fr); }
  .lift-form__row { grid-template-columns: 2fr 1fr 1fr 1fr; align-items: end; }
  .grid-alunos { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .extra-row { grid-template-columns: 1fr 1fr 1fr auto; }
  .extra-row [data-f="exercicio"] { grid-column: 1 / -1; }
}
