/* ==========================================================================
   Sala Cheia — design system
   ========================================================================== */

:root {
  --ink: #1a2238;
  --ink-2: #4a5470;
  --paper: #fbf7f0;
  --paper-2: #f3ece0;
  --white: #ffffff;
  --line: #e4dccd;
  --brand: var(--tenant-primary, #1f2a44);
  --accent: var(--tenant-accent, #e8674a);
  --ok: #2f7d5b;
  --warn: #b7791f;
  --err: #b93a32;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(26, 34, 56, 0.06), 0 8px 24px rgba(26, 34, 56, 0.06);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Plus Jakarta Sans", system-ui, sans-serif;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  color: var(--ink);
}

h1 {
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  line-height: 1.06;
}

h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.6rem);
  line-height: 1.12;
}

h3 {
  font-size: 1.3rem;
}

p {
  margin: 0 0 1em;
}

em {
  font-style: italic;
  color: var(--accent);
}

:focus-visible {
  outline: 3px solid rgba(232, 103, 74, 0.5);
  outline-offset: 2px;
}

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

/* ---- layout helpers ---- */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 96px 0;
}

.section--alt {
  background: var(--paper-2);
}

.section--dark {
  background: var(--ink);
  color: #f4efe4;
}

.section--dark h1,
.section--dark h2,
.section--dark h3 {
  color: #f4efe4;
}

@media (max-width: 800px) {
  .section {
    padding: 64px 0;
  }
}

.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 12px;
}

.lead {
  font-size: 1.1rem;
  color: var(--ink-2);
}

/* ---- buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  padding: 0 28px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}

.btn--primary:hover {
  box-shadow: 0 6px 18px rgba(232, 103, 74, 0.35);
}

.btn--ghost {
  background: transparent;
  border-color: currentColor;
  color: var(--ink);
}

.section--dark .btn--ghost {
  color: #f4efe4;
}

.btn--danger {
  background: var(--err);
  color: #fff;
}

.btn--sm {
  height: 38px;
  padding: 0 18px;
  font-size: 13px;
}

.btn--block {
  width: 100%;
}

/* ---- cards / grids ---- */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

@media (max-width: 800px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

/* ---- badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--paper-2);
  color: var(--ink-2);
}

.badge--ok {
  background: rgba(47, 125, 91, 0.12);
  color: var(--ok);
}

.badge--warn {
  background: rgba(183, 121, 31, 0.12);
  color: var(--warn);
}

.badge--err {
  background: rgba(185, 58, 50, 0.12);
  color: var(--err);
}

/* ---- forms ---- */
.field {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}

.field input,
.field textarea,
.field select {
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
}

.field textarea {
  height: auto;
  min-height: 120px;
  padding: 12px 14px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: 3px solid rgba(232, 103, 74, 0.25);
  border-color: var(--accent);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .field-row {
    grid-template-columns: 1fr;
  }
}

.field-hint {
  font-size: 12px;
  color: var(--ink-2);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---- flash ---- */
.flash {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 20px;
  border: 1px solid transparent;
}

.flash--ok {
  background: rgba(47, 125, 91, 0.1);
  color: var(--ok);
  border-color: rgba(47, 125, 91, 0.3);
}

.flash--erro {
  background: rgba(185, 58, 50, 0.1);
  color: var(--err);
  border-color: rgba(185, 58, 50, 0.3);
}

/* ---- progress ---- */
.progress {
  height: 8px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}

/* ---- table ---- */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-2);
  padding: 10px 12px;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
}

.table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  vertical-align: middle;
}

.table-wrap {
  overflow-x: auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* ==========================================================================
   Painel (área logada)
   ========================================================================== */

.painel-body {
  background: #f7f5f1;
}

.painel-layout {
  display: flex;
  min-height: 100vh;
}

.painel-nav {
  width: 240px;
  flex-shrink: 0;
  background: var(--ink);
  color: #f4efe4;
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  position: sticky;
  top: 0;
  height: 100vh;
}

.painel-nav__brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  padding: 0 24px 20px;
}

.painel-nav__list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.painel-nav__link {
  display: block;
  padding: 12px 24px;
  color: rgba(244, 239, 228, 0.75);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  border-left: 3px solid transparent;
}

.painel-nav__link:hover {
  color: #f4efe4;
}

.painel-nav__link.is-active {
  color: #f4efe4;
  border-left-color: var(--accent);
  background: rgba(255, 255, 255, 0.04);
}

.painel-nav__foot {
  padding: 16px 24px 0;
  border-top: 1px solid rgba(244, 239, 228, 0.12);
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.painel-nav__user {
  font-size: 13px;
  color: rgba(244, 239, 228, 0.7);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.painel-main {
  flex: 1;
  min-width: 0;
  padding: 40px 40px 80px;
}

.painel-main__title {
  font-size: 1.9rem;
  margin-bottom: 24px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.metric-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}

.metric-card__value {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 600;
}

.metric-card__label {
  font-size: 13px;
  color: var(--ink-2);
}

@media (max-width: 860px) {
  .painel-layout {
    flex-direction: column;
  }

  .painel-nav {
    width: 100%;
    height: auto;
    position: static;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    padding: 12px 0;
  }

  .painel-nav__brand {
    padding: 0 16px;
  }

  .painel-nav__list {
    flex-direction: row;
  }

  .painel-nav__link {
    padding: 8px 14px;
    border-left: none;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
  }

  .painel-nav__link.is-active {
    border-left-color: transparent;
    border-bottom-color: var(--accent);
  }

  .painel-nav__foot {
    border-top: none;
    margin-top: 0;
    padding: 0 16px;
  }

  .painel-nav__user {
    display: none;
  }

  .painel-main {
    padding: 24px 16px 60px;
  }
}

/* ==========================================================================
   Área do aluno
   ========================================================================== */

.aluno-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--white);
}

.aluno-topbar__logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
}

.aluno-player {
  display: flex;
  min-height: calc(100vh - 65px);
}

.aluno-player__sidebar {
  width: 320px;
  flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid var(--line);
  padding: 20px 0;
  overflow-y: auto;
}

.aluno-player__module {
  padding: 8px 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-2);
}

.aluno-player__lesson {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  text-decoration: none;
  color: var(--ink);
  font-size: 14px;
  border-left: 3px solid transparent;
}

.aluno-player__lesson.is-active {
  border-left-color: var(--accent);
  background: var(--paper-2);
  font-weight: 600;
}

.aluno-player__check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--line);
  flex-shrink: 0;
}

.aluno-player__lesson.is-done .aluno-player__check {
  background: var(--ok);
  border-color: var(--ok);
}

.aluno-player__content {
  flex: 1;
  padding: 32px;
  min-width: 0;
}

.video-16-9 {
  position: relative;
  padding-top: 56.25%;
  background: var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
}

.video-16-9 iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

@media (max-width: 860px) {
  .aluno-player {
    flex-direction: column;
  }

  .aluno-player__sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
}

/* ==========================================================================
   Landing
   ========================================================================== */

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(251, 247, 240, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
}

.header__logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

@media (max-width: 520px) {
  .header__inner {
    padding: 12px 16px;
  }

  .header__logo {
    font-size: 1rem;
    flex-shrink: 1;
  }

  .header__inner .hero__actions {
    flex-wrap: nowrap;
    flex-shrink: 0;
  }

  .header__inner .hero__actions .btn--ghost {
    display: none;
  }

  .header__inner .btn--sm {
    height: 34px;
    padding: 0 14px;
    font-size: 12px;
  }
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
  padding: 72px 0;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 40px 0;
  }

  .hero__photo {
    aspect-ratio: auto;
    height: 280px;
  }
}

.hero__actions {
  display: flex;
  gap: 14px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.hero__media {
  position: relative;
}

.hero__photo {
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow);
  aspect-ratio: 4 / 5;
  background: var(--paper-2);
}

.hero__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__seal {
  position: absolute;
  bottom: -18px;
  left: -18px;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background: var(--ink);
  color: #f4efe4;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
  transform: rotate(-8deg);
  box-shadow: var(--shadow);
  padding: 10px;
}

@media (max-width: 420px) {
  .hero__seal {
    width: 100px;
    height: 100px;
    font-size: 0.8rem;
  }
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
}

@media (max-width: 700px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stats__number {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 600;
  color: var(--brand);
}

.stats__label {
  font-size: 13px;
  color: var(--ink-2);
}

.pain-card {
  padding: 28px;
}

.pain-card__icon {
  width: 40px;
  height: 40px;
  margin-bottom: 16px;
  color: var(--accent);
}

.timeline {
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline__item {
  position: relative;
  padding: 0 0 40px 56px;
  border-left: 2px solid var(--line);
  margin-left: 20px;
}

.timeline__item:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}

.timeline__item::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: -21px;
  top: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
}

.offer-card {
  padding: 40px;
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
}

.offer-card__old-price {
  text-decoration: line-through;
  color: var(--ink-2);
  font-size: 1.1rem;
}

.offer-card__price {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 600;
  color: var(--brand);
  margin: 4px 0 20px;
}

.faq {
  max-width: 760px;
  margin: 0 auto;
}

.faq details {
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
}

.faq summary {
  cursor: pointer;
  font-weight: 700;
  font-family: var(--font-display);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  font-size: 1.4rem;
  color: var(--accent);
  flex-shrink: 0;
}

.faq details[open] summary::after {
  content: "\2212";
}

.faq p {
  margin-top: 12px;
  color: var(--ink-2);
}

.testimonial {
  padding: 24px;
}

.testimonial__text {
  font-style: italic;
  margin-bottom: 16px;
}

.testimonial__name {
  font-weight: 700;
}

.testimonial__role {
  font-size: 13px;
  color: var(--ink-2);
}

.footer-dark {
  background: var(--ink);
  color: rgba(244, 239, 228, 0.8);
  padding: 56px 0 28px;
}

.footer-dark a {
  color: rgba(244, 239, 228, 0.8);
  text-decoration: none;
}

.footer-dark__brand {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: #f4efe4;
  margin-bottom: 12px;
}

.footer-dark__bottom {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(244, 239, 228, 0.14);
  font-size: 13px;
}

.wa-float {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #25d366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  z-index: 30;
  color: #fff;
}

.wa-float svg {
  width: 30px;
  height: 30px;
}

/* ==========================================================================
   Auth
   ========================================================================== */

.auth-body {
  background: var(--paper);
  min-height: 100vh;
  display: flex;
}

.auth-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  min-height: 100vh;
  background: radial-gradient(circle at top, var(--paper-2), var(--paper));
}

.auth-card {
  width: 100%;
  max-width: 400px;
  padding: 40px 32px;
}

.auth-card__logo {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 8px;
}

.auth-card__subtitle {
  text-align: center;
  color: var(--ink-2);
  font-size: 14px;
  margin-bottom: 24px;
}

.auth-form__submit {
  width: 100%;
  margin-top: 8px;
}

/* painel extras */

.painel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.painel-toolbar__search {
  display: flex;
  gap: 8px;
}

.painel-toolbar__search input {
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  min-width: 220px;
}

.empty-state {
  text-align: center;
  padding: 56px 24px;
  background: var(--white);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--ink-2);
}

.empty-state h3 {
  margin-bottom: 8px;
  color: var(--ink);
}

.empty-state .btn {
  margin-top: 18px;
}

.table-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checklist__item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.checklist__item a {
  color: inherit;
  text-decoration: underline;
}

.checklist__mark {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--line);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.checklist__item--feito .checklist__mark {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}

.checklist__item--feito {
  color: var(--ink-2);
  text-decoration: line-through;
}

.painel-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.painel-tabs a {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
  border: 1px solid var(--line);
}

.painel-tabs a.is-active {
  background: var(--ink);
  color: #f4efe4;
  border-color: var(--ink);
}

.panel-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.utm-generator__output {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}

.utm-generator__output input {
  flex: 1;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper-2);
  font-size: 13px;
}

/* admin-aluno extras */

.painel-form {
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.painel-form .btn {
  align-self: flex-start;
  margin-top: 8px;
}

.aluno-cursos {
  margin-top: 20px;
}

.aluno-curso-card {
  display: block;
  text-decoration: none;
  color: inherit;
}

.aluno-curso-card h2 {
  font-family: var(--font-display);
  margin-top: 0;
}

.aluno-vazio {
  text-align: center;
  padding: 48px 24px;
}

.aluno-secao-titulo {
  margin: 32px 0 12px;
  font-family: var(--font-display);
}

.aluno-aula-texto p {
  margin: 0 0 14px;
  line-height: 1.65;
}

.aluno-aula-acoes {
  margin: 20px 0;
}

.aluno-aula-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}
