:root {
  font-family: "DM Sans", sans-serif;
  color: #25271f;
  background: #f6f4ef;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --paper: #f6f4ef;
  --ink: #25271f;
  --muted: #77796f;
  --green: #a9c887;
  --green-dark: #38563c;
  --orange: #df815d;
  --purple: #a99bd1;
  --line: #e5e2d9;
  --white: #fffefa;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--paper);
}

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

a {
  color: inherit;
  text-decoration: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.site-header {
  display: flex;
  width: min(1180px, calc(100% - 64px));
  height: 82px;
  align-items: center;
  justify-content: space-between;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: Manrope, sans-serif;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -1.2px;
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 11px 11px 11px 4px;
  background: var(--green-dark);
  color: white;
  font-family: Georgia, serif;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}

.brand-light {
  color: #929386;
  font-weight: 500;
}

.site-nav {
  display: flex;
  gap: 38px;
  margin-left: 80px;
  color: #62645b;
  font-size: 13px;
  font-weight: 600;
}

.site-nav a,
.text-link,
.back-link,
.text-button {
  transition: color 160ms ease;
}

.site-nav a:hover,
.text-link:hover,
.back-link:hover,
.text-button:hover {
  color: var(--green-dark);
}

.button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 0 22px;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition:
    transform 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button:focus-visible,
a:focus-visible,
.text-button:focus-visible {
  outline: 3px solid #7b9d60;
  outline-offset: 3px;
}

.button-small {
  min-height: 40px;
  padding: 0 19px;
  font-size: 12px;
}

.button-outline {
  border: 1px solid #d4d2c9;
  background: transparent;
  color: var(--ink);
}

.button-outline:hover {
  background: white;
}

.button-primary {
  background: var(--green-dark);
  box-shadow: 0 8px 18px rgb(56 86 60 / 12%);
  color: white;
}

.button-primary:hover {
  background: #2d4731;
  box-shadow: 0 10px 22px rgb(56 86 60 / 18%);
}

.button-dark {
  background: var(--ink);
  color: white;
}

.button-dark:hover {
  background: #3d4036;
}

.hero {
  display: grid;
  width: min(1180px, calc(100% - 64px));
  min-height: 575px;
  grid-template-columns: 0.93fr 1.07fr;
  align-items: center;
  gap: 32px;
  margin: 0 auto;
  padding: 46px 0 58px;
}

.hero-copy {
  position: relative;
  z-index: 1;
  padding: 6px 0 0 24px;
}

.eyebrow {
  margin: 0;
  color: #828477;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.55px;
}

.hero-copy > .eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #799b62;
}

.hero h1,
.aside-message h1 {
  max-width: 540px;
  margin: 25px 0 19px;
  font-family: Manrope, sans-serif;
  font-size: clamp(45px, 5.5vw, 69px);
  font-weight: 600;
  letter-spacing: -4.7px;
  line-height: 1.08;
}

.hero h1 > span {
  color: var(--green-dark);
  font-family: Georgia, serif;
  font-weight: 400;
  font-style: italic;
}

.hero-description {
  max-width: 420px;
  margin: 0;
  color: #76786e;
  font-size: 15px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-top: 29px;
}

.text-link {
  color: #606257;
  font-size: 12px;
  font-weight: 700;
}

.text-link span {
  margin-left: 5px;
  color: var(--green-dark);
}

.hero-note {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 48px;
  color: #8a8b81;
  font-size: 11px;
}

.note-avatars {
  display: flex;
  padding-left: 3px;
}

.note-avatars i {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  margin-left: -3px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: #dd9c7c;
  color: white;
  font-size: 9px;
  font-style: normal;
}

.note-avatars i:nth-child(2) {
  background: #8c9e74;
}

.note-avatars i:nth-child(3) {
  background: #a296be;
}

.hero-art {
  position: relative;
  display: grid;
  min-height: 455px;
  place-items: center;
  overflow: hidden;
  border-radius: 48% 48% 5px 5px;
  background: #eeece3;
}

.hero-art::before {
  position: absolute;
  width: 72%;
  height: 72%;
  border: 1px solid rgb(56 86 60 / 10%);
  border-radius: 50%;
  content: "";
}

.art-orbit {
  position: absolute;
  width: 78%;
  height: 78%;
  border: 1px solid rgb(56 86 60 / 10%);
  border-radius: 50%;
  transform: rotate(-28deg) scaleY(0.56);
}

.orbit-two {
  transform: rotate(48deg) scaleY(0.72);
}

.art-sun {
  position: absolute;
  top: 54px;
  right: 18%;
  width: 67px;
  height: 67px;
  border-radius: 50%;
  background: #e6bc80;
  opacity: 0.8;
}

.book-stack {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(370px, 78%);
  flex-direction: column;
  gap: 7px;
  transform: rotate(-5deg);
}

.book {
  display: flex;
  height: 65px;
  align-items: center;
  gap: 15px;
  padding: 0 20px;
  border: 1px solid rgb(37 39 31 / 8%);
  border-radius: 5px 12px 12px 5px;
  box-shadow: 0 8px 13px rgb(57 54 43 / 8%);
}

.book span {
  font-size: 10px;
  opacity: 0.58;
}

.book strong {
  flex: 1;
  font-family: Manrope, sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.4px;
}

.book i {
  font-size: 19px;
  font-style: normal;
  opacity: 0.72;
}

.book-green {
  width: 88%;
  margin-left: 7%;
  background: #b7c99c;
  color: #314631;
}

.book-cream {
  width: 100%;
  background: #f6f1df;
  color: #514f3f;
}

.book-orange {
  width: 92%;
  margin-left: 5%;
  background: #dc9372;
  color: #593c30;
}

.book-purple {
  width: 97%;
  margin-left: 2%;
  background: #a99dc8;
  color: #393448;
}

.art-label {
  position: absolute;
  z-index: 2;
  color: #77786e;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.3px;
}

.label-top {
  top: 45px;
  left: 43px;
}

.label-top span {
  margin-right: 8px;
  color: var(--green-dark);
}

.label-bottom {
  right: 35px;
  bottom: 28px;
}

.art-spark {
  position: absolute;
  color: var(--green-dark);
  font-size: 23px;
}

.spark-one {
  top: 25%;
  left: 15%;
}

.spark-two {
  right: 15%;
  bottom: 27%;
  color: var(--orange);
}

.feature-strip {
  display: grid;
  width: min(1180px, calc(100% - 64px));
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 0 auto;
  padding: 28px 0 33px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 14px;
}

.feature-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 13px;
  font-size: 18px;
}

.icon-green {
  background: #e6edda;
  color: #4c6742;
}

.icon-orange {
  background: #f4e6dd;
  color: #a75e42;
}

.icon-purple {
  background: #e9e4f2;
  color: #766796;
}

.feature-item h2 {
  margin: 0 0 5px;
  font-family: Manrope, sans-serif;
  font-size: 12px;
  font-weight: 700;
}

.feature-item p {
  margin: 0;
  color: #828378;
  font-size: 10px;
  line-height: 1.5;
}

.closing {
  display: flex;
  min-height: 235px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 38px 24px;
  text-align: center;
}

.closing h2 {
  margin: 12px 0 21px;
  font-family: Manrope, sans-serif;
  font-size: clamp(25px, 3vw, 35px);
  font-weight: 600;
  letter-spacing: -1.4px;
}

.closing .button {
  min-height: 45px;
}

.site-footer {
  display: flex;
  width: min(1180px, calc(100% - 64px));
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  margin: 0 auto;
  border-top: 1px solid var(--line);
  color: #85867c;
  font-size: 10px;
}

.brand-footer {
  color: var(--ink);
  font-size: 15px;
}

.brand-footer .brand-mark {
  width: 25px;
  height: 25px;
  font-size: 19px;
}

/* Login */
.login-page {
  min-height: 100vh;
}

.login-layout {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(300px, 0.9fr) minmax(460px, 1.1fr);
}

.login-aside {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 40px clamp(32px, 6vw, 88px);
  background: #e9eddf;
}

.login-aside::after {
  position: absolute;
  right: -165px;
  bottom: -207px;
  width: 500px;
  height: 500px;
  border: 1px solid rgb(56 86 60 / 13%);
  border-radius: 50%;
  box-shadow:
    0 0 0 38px rgb(56 86 60 / 3%),
    0 0 0 90px rgb(56 86 60 / 3%);
  content: "";
}

.brand-aside {
  position: relative;
  z-index: 1;
}

.aside-message {
  position: relative;
  z-index: 1;
  max-width: 440px;
  margin: auto 0;
}

.aside-symbol {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  margin-bottom: 34px;
  border-radius: 18px 18px 18px 5px;
  background: #d5e1c6;
  color: var(--green-dark);
  font-size: 25px;
}

.aside-message h1 {
  max-width: 390px;
  margin: 18px 0;
  font-size: clamp(42px, 5vw, 62px);
  letter-spacing: -3.8px;
}

.aside-message > p:last-child {
  max-width: 310px;
  color: #77796f;
  font-size: 14px;
  line-height: 1.75;
}

.aside-caption {
  position: relative;
  z-index: 1;
  color: #77796f;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
}

.login-content {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 80px 40px;
  background: var(--white);
}

.back-link {
  position: absolute;
  top: 42px;
  right: 54px;
  color: #77796f;
  font-size: 12px;
  font-weight: 600;
}

.back-link span {
  margin-right: 8px;
}

.login-card {
  width: min(100%, 390px);
  margin-top: 12px;
}

.login-card h2 {
  margin: 14px 0 8px;
  font-family: Manrope, sans-serif;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -1.8px;
}

.login-intro {
  margin: 0 0 31px;
  color: #85867e;
  font-size: 13px;
}

.login-form,
.material-form {
  display: flex;
  flex-direction: column;
}

.login-form label,
.material-form label {
  margin-bottom: 8px;
  color: #494b42;
  font-size: 12px;
  font-weight: 700;
}

.login-form input,
.material-form input,
.material-form select,
.material-form textarea {
  width: 100%;
  min-height: 49px;
  padding: 0 14px;
  border: 1px solid #e0ded5;
  border-radius: 6px;
  outline: none;
  background: #fffefa;
  color: var(--ink);
  font-size: 13px;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.login-form input:focus,
.material-form input:focus,
.material-form select:focus,
.material-form textarea:focus {
  border-color: #8ba475;
  box-shadow: 0 0 0 3px rgb(139 164 117 / 13%);
}

.login-form input::placeholder,
.material-form input::placeholder,
.material-form textarea::placeholder {
  color: #aaa99f;
}

.password-label {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}

.password-label label {
  margin-bottom: 8px;
}

.login-submit {
  width: 100%;
  margin-top: 13px;
}

.login-submit:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}

.form-message {
  min-height: 17px;
  margin: 8px 0 0;
  color: #a34134;
  font-size: 12px;
  line-height: 1.5;
}

.form-message:empty {
  min-height: 0;
  margin: 0;
}

.login-footnote {
  margin-top: 28px;
  color: #8a8b82;
  font-size: 11px;
  text-align: center;
}

.login-footnote span {
  margin-right: 5px;
}

/* Library */
.library-page {
  min-height: 100vh;
  background: #f8f7f2;
}

.library-header {
  width: 100%;
  padding: 0 max(32px, calc((100% - 1100px) / 2));
  background: var(--paper);
}

.library-user {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #606258;
  font-size: 12px;
  font-weight: 600;
}

.user-avatar {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 50%;
  background: #dfe8d4;
  color: var(--green-dark);
  font-family: Manrope, sans-serif;
  font-size: 12px;
  font-weight: 700;
}

.text-button {
  margin-left: 9px;
  padding: 7px 0 7px 12px;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: #77796f;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.library-container {
  width: min(1000px, calc(100% - 48px));
  margin: 0 auto;
  padding: 62px 0 100px;
}

.library-welcome {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 0 0 39px;
  border-bottom: 1px solid var(--line);
}

.library-welcome h1 {
  margin: 12px 0 8px;
  font-family: Manrope, sans-serif;
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 600;
  letter-spacing: -2.3px;
}

.library-welcome h1 span {
  color: var(--green-dark);
}

.library-welcome > div > p:last-child {
  margin: 0;
  color: #818278;
  font-size: 13px;
}

.library-section {
  padding-top: 37px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.section-heading h2 {
  margin: 7px 0 0;
  font-family: Manrope, sans-serif;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.8px;
}

.section-heading .button {
  min-height: 39px;
  font-size: 11px;
}

.materials {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.empty-state {
  grid-column: 1 / -1;
  margin: 0;
  padding: 25px;
  border: 1px dashed #d8d6cd;
  border-radius: 8px;
  color: #898a80;
  font-size: 13px;
  text-align: center;
}

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

.material-card h3 {
  margin: 0 0 10px;
  font-family: Manrope, sans-serif;
  font-size: 15px;
  letter-spacing: -0.3px;
}

.material-card p {
  margin: 12px 0 0;
  color: #73756c;
  font-size: 12px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.meta {
  color: #929388;
  font-size: 10px;
}

.new-material-section {
  margin-top: 10px;
  padding-top: 38px;
  border-top: 1px solid var(--line);
}

.material-form {
  max-width: 620px;
}

.material-form label:not(:first-child) {
  margin-top: 18px;
}

.material-form label span {
  color: #8d8e84;
  font-size: 10px;
  font-weight: 400;
}

.material-form textarea {
  min-height: 105px;
  padding: 12px 14px;
  resize: vertical;
}

.material-form select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #73756c 50%), linear-gradient(135deg, #73756c 50%, transparent 50%);
  background-position: calc(100% - 17px) 21px, calc(100% - 12px) 21px;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
}

.material-form > .button {
  align-self: flex-start;
  margin-top: 3px;
}

@media (max-width: 760px) {
  .site-header,
  .hero,
  .feature-strip,
  .site-footer {
    width: min(100% - 40px, 560px);
  }

  .site-header {
    height: 70px;
  }

  .site-nav {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 34px;
    padding: 58px 0 40px;
  }

  .hero-copy {
    padding-left: 0;
  }

  .hero h1 {
    max-width: 500px;
    font-size: clamp(48px, 12vw, 68px);
    letter-spacing: -3.8px;
  }

  .hero-art {
    min-height: 370px;
  }

  .feature-strip {
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 25px 0;
  }

  .feature-item p {
    font-size: 11px;
  }

  .site-footer {
    flex-wrap: wrap;
    gap: 12px;
    padding: 18px 0;
  }

  .site-footer > span:nth-child(2) {
    order: 1;
    width: 100%;
  }

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

  .login-aside {
    min-height: 220px;
    padding: 24px;
  }

  .login-aside::after {
    right: -235px;
    bottom: -345px;
  }

  .aside-message {
    display: none;
  }

  .aside-caption {
    margin-top: 50px;
  }

  .login-content {
    min-height: calc(100vh - 220px);
    padding: 85px 24px 55px;
  }

  .back-link {
    top: 28px;
    right: 24px;
  }

  .library-header {
    padding: 0 20px;
  }

  .library-container {
    width: calc(100% - 40px);
    padding-top: 42px;
  }
}

@media (max-width: 480px) {
  .hero-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
  }

  .hero-note {
    margin-top: 31px;
  }

  .hero-art {
    min-height: 315px;
    border-radius: 48% 48% 5px 5px;
  }

  .art-label {
    font-size: 7px;
  }

  .label-top {
    top: 28px;
    left: 20px;
  }

  .label-bottom {
    right: 13px;
    bottom: 19px;
  }

  .book {
    height: 55px;
    padding: 0 13px;
  }

  .book strong {
    font-size: 13px;
  }

  .closing h2 {
    max-width: 300px;
    line-height: 1.25;
  }

  .login-aside {
    min-height: 170px;
  }

  .aside-caption {
    margin-top: 30px;
  }

  .login-content {
    min-height: calc(100vh - 170px);
  }

  .library-user {
    gap: 7px;
    font-size: 10px;
  }

  .text-button {
    margin-left: 2px;
    padding-left: 8px;
  }

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

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

  .section-heading {
    align-items: flex-start;
  }
}

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

/* Controle de acesso: oculta a página até a sessão ser verificada */
body[data-access]:not(.ready) {
  visibility: hidden;
}

.app-nav {
  margin-left: 0;
}

.app-nav a[aria-current="page"] {
  color: var(--green-dark);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding-top: 37px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.stat-card strong {
  display: block;
  font-family: Manrope, sans-serif;
  font-size: 28px;
  letter-spacing: -1px;
}

.stat-card span:not(.feature-icon) {
  color: #85867c;
  font-size: 11px;
}

@media (max-width: 760px) {
  .app-nav {
    display: flex;
    gap: 18px;
  }

  .stats {
    grid-template-columns: 1fr;
  }
}

.stat-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.stat-link .stat-card {
  height: 100%;
  transition: border-color 0.2s, transform 0.2s;
}

.stat-link:hover .stat-card,
.stat-link:focus-visible .stat-card {
  border-color: var(--green-dark);
  transform: translateY(-2px);
}

.video-filters {
  display: grid;
  grid-template-columns: repeat(3, 1fr) auto;
  gap: 14px;
  align-items: end;
  margin-top: 32px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-field label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.filter-field input,
.filter-field select {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}

.videos-count {
  margin: 24px 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  padding-bottom: 48px;
}

.video-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.video-thumb {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  color: var(--white);
  font-size: 28px;
}

.video-thumb.tone-0 { background: var(--green-dark); }
.video-thumb.tone-1 { background: var(--orange); }
.video-thumb.tone-2 { background: var(--purple); }
.video-thumb.tone-3 { background: #5f6f8f; }

.video-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px 16px;
}

.video-body h3 {
  margin: 0;
  font-family: Manrope, sans-serif;
  font-size: 15px;
  line-height: 1.3;
}

.video-course,
.video-instructor {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.video-course {
  color: var(--green-dark);
  font-weight: 600;
}

.video-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.video-tags span {
  padding: 3px 8px;
  border-radius: 999px;
  background: #e8eddc;
  color: var(--green-dark);
  font-size: 11px;
}

.video-grid .empty-state {
  grid-column: 1 / -1;
}

@media (max-width: 760px) {
  .video-filters {
    grid-template-columns: 1fr;
  }
}

.text-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  padding-bottom: 48px;
}

.text-grid .empty-state {
  grid-column: 1 / -1;
}

.text-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
}

.text-card:hover,
.text-card:focus-visible {
  border-color: var(--green-dark);
  transform: translateY(-2px);
}

.text-cover {
  display: block;
  aspect-ratio: 16 / 9;
  background: #e8eddc;
}

.text-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.text-cover-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--white);
  font-size: 28px;
}

.text-cover-fallback.tone-0 { background: var(--green-dark); }
.text-cover-fallback.tone-1 { background: var(--orange); }
.text-cover-fallback.tone-2 { background: var(--purple); }
.text-cover-fallback.tone-3 { background: #5f6f8f; }

.text-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px 20px;
}

.text-body h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  line-height: 1.25;
}

.text-kicker {
  color: var(--orange);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.text-excerpt {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.text-meta {
  color: #85867c;
  font-size: 11px;
}

.article-dialog {
  width: min(760px, 94vw);
  max-height: 92vh;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  overflow-y: auto;
}

.article-dialog::backdrop {
  background: rgba(37, 39, 31, 0.55);
}

.article-close {
  position: sticky;
  top: 12px;
  float: right;
  margin: 12px 12px 0 0;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--white);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.article {
  padding: 48px clamp(22px, 6vw, 64px) 56px;
  font-family: Georgia, "Times New Roman", serif;
}

.article-kicker {
  margin: 0 0 12px;
  color: var(--orange);
  font-family: "DM Sans", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.article-title {
  margin: 0 0 14px;
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.article-byline {
  margin: 0 0 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: "DM Sans", sans-serif;
  font-size: 13px;
}

.article-cover {
  margin: 0 0 28px;
}

.article-cover img,
.article-body img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

.article-body {
  font-size: 18px;
  line-height: 1.75;
}

.article-body > p:first-child::first-letter {
  float: left;
  padding: 6px 10px 0 0;
  font-size: 56px;
  line-height: 0.85;
  font-weight: 700;
}

.article-body h2,
.article-body h3,
.article-body h4 {
  margin: 1.6em 0 0.5em;
  line-height: 1.25;
}

.article-body blockquote {
  margin: 1.5em 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--orange);
  color: var(--green-dark);
  font-size: 21px;
  font-style: italic;
}

.article-body a {
  color: var(--green-dark);
}

@media (max-width: 760px) {
  .text-grid {
    grid-template-columns: 1fr;
  }
}

button.video-card {
  padding: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
}

button.video-card:hover,
button.video-card:focus-visible {
  border-color: var(--green-dark);
  transform: translateY(-2px);
}

.video-dialog {
  width: min(900px, 94vw);
  max-height: 94vh;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #15170f;
  color: var(--white);
  overflow-y: auto;
}

.video-dialog::backdrop {
  background: rgba(21, 23, 15, 0.75);
}

.video-dialog .article-close {
  position: absolute;
  z-index: 1;
  top: 0;
  right: 0;
  float: none;
}

.video-stage {
  background: #000;
}

.video-stage video {
  display: block;
  width: 100%;
  max-height: 70vh;
}

.video-missing {
  margin: 0;
  padding: 80px 24px;
  color: #cfd1c6;
  text-align: center;
}

.video-info {
  padding: 20px 24px 26px;
}

.video-info h2 {
  margin: 0 0 6px;
  font-family: Manrope, sans-serif;
  font-size: 20px;
}

.video-info p {
  margin: 0;
  color: #b9bbaf;
  font-size: 13px;
}

.video-info .video-desc {
  margin-top: 12px;
  color: #e6e7df;
  font-size: 14px;
  line-height: 1.6;
}

/* ---------- IAM ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.iam-message {
  min-height: 22px;
  margin: 20px 0 0;
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 600;
}

.iam-message.is-error {
  color: #a34134;
}

.iam-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
  border-bottom: 1px solid var(--line);
}

.iam-tabs button {
  padding: 12px 18px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.iam-tabs button[aria-selected="true"] {
  border-bottom-color: var(--green-dark);
  color: var(--green-dark);
}

.iam-panel {
  padding: 24px 0 56px;
}

.iam-form {
  display: grid;
  grid-template-columns: repeat(4, 1fr) auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 24px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

#role-form {
  grid-template-columns: 1fr 2fr 1fr auto;
}

.iam-form-inline {
  grid-template-columns: minmax(200px, 280px) auto;
}

.iam-form[hidden] {
  display: none;
}

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

.iam-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.iam-table th,
.iam-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.iam-table thead th {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.iam-table tbody tr:last-child td,
.iam-table tbody tr:last-child th {
  border-bottom: 0;
}

.iam-table select {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  font: inherit;
}

.iam-actions {
  white-space: nowrap;
  text-align: right !important;
}

.iam-actions .text-button {
  border-left: 0;
}

.text-button.danger {
  color: #a34134;
}

.iam-empty {
  color: var(--muted);
  text-align: center !important;
}

.badge {
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.iam-matrix thead th {
  text-align: center;
}

.iam-matrix thead th:first-child {
  text-align: left;
}

.iam-matrix th small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.iam-matrix tbody th {
  min-width: 240px;
  font-weight: 500;
}

.iam-matrix td {
  text-align: center !important;
}

.iam-matrix input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--green-dark);
}

.iam-matrix input[type="checkbox"]:disabled {
  opacity: 0.45;
}

.iam-hint {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
}

.iam-dialog {
  width: min(420px, calc(100vw - 32px));
  padding: 24px;
  border: 0;
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
}

.iam-dialog::backdrop {
  background: rgba(37, 39, 31, 0.5);
}

.iam-dialog form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.iam-dialog h2 {
  margin: 0;
}

.iam-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 860px) {
  .iam-form,
  #role-form {
    grid-template-columns: 1fr;
  }
}

/* ---------- Conta ---------- */
.account-link {
  color: inherit;
  text-decoration: none;
}

.account-link:hover {
  color: var(--green-dark);
  text-decoration: underline;
}

.account-form {
  display: grid;
  gap: 16px;
  max-width: 480px;
  margin-bottom: 56px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.account-form small {
  color: var(--muted);
  font-size: 12px;
}

.account-form input[readonly] {
  color: var(--muted);
  cursor: not-allowed;
}
