:root {
  --bg: #000000;
  --surface: #ffffff;
  --surface-soft: #f2f7f5;
  --ink: #202323;
  --muted: #000000;
  --line: #dfe5e1;
  --brand: #f72916;
  --brand-dark: #ed3237;
  --accent: #9e9e9e;
  --danger: #ed3237;
  --shadow: 0 18px 60px rgba(28, 41, 38, 0.13);}
* {
  box-sizing: border-box;
}

html {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
}

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

a {
  color: inherit;
}

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

img,
svg {
  max-width: 100%;
}


/* =========================================================
   LOGIN
   ========================================================= */

/* =========================================================
   LOGIN — CAIXA PRINCIPAL
   ========================================================= */

.login-shell {
  position: relative;

  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 480px);

  width: 100%;
  max-width: 100%;
  min-height: 100vh;

  margin: 0;
  overflow: hidden;

  /* LED vermelho */
  border: 10px solid rgb(0 0 0 / 85%);
  border-radius: 5px;

  box-shadow:
    0 0 8px rgba(255, 0, 0, 0.95),
    0 0 20px rgba(255, 0, 0, 0.85),
    0 0 40px rgba(255, 0, 0, 0.65),
    inset 0 0 12px rgba(255, 0, 0, 0.45);

  box-sizing: border-box;
}@keyframes ledRedPulse {
  0% {
    box-shadow:
      0 0 5px rgba(255, 0, 0, 1),
      0 0 12px rgba(255, 0, 0, 0.8),
      0 0 25px rgba(255, 0, 0, 0.5),
      inset 0 0 8px rgba(255, 0, 0, 0.3);
  }

  50% {
    box-shadow:
      0 0 8px rgba(255, 0, 0, 1),
      0 0 22px rgba(255, 0, 0, 0.95),
      0 0 45px rgba(255, 0, 0, 0.75),
      inset 0 0 14px rgba(255, 0, 0, 0.5);
  }

  100% {
    box-shadow:
      0 0 5px rgba(255, 0, 0, 1),
      0 0 12px rgba(255, 0, 0, 0.8),
      0 0 25px rgba(255, 0, 0, 0.5),
      inset 0 0 8px rgba(255, 0, 0, 0.3);
  }
}

.login-shell {
  animation: ledRedPulse 2s ease-in-out infinite;
}
.form-card {
  position: relative;
  border: 2px solid rgba(255, 0, 0, 0.8);
  border-radius: 16px;

  box-shadow:
    0 0 6px rgba(255, 0, 0, 1),
    0 0 14px rgba(255, 0, 0, 0.8),
    0 0 28px rgba(255, 0, 0, 0.5);

  animation: loginLed 2s ease-in-out infinite;
}

@keyframes loginLed {
  0% {
    box-shadow:
      0 0 5px rgba(255, 0, 0, 0.8),
      0 0 12px rgba(255, 0, 0, 0.6),
      0 0 22px rgba(255, 0, 0, 0.4);
  }

  50% {
    box-shadow:
      0 0 8px rgba(255, 0, 0, 1),
      0 0 20px rgba(255, 0, 0, 0.9),
      0 0 38px rgba(255, 0, 0, 0.65);
  }

  100% {
    box-shadow:
      0 0 5px rgba(255, 0, 0, 0.8),
      0 0 12px rgba(255, 0, 0, 0.6),
      0 0 22px rgba(255, 0, 0, 0.4);
  }
}


/* =========================================================
   ÁREA DA MARCA
   ========================================================= */

.brand-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;

  gap: 48px;

  min-width: 0;
  min-height: 100vh;

  padding: clamp(32px, 6vw, 80px);

  background-image: url("logoo.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;

  color: white;
}

.brand-panel h1 {
  width: 100%;
  max-width: 760px;

  margin: 0;

  font-size: clamp(48px, 8vw, 96px);
  line-height: 0.95;
  letter-spacing: 0;
  overflow-wrap: break-word;
}

.lead {
  width: 100%;
  max-width: 620px;

  margin: 0;

  color: rgb(220 214 215 / 71%);
  font-size: clamp(16px, 2vw, 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);
}


/* =========================================================
   PAINEL DE LOGIN
   ========================================================= */

.login-panel {
  display: grid;
  place-items: center;

  width: 100%;
  min-width: 0;

  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;
}


/* =========================================================
   ESCOLHA PROFESSOR / ALUNO
   ========================================================= */

.login-role {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;

  margin-top: 20px;
}

.role-choice {
  display: flex;
  align-items: center;
  justify-content: center;

  min-height: 44px;

  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);
}


/* =========================================================
   CAMPOS
   ========================================================= */

label {
  display: grid;
  gap: 8px;

  margin-top: 18px;

  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  max-width: 100%;

  border: 1px solid var(--line);
  border-radius: 8px;

  padding: 12px 13px;

  color: var(--ink);
  background: white;
}

textarea {
  resize: vertical;
}


/* =========================================================
   BOTÕES
   ========================================================= */

.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
   ========================================================= */

.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;
}


/* =========================================================
   ABAS
   ========================================================= */

.admin-tabs {
  display: flex;
  gap: 8px;

  border-bottom: 1px solid var(--line);

  padding: 10px clamp(18px, 4vw, 44px);

  background: var(--surface);

  overflow-x: auto;
  scrollbar-width: none;
}

.admin-tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  flex: 0 0 auto;

  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);
}


/* =========================================================
   ARQUIVOS
   ========================================================= */

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

.file-action input {
  position: absolute;
  inset: 0;

  opacity: 0;
  cursor: pointer;
}


/* =========================================================
   LAYOUT ADMIN
   ========================================================= */

.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;
}


/* =========================================================
   TÍTULOS
   ========================================================= */

.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);
}


/* =========================================================
   LISTAS
   ========================================================= */

.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;
}


/* =========================================================
   AULAS
   ========================================================= */

.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);
}


/* =========================================================
   ÁREA DO ALUNO
   ========================================================= */

.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;
}


/* =========================================================
   MENU DE MÓDULOS
   ========================================================= */

.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);
}


/* =========================================================
   CONTEÚDO DO ALUNO
   ========================================================= */

.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);
}


/* =========================================================
   WHATSAPP
   ========================================================= */

.whatsapp-float {
  position: fixed;

  right: 20px;
  bottom: 20px;

  z-index: 9999;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 62px;
  height: 62px;

  border-radius: 50%;

  color: #fff;
  background: #25d366;

  text-decoration: none;

  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);

  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.whatsapp-float:hover {
  transform: scale(1.08);

  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

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


/* =========================================================
   TABLETS
   ========================================================= */

@media (max-width: 920px) {

  .login-shell,
  .app-layout,
  .student-shell,
  .students-layout {
    grid-template-columns: 1fr;
  }

  /* LOGIN */

  .brand-panel {
    min-height: auto;

    padding: 50px 40px;

    justify-content: flex-start;
  }

  .brand-panel h1 {
    max-width: 760px;

    font-size: clamp(44px, 8vw, 72px);
  }

  .lead {
    max-width: 600px;
    font-size: 18px;
  }

  .login-panel {
    min-height: auto;
    padding: 35px 24px 50px;
  }

  .form-card {
    width: min(100%, 480px);
  }


  /* ADMIN */

  .app-layout,
  .student-shell,
  .students-layout {
    padding-top: 20px;
  }


  /* FORMULÁRIOS */

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

  .inline-form button,
  .material-form button {
    grid-column: 1 / -1;
  }

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


  /* TOPBAR */

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

    gap: 14px;
  }

  .top-actions {
    width: 100%;
  }
}


/* =========================================================
   CELULARES
   ========================================================= */

@media (max-width: 600px) {

  body {
    font-size: 15px;
  }


  /* =======================================================
     LOGIN
     ======================================================= */

  .login-shell {
    display: flex;
    flex-direction: column;

    width: 100%;
    min-height: 100vh;
  }


  /* -------------------------------------------------------
     MARCA — FICA NO TOPO
     ------------------------------------------------------- */

  .brand-panel {
    display: flex;

    width: 100%;
    min-height: auto;

    padding: 28px 18px 22px;

    gap: 18px;

    justify-content: flex-start;
    align-items: flex-start;

    text-align: left;

    background-size: 220px;
    background-position: center top;
  }

  .brand-panel h1 {
    width: 100%;
    max-width: 100%;

    margin: 0;

    font-size: clamp(36px, 12vw, 54px);

    line-height: 0.98;

    overflow-wrap: anywhere;
  }

  .lead {
    width: 100%;
    max-width: 100%;

    margin: 0;

    font-size: 16px;
    line-height: 1.45;
  }

  .login-hints {
    width: 100%;

    justify-content: flex-start;

    gap: 7px;
  }

  .login-hints span,
  .count-pill {
    padding: 7px 10px;

    font-size: 13px;
  }


  /* =======================================================
     LOGIN PANEL
     ======================================================= */

  .login-panel {
    display: block;

    width: 100%;

    padding: 10px 14px 80px;
  }

  .form-card {
    width: 100%;
    max-width: 100%;

    padding: 20px 17px;

    border-radius: 10px;

    box-shadow: 0 10px 35px rgba(28, 41, 38, 0.10);
  }

  .form-card h2 {
    font-size: 24px;
    line-height: 1.2;
  }


  /* =======================================================
     PROFESSOR / ALUNO
     ======================================================= */

  .login-role {
    grid-template-columns: 1fr 1fr;

    gap: 8px;

    margin-top: 18px;
  }

  .role-choice {
    min-height: 48px;

    padding: 8px 5px;

    font-size: 14px;
  }


  /* =======================================================
     CAMPOS TOUCH
     ======================================================= */

  label {
    margin-top: 16px;

    font-size: 13px;
  }

  input,
  textarea,
  select {
    min-height: 48px;

    padding: 12px;

    font-size: 16px;
  }


  /* =======================================================
     BOTÕES
     ======================================================= */

  .primary-btn,
  .secondary-btn,
  .ghost-btn,
  .danger-btn {
    min-height: 48px;

    font-size: 15px;
  }

  .primary-btn {
    margin-top: 18px;
  }


  /* =======================================================
     TOPBAR
     ======================================================= */

  .topbar {
    position: relative;

    width: 100%;

    padding: 14px;

    gap: 12px;
  }

  .topbar h1 {
    width: 100%;

    font-size: 22px;
    line-height: 1.2;
  }

  .top-actions {
    display: grid;

    grid-template-columns: 1fr;

    width: 100%;

    gap: 8px;
  }

  .top-actions button,
  .top-actions a {
    width: 100%;
  }


  /* =======================================================
     ABAS
     ======================================================= */

  .admin-tabs {
    padding: 8px 12px;

    gap: 6px;
  }

  .tab-btn {
    padding: 10px 12px;

    font-size: 14px;
  }


  /* =======================================================
     ADMIN
     ======================================================= */

  .app-layout,
  .student-shell,
  .students-layout {
    display: flex;
    flex-direction: column;

    width: 100%;

    gap: 16px;

    padding: 16px 14px 70px;
  }

  .sidebar,
  .module-nav {
    width: 100%;
  }

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


  /* =======================================================
     FORMULÁRIOS ADMIN
     ======================================================= */

  .panel-form {
    width: 100%;

    padding: 17px;
  }

  .inline-form,
  .material-form {
    display: grid;

    grid-template-columns: 1fr;

    width: 100%;

    gap: 9px;
  }

  .inline-form button,
  .material-form button {
    grid-column: auto;

    width: 100%;
  }


  /* =======================================================
     TÍTULOS
     ======================================================= */

  .section-title {
    align-items: flex-start;
    flex-direction: column;

    gap: 10px;

    margin-bottom: 14px;
  }

  .section-title h2 {
    font-size: 22px;
    line-height: 1.2;
  }


  /* =======================================================
     MÓDULOS
     ======================================================= */

  .module-card {
    width: 100%;

    padding: 17px;
  }

  .module-header,
  .lesson-header {
    flex-direction: column;

    gap: 12px;

    margin-bottom: 14px;
  }

  .module-header h3,
  .lesson-header h4 {
    font-size: 18px;
  }

  .card-actions {
    display: grid;

    grid-template-columns: 1fr 1fr;

    width: 100%;
  }

  .card-actions button,
  .card-actions a {
    width: 100%;
  }

  .edit-form .card-actions {
    justify-content: stretch;
  }


  /* =======================================================
     AULAS
     ======================================================= */

  .lesson-card {
    padding: 13px;
  }

  .material-row {
    display: grid;

    grid-template-columns: 1fr;

    gap: 8px;

    padding: 12px;
  }

  .material-row button,
  .material-row a {
    width: 100%;
  }

  .materials {
    width: 100%;
  }


  /* =======================================================
     ALUNOS
     ======================================================= */

  .student-card {
    padding: 16px;
  }

  .student-modules {
    grid-template-columns: 1fr;
  }

  .module-check {
    min-height: 42px;
  }


  /* =======================================================
     MENU DE MÓDULOS
     ======================================================= */

  .module-nav {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 8px;
  }

  .module-nav-btn {
    margin-bottom: 0;

    padding: 12px;

    font-size: 14px;
  }


  /* =======================================================
     CONTEÚDO ALUNO
     ======================================================= */

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

  .student-heading h2 {
    font-size: 24px;
    line-height: 1.2;
  }

  .student-welcome {
    padding: 15px 16px;
  }

  .student-welcome h2 {
    font-size: 20px;
  }

  .student-lesson {
    gap: 14px;

    padding: 16px;
  }

  .student-lesson h3 {
    font-size: 19px;
  }

  .student-materials {
    grid-template-columns: 1fr;
  }

  .student-material {
    min-height: 70px;
  }


  /* =======================================================
     ESTADO VAZIO
     ======================================================= */

  .empty-state {
    padding: 20px 16px;

    text-align: center;
  }


  /* =======================================================
     WHATSAPP
     ======================================================= */

  .whatsapp-float {
    right: 14px;
    bottom: 14px;

    width: 54px;
    height: 54px;
  }

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


/* =========================================================
   CELULARES PEQUENOS — ATÉ 400px
   ========================================================= */

@media (max-width: 400px) {

  .brand-panel {
    padding: 24px 15px 18px;

    gap: 15px;

    background-size: 180px;
  }

  .brand-panel h1 {
    font-size: clamp(32px, 11vw, 44px);
  }

  .lead {
    font-size: 15px;
  }

  .login-panel {
    padding: 8px 10px 70px;
  }

  .form-card {
    padding: 18px 14px;
  }

  .form-card h2 {
    font-size: 22px;
  }

  .login-role {
    gap: 6px;
  }

  .role-choice {
    min-height: 46px;

    padding: 7px 4px;

    font-size: 13px;
  }

  .app-layout,
  .student-shell,
  .students-layout {
    padding-left: 10px;
    padding-right: 10px;
  }

  .card-actions {
    grid-template-columns: 1fr;
  }

  .module-nav {
    grid-template-columns: 1fr;
  }

  .module-card,
  .student-card {
    padding: 14px;
  }

  .whatsapp-float {
    right: 12px;
    bottom: 12px;

    width: 50px;
    height: 50px;
  }

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


/* =========================================================
   CELULARES MUITO PEQUENOS — 320px / 360px
   ========================================================= */

@media (max-width: 360px) {

  .brand-panel {
    padding: 20px 13px 16px;
  }

  .brand-panel h1 {
    font-size: 34px;
  }

  .lead {
    font-size: 14px;
  }

  .login-panel {
    padding-left: 8px;
    padding-right: 8px;
  }

  .form-card {
    padding: 17px 13px;
  }

  .form-card h2 {
    font-size: 21px;
  }

  .login-role {
    grid-template-columns: 1fr 1fr;
  }

  .role-choice {
    font-size: 12px;
  }

  input,
  textarea,
  select {
    font-size: 16px;
  }

  .primary-btn {
    min-height: 48px;
  }
}


/* =========================================================
   EVITAR ZOOM AUTOMÁTICO DO IOS
   ========================================================= */

@media (max-width: 600px) {

  input,
  textarea,
  select {
    font-size: 16px !important;
  }
}


/* =========================================================
   TOUCH
   ========================================================= */

@media (hover: none) and (pointer: coarse) {

  button,
  a,
  .role-choice,
  .tab-btn,
  .module-nav-btn {
    -webkit-tap-highlight-color: transparent;
  }

  button,
  .role-choice,
  .tab-btn,
  .module-nav-btn {
    touch-action: manipulation;
  }
}

/* =========================================================
   MOBILE APP — INTERFACE TOTALMENTE ADAPTADA PARA CELULAR
   ========================================================= */

html {
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  min-height: 100dvh;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 600px) {

  /* ---------- BASE APP ---------- */

  * {
    -webkit-tap-highlight-color: transparent;
  }

  body {
    margin: 0;
    width: 100%;
    min-height: 100dvh;
    font-size: 16px;
    overflow-x: hidden;
    overscroll-behavior: none;
  }

  /* Evita o navegador aumentar textos automaticamente */
  body,
  input,
  textarea,
  select,
  button {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  /* Área de toque confortável */
  button,
  a,
  input,
  textarea,
  select,
  .role-choice,
  .tab-btn,
  .module-nav-btn {
    touch-action: manipulation;
  }

  /* ---------- LOGIN ---------- */

  .login-shell {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100dvh;
    overflow: hidden;
  }

  .brand-panel {
    width: 100%;
    min-height: 42dvh;
    max-height: 46dvh;
    padding: 28px 20px 24px;
    gap: 14px;
    justify-content: flex-end;
    align-items: flex-start;
    background-size: 190px auto;
    background-position: center 24px;
    overflow: hidden;
  }

  .brand-panel h1 {
    width: 100%;
    max-width: 100%;
    font-size: clamp(34px, 11vw, 52px);
    line-height: .96;
    overflow-wrap: anywhere;
  }

  .lead {
    width: 100%;
    max-width: 100%;
    font-size: 15px;
    line-height: 1.4;
  }

  .login-hints {
    width: 100%;
    gap: 6px;
  }

  .login-hints span,
  .count-pill {
    padding: 7px 9px;
    font-size: 12px;
  }

  .login-panel {
    display: block;
    width: 100%;
    min-height: 54dvh;
    padding: 14px 12px 30px;
    overflow: visible;
  }

  .form-card {
    width: 100%;
    max-width: 100%;
    padding: 20px 16px;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(28, 41, 38, .10);
  }

  .form-card h2 {
    font-size: 23px;
    line-height: 1.15;
  }

  .login-role {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 16px;
  }

  .role-choice {
    min-height: 50px;
    padding: 8px 5px;
    border-radius: 12px;
    font-size: 14px;
  }

  label {
    gap: 7px;
    margin-top: 15px;
    font-size: 13px;
  }

  input,
  textarea,
  select {
    width: 100%;
    min-width: 0;
    min-height: 50px;
    padding: 13px 12px;
    border-radius: 12px;
    font-size: 16px !important;
  }

  textarea {
    min-height: 110px;
  }

  .primary-btn,
  .secondary-btn,
  .ghost-btn,
  .danger-btn,
  .icon-danger {
    min-height: 50px;
    border-radius: 12px;
    padding: 0 14px;
    font-size: 15px;
  }

  .primary-btn {
    margin-top: 18px;
  }

  /* ---------- TOPO ---------- */

  .topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: 100%;
    padding: 12px 14px;
    background: rgba(246, 244, 239, .98);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }

  .topbar h1 {
    width: 100%;
    font-size: 21px;
    line-height: 1.2;
  }

  .top-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
    width: 100%;
  }

  .top-actions button,
  .top-actions a {
    width: 100%;
    min-height: 46px;
  }

  /* ---------- ABAS ---------- */

  .admin-tabs {
    position: sticky;
    top: 0;
    z-index: 90;
    display: flex;
    width: 100%;
    padding: 7px 10px;
    gap: 6px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .admin-tabs::-webkit-scrollbar {
    display: none;
  }

  .tab-btn {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 9px 13px;
    border-radius: 11px;
    font-size: 14px;
    white-space: nowrap;
  }

  /* ---------- LAYOUTS ---------- */

  .app-layout,
  .student-shell,
  .students-layout {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    gap: 14px;
    padding: 14px 12px 80px;
    overflow-x: hidden;
  }

  .sidebar,
  .module-nav,
  .content-area,
  .lesson-view {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  /* ---------- FORMULÁRIOS ---------- */

  .panel-form {
    width: 100%;
    padding: 16px;
    border-radius: 14px;
  }

  .inline-form,
  .material-form {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    gap: 9px;
  }

  .inline-form button,
  .material-form button {
    grid-column: auto;
    width: 100%;
  }

  /* ---------- TÍTULOS ---------- */

  .section-title {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 13px;
  }

  .section-title h2 {
    font-size: 21px;
    line-height: 1.2;
  }

  /* ---------- MÓDULOS ---------- */

  .module-list,
  .lesson-list,
  .student-lessons,
  .students-list {
    width: 100%;
    gap: 12px;
  }

  .module-card,
  .student-card {
    width: 100%;
    padding: 15px;
    border-radius: 14px;
  }

  .module-header,
  .lesson-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 12px;
  }

  .module-header h3,
  .lesson-header h4,
  .student-lesson h3 {
    font-size: 18px;
  }

  .card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    gap: 7px;
  }

  .card-actions button,
  .card-actions a {
    width: 100%;
    min-height: 44px;
  }

  .edit-form .card-actions {
    justify-content: stretch;
  }

  /* ---------- AULAS ---------- */

  .lesson-card {
    width: 100%;
    padding: 12px;
    border-radius: 14px;
  }

  .material-row {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    gap: 8px;
    padding: 11px;
    border-radius: 12px;
  }

  .material-row button,
  .material-row a {
    width: 100%;
    min-height: 44px;
  }

  /* ---------- ALUNOS ---------- */

  .student-card {
    display: grid;
    gap: 11px;
  }

  .student-modules {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .module-check {
    min-height: 44px;
  }

  /* ---------- MENU DE MÓDULOS ---------- */

  .module-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }

  .module-nav-btn {
    width: 100%;
    min-height: 70px;
    margin: 0;
    padding: 11px;
    border-radius: 12px;
    font-size: 13px;
  }

  /* ---------- CONTEÚDO DO ALUNO ---------- */

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

  .student-heading h2 {
    font-size: 23px;
    line-height: 1.2;
  }

  .student-welcome {
    margin-bottom: 13px;
    padding: 14px;
    border-radius: 12px;
  }

  .student-welcome h2 {
    font-size: 19px;
  }

  .student-lesson {
    width: 100%;
    gap: 13px;
    padding: 15px;
    border-radius: 14px;
  }

  .student-materials {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .student-material {
    min-height: 68px;
    padding: 13px;
    border-radius: 12px;
  }

  /* ---------- ESTADO VAZIO ---------- */

  .empty-state {
    padding: 18px 14px;
    border-radius: 12px;
    text-align: center;
  }

  /* ---------- WHATSAPP ---------- */

  .whatsapp-float {
    right: 13px;
    bottom: calc(13px + env(safe-area-inset-bottom));
    width: 54px;
    height: 54px;
  }

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

/* ---------- IPHONES / TELAS PEQUENAS ---------- */

@media (max-width: 380px) {

  .brand-panel {
    min-height: 40dvh;
    padding: 22px 15px 18px;
    background-size: 165px auto;
  }

  .brand-panel h1 {
    font-size: 34px;
  }

  .lead {
    font-size: 14px;
  }

  .login-panel {
    padding: 10px 9px 25px;
  }

  .form-card {
    padding: 18px 13px;
    border-radius: 14px;
  }

  .form-card h2 {
    font-size: 21px;
  }

  .role-choice {
    font-size: 13px;
  }

  .card-actions {
    grid-template-columns: 1fr;
  }

  .module-nav {
    grid-template-columns: 1fr;
  }
}

/* ---------- SAFE AREA DO IPHONE ---------- */

@supports (padding: env(safe-area-inset-bottom)) {
  body {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .topbar {
    padding-top: calc(12px + env(safe-area-inset-top));
  }
} /* =========================================================
   IPHONE / CELULAR — TELA TRAVADA HORIZONTALMENTE
   ========================================================= */

html {
  width: 100%;
  max-width: 100%;
  min-width: 0;

  overflow-x: hidden !important;
  overscroll-behavior-x: none;

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

body {
  width: 100%;
  max-width: 100%;
  min-width: 0;

  margin: 0;
  overflow-x: hidden !important;
  overscroll-behavior-x: none;

  position: relative;
}

@media (max-width: 600px) {

  html,
  body {
    width: 100%;
    max-width: 100%;
    min-width: 0;

    overflow-x: hidden !important;
    overscroll-behavior-x: none;
  }

  .login-shell {
    display: flex;
    flex-direction: column;

    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 100dvh;

    margin: 0;

    overflow-x: hidden !important;
    overflow-y: auto;

    border-width: 2px;
    border-radius: 0;

    box-sizing: border-box;

    /* LED */
    box-shadow:
      0 0 6px rgba(255, 0, 0, 1),
      0 0 16px rgba(255, 0, 0, 0.9),
      0 0 30px rgba(255, 0, 0, 0.65),
      inset 0 0 10px rgba(255, 0, 0, 0.35);
  }

  .brand-panel,
  .login-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;

    box-sizing: border-box;
    overflow-x: hidden;
  }

  /* Evita elementos internos maiores que a tela */
  .brand-panel *,
  .login-panel *,
  .form-card *,
  .login-shell * {
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Campos não podem aumentar a largura */
  input,
  textarea,
  select,
  button {
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Evita quebra causada por palavras/URLs grandes */
  h1,
  h2,
  h3,
  h4,
  p,
  span,
  a {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: normal;
  }
}/* =========================================================
   CORREÇÃO DE ROLAGEM — ANDROID / ÁREA DO ALUNO
   ========================================================= */

html {
  height: auto !important;
  min-height: 100%;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

body {
  height: auto !important;
  min-height: 100%;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior-y: auto !important;
}

/* Área principal do aluno */
.student-shell {
  height: auto !important;
  min-height: 100vh;
  overflow: visible !important;
}

/* Conteúdo do aluno */
.lesson-view,
.content-area {
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
}

/* Evita que algum elemento interno bloqueie a rolagem */
.student-shell *,
.lesson-view *,
.content-area * {
  max-height: none;
}

/* Android / Chrome */
@media (max-width: 600px) {

  html {
    height: auto !important;
    overflow-y: auto !important;
  }

  body {
    height: auto !important;
    min-height: 100dvh;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .student-shell {
    display: flex !important;
    flex-direction: column !important;
    width: 100%;
    min-height: 100dvh;
    height: auto !important;
    overflow: visible !important;
    padding-bottom: 100px !important;
  }

  .module-nav {
    flex-shrink: 0;
  }

  .lesson-view {
    width: 100%;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  .student-lesson {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }
}
.student-shell {
  display: flex;
  flex-direction: column;
}

/* Chamada */
.attendance-layout { padding: 24px clamp(18px, 4vw, 44px) 48px; }
.attendance-content { width: min(100%, 900px); margin: 0 auto; }
.attendance-title { align-items: end; }
.attendance-date { width: 180px; margin: 0; }
.attendance-summary { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 16px; }
.attendance-pill { border-radius: 999px; padding: 8px 12px; color: #fff; font-weight: 700; }
.present-pill { background: #1f8a4c; }
.absent-pill { background: var(--danger); }
.attendance-list { display: grid; gap: 10px; }
.attendance-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid var(--line); border-radius: 8px; padding: 16px; background: var(--surface); }
.attendance-row h3, .attendance-row p { margin: 0; }
.attendance-row p { margin-top: 4px; color: var(--muted); }
.attendance-toggle { display: flex; gap: 8px; }
.attendance-status { min-width: 100px; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; color: var(--ink); background: #fff; font-weight: 700; }
.attendance-status.present.active { border-color: #1f8a4c; color: #fff; background: #1f8a4c; }
.attendance-status.absent.active { border-color: var(--danger); color: #fff; background: var(--danger); }
.attendance-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.attendance-actions .form-message { flex: 1; margin: 0; }
.attendance-save { width: auto; margin: 0; }
.student-attendance { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; border-left: 4px solid var(--brand); border-radius: 8px; padding: 18px 20px; background: var(--surface-soft); }
.student-attendance h2, .student-attendance p { margin: 0; }
.student-attendance p:not(.eyebrow) { margin-top: 5px; color: var(--muted); }
.student-attendance-btn { width: auto; margin: 0; white-space: nowrap; }
.reply-reference { border-left: 3px solid var(--brand); margin: 10px 0; padding: 8px 12px; color: var(--muted); background: var(--surface-soft); }
.reply-reference p { margin: 4px 0 0; }
.top-actions #examBadge { color: #ed3237; font-weight: 800; }
.attendance-confirmed { border-radius: 999px; padding: 8px 12px; color: #fff; background: #1f8a4c; font-size: 14px; font-weight: 700; }
.section-title { margin: 4px 0 6px; }
.section-title h2 { margin: 0; }
.section-title p, .muted { color: var(--muted); }
.exam-card { display: grid; gap: 14px; }
.exam-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.exam-card-head h2 { margin: 0; }
.exam-card-head p { margin: 5px 0 0; }
.compact-btn { display: inline-flex; width: auto; align-items: center; justify-content: center; text-decoration: none; white-space: nowrap; }
.exam-score { margin: 0; }
.portfolio-list { display: grid; gap: 9px; }
.student-portfolio { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.student-portfolio summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 15px; cursor: pointer; list-style: none; }
.student-portfolio summary::-webkit-details-marker { display: none; }
.student-portfolio summary::after { content: "+"; margin-left: 8px; font-size: 20px; font-weight: 700; }
.student-portfolio[open] summary::after { content: "-"; }
.student-portfolio small { display: block; margin-top: 3px; color: var(--muted); }
.portfolio-grade { color: var(--brand-dark); font-weight: 800; white-space: nowrap; }
.portfolio-body { border-top: 1px solid var(--line); padding: 0 15px; background: #fff; }
.portfolio-body p { padding: 12px 0; margin: 0; border-bottom: 1px solid var(--line); }
.portfolio-body p:last-child { border-bottom: 0; }
@media (max-width: 600px) {
  .attendance-title, .attendance-row, .attendance-actions, .student-attendance { align-items: stretch; flex-direction: column; }
  .attendance-date { width: 100%; }
  .attendance-toggle { width: 100%; }
  .attendance-status, .attendance-actions .ghost-btn, .attendance-actions .primary-btn { width: 100%; }
  .student-attendance-btn { width: 100%; }
  .exam-card-head, .student-portfolio summary { align-items: stretch; flex-direction: column; }
  .compact-btn { width: 100%; }
}
