:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-soft: #f2f7f5;
  --ink: #202323;
  --muted: #69716f;
  --line: #dfe5e1;
  --brand: #451e20;
  --brand-dark: #b63f19;
  --accent: #9E9E9E;
  --danger: #a63d40;
  --shadow: 0 18px 60px rgba(28, 41, 38, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: Arial, Helvetica, sans-serif;
}

a {
  color: inherit;
}

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

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 480px);
  min-height: 100vh;
}

.brand-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
  padding: clamp(32px, 6vw, 80px);

  background-image:
    linear-gradient(rgb(0 0 0 / 81%), rgb(0 0 0 / 38%)),
    url("logo.png");

  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;

  color: white;
}

.brand-panel h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(48px, 8vw, 96px);
  line-height: 0.95;
  letter-spacing: 0;
}

.lead {
  max-width: 620px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 20px;
  line-height: 1.5;
}

.login-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.login-hints span,
.count-pill {
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 8px 12px;
  color: inherit;
  background: rgba(255, 255, 255, 0.12);
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 32px;
}

.form-card,
.panel-form,
.module-card,
.lesson-card,
.student-lesson {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.form-card {
  width: min(100%, 420px);
  padding: 28px;
  box-shadow: var(--shadow);
}

.form-card h2,
.panel-form h2,
.section-title h2,
.student-heading h2 {
  margin: 0;
}

.login-role { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 20px; }
.role-choice { display: block; margin: 0; border: 1px solid var(--line); border-radius: 8px; padding: 11px; text-align: center; cursor: pointer; }
.role-choice input { position: absolute; opacity: 0; pointer-events: none; }
.role-choice.active { border-color: var(--brand); color: var(--brand-dark); background: var(--surface-soft); }

label {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  color: var(--ink);
  background: white;
}

textarea {
  resize: vertical;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn,
.icon-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 700;
}

.primary-btn {
  width: 100%;
  margin-top: 22px;
  color: white;
  background: var(--brand);
}

.primary-btn:hover {
  background: var(--brand-dark);
}

.secondary-btn {
  color: white;
  background: var(--accent);
}

.ghost-btn {
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface);
}

.danger-btn,
.icon-danger {
  color: white;
  background: var(--danger);
}

.form-message,
.muted {
  min-height: 22px;
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding: 18px clamp(18px, 4vw, 44px);
  background: rgba(246, 244, 239, 0.94);
  backdrop-filter: blur(12px);
}

.topbar h1 {
  margin: 0;
  font-size: 28px;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--line); padding: 10px clamp(18px, 4vw, 44px); background: var(--surface); }
.tab-btn { border: 0; border-radius: 8px; padding: 10px 14px; color: var(--muted); background: transparent; font-weight: 700; cursor: pointer; }
.tab-btn.active { color: var(--brand-dark); background: var(--surface-soft); }

.file-action {
  position: relative;
  overflow: hidden;
}

.file-action input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.app-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 24px;
  padding: 24px clamp(18px, 4vw, 44px) 48px;
}

.sidebar {
  align-self: start;
}

.panel-form {
  padding: 22px;
}

.content-area,
.lesson-view {
  min-width: 0;
}

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

.section-title.compact {
  margin-bottom: 12px;
}

.count-pill {
  border-color: var(--line);
  color: var(--brand-dark);
  background: var(--surface-soft);
}

.module-list,
.lesson-list,
.student-lessons {
  display: grid;
  gap: 16px;
}

.module-card {
  padding: 22px;
}

.module-header,
.lesson-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.card-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.compact-btn { min-height: 36px; padding: 0 12px; }
.edit-form { display: grid; flex: 1; gap: 10px; }
.edit-form .card-actions { justify-content: flex-end; }

.module-header h3,
.lesson-header h4,
.student-lesson h3 {
  margin: 0 0 6px;
}

.module-header p,
.lesson-header p,
.student-heading p,
.student-lesson p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.lesson-card {
  padding: 16px;
  background: var(--surface-soft);
}

.inline-form,
.material-form {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) auto;
  gap: 10px;
  margin-bottom: 14px;
}

.material-form {
  grid-template-columns: minmax(160px, 1fr) 130px minmax(160px, 1fr) auto;
}

.materials {
  display: grid;
  gap: 10px;
}

.material-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) 90px auto auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: white;
}

.material-row strong,
.student-material strong {
  color: var(--brand-dark);
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 28px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.56);
}

.student-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 24px;
  padding: 24px clamp(18px, 4vw, 44px) 48px;
}

.students-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 24px; padding: 24px clamp(18px, 4vw, 44px) 48px; }
.module-access-fieldset { display: grid; gap: 8px; margin: 18px 0 0; border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.module-access-fieldset legend { padding: 0 5px; color: var(--muted); font-size: 14px; font-weight: 700; }
.module-checklist { display: grid; gap: 8px; }
.module-check { display: flex; align-items: center; gap: 9px; margin: 0; font-weight: 400; cursor: pointer; }
.module-check input { width: 16px; height: 16px; padding: 0; accent-color: var(--brand); }
.students-list { display: grid; gap: 14px; }
.student-card { display: grid; gap: 14px; border: 1px solid var(--line); border-radius: 8px; padding: 20px; background: var(--surface); }
.student-card h3, .student-card p { margin: 0; }
.student-card p { color: var(--muted); }
.student-modules { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; border-top: 1px solid var(--line); padding-top: 14px; }

.module-nav {
  align-self: start;
}

.module-nav-btn {
  display: grid;
  gap: 5px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 10px;
  padding: 14px;
  text-align: left;
  color: var(--ink);
  background: white;
  cursor: pointer;
}

.module-nav-btn span {
  color: var(--muted);
}

.module-nav-btn.active {
  border-color: var(--brand);
  background: var(--surface-soft);
}

.student-heading {
  margin-bottom: 18px;
}

.student-welcome {
  margin-bottom: 18px;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 18px 20px;
  background: var(--surface-soft);
}

.student-welcome h2,
.student-welcome p {
  margin: 0;
}

.student-welcome p {
  margin-top: 6px;
  color: var(--muted);
}

.student-lesson {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.student-materials {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.student-material {
  display: grid;
  gap: 6px;
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  text-decoration: none;
  background: var(--surface-soft);
}

@media (max-width: 920px) {
  .login-shell,
  .app-layout,
  .student-shell,
  .students-layout {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    min-height: 44vh;
  }

  .inline-form,
  .material-form,
  .material-row {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .login-panel,
  .app-layout,
  .student-shell {
    padding-left: 14px;
    padding-right: 14px;
  }

  .brand-panel {
    padding: 28px 20px;
  }

  .top-actions,
  .ghost-btn,
  .danger-btn {
    width: 100%;
  }
}/* Botão flutuante WhatsApp */
.whatsapp-float {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 62px;
    height: 62px;
    background: #25D366;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(0,0,0,.25);
    transition: transform .2s ease, box-shadow .2s ease;
    z-index: 9999;
}

.whatsapp-float:hover {
    transform: scale(1.08);
    box-shadow: 0 10px 25px rgba(0,0,0,.35);
}

.whatsapp-float svg {
    width: 32px;
    height: 32px;
}

@media (max-width: 768px) {
    .whatsapp-float {
        right: 16px;
        bottom: 16px;
        width: 56px;
        height: 56px;
    }

    .whatsapp-float svg {
        width: 28px;
        height: 28px;
    }
}
