:root {
    --bg: #f5f6f4;
    --surface: #ffffff;
    --text: #1d2420;
    --muted: #5f6b64;
    --line: #e1e5e2;
    --primary: #0f6b5c;
    --primary-dark: #0a5045;
    --primary-soft: #e3f1ee;
    --accent: #b45309;
    --accent-soft: #fdf1e3;
    --danger: #b42318;
    --danger-soft: #fdecea;
    --ok: #157f3c;
    --ok-soft: #e6f4ea;
    --radius: 12px;
    color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
a { color: var(--primary); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
small, .muted { color: var(--muted); }
.muted { font-size: .9rem; }

/* Estrutura do painel */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-inner { max-width: 1100px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: .85rem; }
.nav { display: flex; gap: 4px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.nav a { white-space: nowrap; text-decoration: none; color: var(--muted); padding: 6px 10px; border-radius: 8px; font-size: .92rem; }
.nav a:hover { background: var(--bg); color: var(--text); }
.nav a.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
.account { display: flex; align-items: center; gap: 10px; font-size: .9rem; }
.page { max-width: 1100px; margin: 0 auto; padding: 24px 16px 64px; }
.page.narrow { max-width: 720px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }

/* Blocos */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.card > :last-child { margin-bottom: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.stat { font-size: 1.6rem; font-weight: 700; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack > * + * { margin-top: 10px; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 12px 0; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; padding-top: 0; }
.empty { color: var(--muted); text-align: center; padding: 18px; }

/* Etiquetas */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--bg); color: var(--muted); white-space: nowrap; }
.badge.ok, .badge.completed, .badge.active, .badge.paid { background: var(--ok-soft); color: var(--ok); }
.badge.warn, .badge.pending, .badge.review { background: var(--accent-soft); color: var(--accent); }
.badge.danger, .badge.cancelled, .badge.missed { background: var(--danger-soft); color: var(--danger); }
.badge.info, .badge.scheduled { background: var(--primary-soft); color: var(--primary-dark); }

/* Formulários */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
.field { margin-bottom: 14px; }
.field small { display: block; font-weight: 400; margin-top: 3px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=url], input[type=tel], input[type=search], input[type=month], input[type=datetime-local], select, textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; font: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
textarea { min-height: 90px; resize: vertical; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; }
.check input { margin-top: 4px; }
.form-grid { display: grid; gap: 0 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 9px 16px; border-radius: 9px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--bg); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.danger { color: var(--danger); }
.btn.small { padding: 5px 10px; font-size: .85rem; }
.btn.block { width: 100%; }
.btn.whats { background: #1f9d55; border-color: #1f9d55; color: #fff; }
.link-btn { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; cursor: pointer; text-decoration: underline; }
.link-btn.danger { color: var(--danger); }
form.inline { display: inline; }

/* Avisos */
.flash { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; }
.flash.ok { background: var(--ok-soft); color: var(--ok); }
.flash.error { background: var(--danger-soft); color: var(--danger); }
.flash.info { background: var(--primary-soft); color: var(--primary-dark); }
.flash a { color: inherit; font-weight: 700; }
.flash ul { margin: 0; padding-left: 18px; }

/* Tabelas */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }

/* Página pública do plano */
.hero { background: var(--primary); color: #fff; }
.hero-inner { max-width: 880px; margin: 0 auto; padding: 32px 16px; }
.hero h1 { font-size: 1.8rem; }
.hero p { opacity: .9; }
.hero .tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.hero .tags span { background: rgba(255, 255, 255, .15); padding: 3px 10px; border-radius: 999px; font-size: .85rem; }
.plan-page { max-width: 880px; margin: 0 auto; padding: 24px 16px 64px; }
.package { display: flex; flex-direction: column; }
.package .price { font-size: 1.5rem; font-weight: 700; color: var(--primary-dark); }
.package .old { text-decoration: line-through; color: var(--muted); font-size: .9rem; }
.package .grow { flex: 1; }
.promo { border-color: #f3c58d; background: var(--accent-soft); }
.promo-tag { color: var(--accent); font-weight: 700; font-size: .85rem; }
.quote-line { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.quote-line span:last-child { white-space: nowrap; }
.quote-line.total { font-size: 1.2rem; font-weight: 700; border-bottom: 0; }

/* Escolha de horários */
.slots { display: flex; flex-wrap: wrap; gap: 8px; }
.slot { position: relative; }
.slot input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.slot span { display: block; padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-weight: 600; font-size: .9rem; }
.slot input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.slot input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.slot input:disabled + span { opacity: .4; }

/* Manuais (ajuda) */
.help-toc { columns: 2 220px; gap: 24px; margin: 0; padding-left: 18px; }
.help-toc li { margin-bottom: 4px; break-inside: avoid; }
.help-section { scroll-margin-top: 16px; }
.help-section h2 { display: flex; align-items: center; gap: 10px; }
.help-section h2 .num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; font-size: .9rem; flex: none; }
.help-section ol, .help-section ul { padding-left: 20px; }
.help-section li { margin-bottom: 6px; }
.help-tip { background: var(--primary-soft); color: var(--primary-dark); border-radius: 10px; padding: 10px 12px; margin: 10px 0; font-size: .92rem; }
.help-video { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); background: #000; }
.help-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.help-cards a.card { text-decoration: none; color: inherit; display: block; }
.help-cards a.card:hover { border-color: var(--primary); }

/* Escolha da forma de pagamento (aluno) */
.pay-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.pay-option { position: relative; cursor: pointer; }
.pay-option input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.pay-option > span { display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.pay-option .pay-total { font-size: 1.15rem; font-weight: 700; color: var(--primary-dark); }
.pay-option small { color: var(--muted); }
.pay-option input:checked + span { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); background: var(--primary-soft); }
.pay-option input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.pay-pending { margin-top: 12px; }
.method-list { display: grid; gap: 8px; }
.method-list label { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.method-list input { width: auto; margin-top: 3px; }

/* Cor da página do instrutor (perfil) */
.color-picker { display: grid; gap: 12px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 36px; height: 36px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--text); }
.swatch:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.color-custom { margin: 0; max-width: 220px; }
.color-custom input[type=color] { height: 42px; padding: 4px; cursor: pointer; }
.color-preview { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; max-width: 420px; }
.color-preview-top { background: var(--primary); color: #fff; font-weight: 700; padding: 14px 16px; }
.color-preview-body { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px; background: var(--bg); }
.preview-chip { padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-weight: 600; font-size: .9rem; }
.preview-chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Seletor em dois passos (dia → horário). Sem JavaScript, todos os dias ficam abertos. */
.picker-step { font-weight: 700; font-size: .9rem; margin: 14px 0 8px; }
.picker-step:first-child { margin-top: 4px; }
.picker-hint { color: var(--muted); font-size: .9rem; }
.day-tabs { display: none; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 8px; }
@media (max-width: 480px) {
    .day-tabs { grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 6px; }
    .day-tab { padding: 6px 2px; }
    .day-tab b { font-size: 1rem; }
}
.day-tab { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 4px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text); font: inherit; cursor: pointer; line-height: 1.15; }
.day-tab b { font-size: 1.15rem; }
.day-tab-dow, .day-tab-mon { font-size: .72rem; text-transform: uppercase; color: var(--muted); }
.day-tab:hover { border-color: var(--primary); }
.day-tab:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.day-tab.has-picked { border-color: var(--primary); background: var(--primary-soft); }
.day-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.day-tab.active .day-tab-dow, .day-tab.active .day-tab-mon { color: rgba(255, 255, 255, .85); }
.day-tab-count { position: absolute; top: -7px; right: -7px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 700; display: grid; place-items: center; }
.day-tab-count[hidden] { display: none; }
.day-panel { margin-bottom: 12px; }
.day-panel h3 { font-size: .95rem; margin-bottom: 8px; text-transform: capitalize; }
.picker:not(.is-enhanced) .picker-step, .picker:not(.is-enhanced) .picker-hint { display: none; }
.picker.is-enhanced .day-tabs { display: grid; }
.picker.is-enhanced .day-panel { display: none; }
.picker.is-enhanced .day-panel.active { display: block; }
.picked-list { display: flex; flex-wrap: wrap; gap: 6px; }
.picked-chip { border: 1px solid var(--primary); background: var(--primary-soft); color: var(--primary-dark); border-radius: 999px; padding: 4px 10px; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; text-transform: capitalize; }
.picked-chip:hover { background: #fff; }
.picker-bar { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 12px 16px; margin: 16px -18px -18px; border-radius: 0 0 var(--radius) var(--radius); display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Pix */
.pix-card { border-color: var(--primary); }
.pix { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.pix img { border: 1px solid var(--line); border-radius: 10px; background: #fff; max-width: 100%; height: auto; }
.pix .grow { flex: 1; min-width: 240px; }

/* Agenda do instrutor */
.lesson { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.lesson time { font-weight: 700; min-width: 54px; }
.copy-box { display: flex; gap: 8px; }
.copy-box input { flex: 1; min-width: 0; }
.steps li { display: flex; gap: 8px; align-items: center; padding: 4px 0; }
.steps .done { color: var(--ok); }
details summary { cursor: pointer; color: var(--primary); font-weight: 600; font-size: .9rem; }

/* Login */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth .card { width: 100%; max-width: 400px; }

@media (max-width: 640px) {
    .page-head h1 { font-size: 1.35rem; }
    .account span { display: none; }
    .topbar-inner { gap: 8px 12px; }
    .brand { flex: 1; }
    .nav { order: 3; flex-basis: 100%; margin: 0 -6px; }
}

/* Termos e privacidade */
.legal h2 { margin-top: 20px; font-size: 1.15rem; }
.legal h2:first-child { margin-top: 0; }
.legal li { margin-bottom: 6px; }

/* Gráfico de barras simples (relatórios) */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 200px; padding-top: 8px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; }
.bar-fill { width: 100%; max-width: 56px; background: var(--primary); border-radius: 6px 6px 0 0; }
.bar-value { font-size: .72rem; color: var(--muted); white-space: nowrap; }
.bar-label { font-size: .8rem; color: var(--muted); text-transform: capitalize; }

/* Ficha de evolução e avaliações */
.progress-track { height: 10px; background: var(--bg); border-radius: 999px; overflow: hidden; margin: 10px 0 14px; }
.progress-track span { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px 16px; }
.skill label { font-size: .9rem; font-weight: 600; display: block; margin-bottom: 4px; }
.stars { color: #d97706; letter-spacing: 1px; }
.hero-rating { font-weight: 600; margin: 6px 0 10px; }
.stars-input { border: 0; padding: 0; margin: 0 0 10px; display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.stars-input legend { float: left; width: 100%; margin-bottom: 4px; }
.stars-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.stars-input label { font-size: 2rem; line-height: 1; color: var(--line); cursor: pointer; }
.stars-input input:checked ~ label, .stars-input label:hover, .stars-input label:hover ~ label { color: #d97706; }
.stars-input input:focus-visible + label { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
