:root {
  --page: #faf8f5;
  --paper: #fffefd;
  --ink: #39302d;
  --muted: #766d68;
  --rose: #a37570;
  --rose-dark: #82534e;
  --rose-light: #f3eae5;
  --line: #e7ddd7;
  --shadow: 0 18px 55px rgba(73, 47, 41, .08);
}
*,*::before,*::after {box-sizing:border-box}
html {scroll-behavior:smooth}
body {margin:0;background:var(--page);color:var(--ink);font-family:'DM Sans',Arial,sans-serif;-webkit-font-smoothing:antialiased}
body.modal-open {overflow:hidden}
button,input,select {font:inherit}
a {color:inherit;text-decoration:none}
button {cursor:pointer}
a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible {outline:3px solid #b58b82;outline-offset:3px}
img,svg {max-width:100%}
[hidden] {display:none!important}
.container {width:min(1600px,calc(100% - clamp(32px,5.5vw,112px)));margin-inline:auto}
h1,h2,h3,p {margin:0}
h1,h2,.signature-section em {font-family:'Playfair Display',Georgia,serif;font-weight:400}
em {font-style:italic;font-weight:400;color:var(--rose-dark)}
.skip-link {position:absolute;top:-70px;left:14px;z-index:2000;background:white;padding:12px;border-radius:5px}.skip-link:focus {top:12px}
.site-header {background:#faf8f5;border-bottom:1px solid #eae1dd}
.header-inner {height:94px;display:flex;align-items:center;justify-content:space-between;gap:22px}
.brand {display:flex;align-items:center;flex-shrink:0}
.brand img {width:250px;height:auto;display:block}
.header-nav {display:flex;align-items:center;gap:34px;color:#675e59;font-size:13px;font-weight:600}
.header-nav a {transition:color .2s}.header-nav a:hover {color:var(--rose-dark)}
.header-action {display:inline-flex;align-items:center;gap:12px;padding:12px 18px;border:1px solid #d5bfb6;border-radius:50px;color:var(--rose-dark);font-size:12px;font-weight:700;white-space:nowrap;transition:background .2s}
.header-action:hover {background:var(--rose-light)}

/* Cabeçalho editorial inspirado na referência — apenas no portal, não no admin. */
.portal-home-header{
  background:var(--page);
  border-bottom:1px solid rgba(130,83,78,.12);
}
.portal-home-header .header-inner{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);
  gap:clamp(18px,2.7vw,44px);
  height:96px;
}
.portal-home-header .brand{justify-self:start;min-width:0}
.portal-home-header .brand img{
  width:clamp(205px,19vw,292px);
  height:auto;
}
.portal-home-header .header-nav{
  justify-self:center;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:clamp(26px,3vw,50px);
  font-size:15px;
  font-weight:400;
  white-space:nowrap;
}
.portal-home-header .header-nav a{
  position:relative;
  display:inline-flex;
  align-items:center;
  padding:10px 0;
  color:#6c5751;
  font:500 16px/1.25 'Playfair Display',Georgia,serif;
  transition:color .2s ease;
}
.portal-home-header .header-nav a::after{
  content:"";
  position:absolute;
  left:0;
  right:0;
  bottom:-5px;
  height:1px;
  background:var(--rose-dark);
  opacity:0;
  transform:scaleX(.65);
  transform-origin:center;
  transition:opacity .2s ease,transform .2s ease;
}
.portal-home-header .header-nav a[aria-current="location"]::after,
.portal-home-header .header-nav a:hover::after,
.portal-home-header .header-nav a:focus-visible::after{
  opacity:1;
  transform:scaleX(1);
}
.portal-home-header .header-nav a[aria-current="location"]{
  color:var(--rose-dark);
}
.portal-home-header .account-actions{
  justify-self:end;
  display:flex;
  align-items:center;
  gap:clamp(10px,1.3vw,20px);
}
.portal-home-header .header-action{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:43px;
  padding:0 17px;
  border:1px solid rgba(130,83,78,.48);
  border-radius:999px;
  background:transparent;
  color:var(--rose-dark);
  font:500 13px/1.2 'DM Sans',Arial,sans-serif;
  white-space:nowrap;
  transition:background .2s,border-color .2s,transform .2s;
}
.portal-home-header .header-action:hover{
  background:var(--rose-light);
  border-color:var(--rose-dark);
  transform:translateY(-1px);
}
.portal-home-header .header-user-icon{flex:0 0 17px}
.portal-home-header .header-action-arrow{font-size:15px;line-height:1}
.portal-home-header .logout-button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:43px;
  padding:0 23px;
  border:1px solid var(--rose-dark);
  border-radius:999px;
  background:var(--rose-dark);
  color:#fffdfb;
  font:500 13px/1.2 'DM Sans',Arial,sans-serif;
  white-space:nowrap;
  transition:background .2s,border-color .2s,transform .2s;
}
.portal-home-header .logout-button:hover{
  background:#704541;
  border-color:#704541;
  color:#fff;
  transform:translateY(-1px);
}
@media(max-width:1080px){
  .portal-home-header .header-inner{gap:14px}
  .portal-home-header .brand img{width:clamp(178px,21vw,230px)}
  .portal-home-header .header-nav{gap:23px}
  .portal-home-header .header-nav a{font-size:14px}
  .portal-home-header .header-action{padding:0 12px;font-size:12px}
  .portal-home-header .logout-button{padding:0 18px}
}
@media(max-width:800px){
  /* Mantém a navegação recolhida no mobile: não força 3 colunas estreitas. */
  .portal-home-header .header-inner{display:flex;justify-content:space-between;height:82px;gap:12px}
  .portal-home-header .header-nav{display:none}
  .portal-home-header .brand img{width:215px}
}
@media(max-width:600px){
  .portal-home-header .header-inner{height:74px;gap:8px}
  .portal-home-header .brand img{width:clamp(120px,36vw,177px)}
  .portal-home-header .account-actions{gap:7px}
  .portal-home-header .header-action{min-height:38px;padding:0 10px;font-size:11px;gap:5px}
  .portal-home-header .header-action-arrow{display:none}
  .portal-home-header .logout-button{min-height:38px;padding:0 12px;font-size:11px}
}
@media(max-width:380px){
  .portal-home-header .brand img{width:112px}
  .portal-home-header .header-user-icon{display:none}
}

.hero-section {padding-top:30px}
.hero-panel {position:relative;min-height:552px;border-radius:14px;overflow:hidden;background:#eae1d9;isolation:isolate}
.hero-photo {position:absolute;inset:0 0 0 auto;height:100%;width:62%;max-width:none;object-fit:cover;object-position:50% 39%;-webkit-mask-image:linear-gradient(to right,transparent 0%,rgba(0,0,0,.24) 14%,#000 34%);mask-image:linear-gradient(to right,transparent 0%,rgba(0,0,0,.24) 14%,#000 34%);z-index:-1}
.hero-grain {pointer-events:none;position:absolute;inset:0;z-index:0;background:radial-gradient(ellipse at 0 100%,rgba(255,255,255,.58),transparent 47%),linear-gradient(90deg,rgba(244,235,229,.37) 0%,transparent 50%)}
.hero-content {position:relative;z-index:2;padding:77px 0 55px 70px;max-width:630px;min-height:552px;display:flex;flex-direction:column;align-items:flex-start}
.hero-eyebrow,.section-eyebrow {color:#93665f;font-size:11px;font-weight:700;letter-spacing:.19em;display:flex;align-items:center;gap:12px}
.eyebrow-line,.section-eyebrow span {display:block;background:#ac8679;width:25px;height:1px;flex-shrink:0}
h1 {font-size:clamp(46px,4.9vw,69px);line-height:1.14;letter-spacing:-.047em;max-width:525px;margin:30px 0 22px}
.hero-content>p {font-size:15px;line-height:1.9;color:#665c57;max-width:425px;margin-bottom:26px}
.primary-button {display:inline-flex;align-items:center;justify-content:space-between;gap:30px;min-height:53px;padding:0 21px;border-radius:5px;background:var(--rose-dark);color:white;font-size:13px;font-weight:700;transition:transform .2s,background .2s,box-shadow .2s}
.primary-button:hover {background:#6d4440;transform:translateY(-2px);box-shadow:0 9px 24px #82534e3d}
.primary-button svg {width:19px}
.hero-footnote {margin-top:auto;padding-top:25px;display:flex;align-items:center;gap:10px;color:#77655d;font-size:12px;font-weight:500}
.small-symbol {font-size:23px;color:#ae897e}
.library-section {scroll-margin-top:18px;padding:93px 0 105px;background:var(--paper);border-top:1px solid #efe8e3;border-bottom:1px solid #eee5e0}
.section-heading {display:flex;align-items:end;justify-content:space-between;gap:30px;margin-bottom:35px}
.section-heading h2,.guide-intro h2 {font-size:clamp(37px,3.85vw,56px);letter-spacing:-.043em;line-height:1.17;margin:17px 0 14px}
.section-heading p {font-size:14px;line-height:1.8;color:var(--muted);max-width:670px}
.library-summary {display:flex;align-items:center;gap:15px;border-left:1px solid #e8dcd5;padding:8px 0 8px 29px;flex-shrink:0}
.library-summary strong {font:400 54px 'Playfair Display',Georgia,serif;color:#a17469;line-height:1}
.library-summary span {font-size:11px;color:#8a7870;line-height:1.6}
.library-tools {display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:23px}
.search-box {display:flex;align-items:center;gap:12px;border:1px solid #e4dcd6;border-radius:7px;background:#fff;min-height:51px;padding:0 16px;width:min(100%,455px);color:#947e73;transition:border-color .2s}
.search-box:focus-within {border-color:var(--rose)}
.search-box input {border:0;outline:none;background:transparent;width:100%;min-width:0;color:var(--ink);font-size:13px}
.search-box input::placeholder {color:#a3948c}
.search-box input::-webkit-search-cancel-button {cursor:pointer}
.sort-control {display:flex;align-items:center;gap:12px;font-size:12px;color:#92817a;white-space:nowrap}
.sort-control select {max-width:190px;color:#6a5752;font-size:12px;border:1px solid #e7dcd7;background:#fff;padding:11px 27px 11px 12px;border-radius:5px;cursor:pointer}
.filter-row {display:flex;align-items:center;gap:9px;flex-wrap:wrap;padding-bottom:25px;border-bottom:1px solid #ece3de}
.filter-btn {padding:10px 16px;border:1px solid #e8e0db;background:#fff;border-radius:50px;color:#756a64;font-size:12px;font-weight:600;transition:all .2s;white-space:nowrap}
.filter-btn:hover {background:#fbf5f1;border-color:#d7c9c1}
.filter-btn[aria-pressed=true] {background:#93675e;border-color:#93675e;color:#fff}
.filter-btn .badge-count {font-size:11px;font-weight:500;opacity:.8;margin-left:5px}
.results-row {display:flex;align-items:center;justify-content:space-between;gap:12px;margin:22px 0;color:#8a7e76;font-size:12px}
.results-note {color:#a0918a}
.material-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}
.material-card {display:flex;min-width:0;overflow:hidden;background:#fff;border:1px solid #e9e0db;border-radius:9px;min-height:270px;transition:transform .22s,border-color .22s,box-shadow .22s}
.material-card:hover {transform:translateY(-3px);border-color:#d7c6bc;box-shadow:var(--shadow)}
.material-cover {position:relative;flex:0 0 197px;min-width:0;background:#f2eae5;display:grid;place-items:center;overflow:hidden;border-right:1px solid #ede3dd}
.material-cover img {width:78%;height:88%;max-width:155px;object-fit:contain;box-shadow:0 10px 25px #5b40342a;background:#fff;transition:transform .25s}
.material-card:hover .material-cover img {transform:scale(1.03)}
.material-cover .highlight {position:absolute;left:12px;top:12px;z-index:1;padding:7px 9px;background:#fffaf5;border:1px solid #ead8cd;border-radius:3px;font-size:10px;color:#8b6259;font-weight:700;letter-spacing:.03em}
.material-content {padding:24px 23px 18px;display:flex;flex-direction:column;flex:1;min-width:0}
.card-category {color:#9a6d62;font-weight:700;letter-spacing:.12em;font-size:11px;text-transform:uppercase;margin-bottom:11px}
.material-content h3 {font:500 25px/1.2 'Playfair Display',Georgia,serif;letter-spacing:-.03em;margin:0 0 10px}
.material-description {font-size:12px;line-height:1.72;color:#83756e;flex:1;margin-bottom:15px}
.card-actions {display:flex;align-items:center;gap:14px;justify-content:space-between;border-top:1px solid #efe9e4;padding-top:13px}
.read-link {display:inline-flex;align-items:center;gap:8px;color:#84574f;font-size:12px;font-weight:700;border:0;background:transparent;padding:8px 0;text-align:left}
.read-link:hover {text-decoration:underline;text-underline-offset:3px}
.card-right {display:flex;align-items:center;gap:14px}
.card-pages {font-size:11px;color:#9e8d84;white-space:nowrap}
.download-link {display:grid;place-items:center;width:34px;height:34px;border:1px solid #e6dcd6;border-radius:5px;color:#8e675d;transition:background .2s}
.download-link:hover {background:#f5ece6}
.empty-state {padding:58px 18px;text-align:center;background:#faf7f5;border:1px dashed #dccac0;border-radius:8px}
.empty-icon {font-size:45px;color:#b18c7e;line-height:1.1}
.empty-state h3 {font:400 29px 'Playfair Display',Georgia,serif;margin:15px 0 8px}
.empty-state p {font-size:13px;line-height:1.6;color:var(--muted)}
.empty-state button {background:#86584f;color:white;border:0;border-radius:5px;padding:12px 18px;margin-top:20px;font-size:12px;font-weight:700}
.guide-section {padding-top:103px;padding-bottom:104px;display:grid;grid-template-columns: .89fr 1.11fr;gap:90px;scroll-margin-top:30px}
.guide-intro h2 {max-width:440px}
.guide-intro p {max-width:420px;color:#7b6f68;font-size:14px;line-height:1.85;margin-top:20px}
.guide-steps {display:flex;flex-direction:column;border-top:1px solid #e4d8d1}
.guide-step {display:flex;gap:23px;align-items:flex-start;padding:25px 0;border-bottom:1px solid #e4d8d1}
.guide-step>span {font:italic 30px 'Playfair Display',Georgia,serif;color:#a97e74;min-width:48px}
.guide-step h3 {font-size:14px;font-weight:700;margin-bottom:8px}
.guide-step p {font-size:12px;line-height:1.7;color:#857770}
.signature-section {background:#eae0d9}
.signature-inner {min-height:162px;display:flex;align-items:center;gap:24px}
.signature-icon {display:grid;place-items:center;width:45px;height:45px;color:#986e64;font-size:31px;flex-shrink:0}
.signature-inner p {font:italic 26px/1.45 'Playfair Display',Georgia,serif;color:#684d47;max-width:700px}
.signature-inner>span {font-size:12px;color:#897066;white-space:nowrap;margin-left:auto}
.signature-inner>span em {font:italic 24px 'Playfair Display',Georgia,serif;color:#8c6259;margin-left:7px}
.site-footer {background:#f9f6f2}
.footer-inner {padding:36px 0;display:flex;align-items:center;justify-content:space-between;gap:25px}
.footer-brand {display:flex;flex-direction:column;align-items:flex-start;gap:3px}
.footer-brand img {width:202px;height:auto;display:block}
.footer-brand span {font-size:11px;color:#9a8c85}
.footer-inner>p {text-align:right;color:#958981;font-size:11px;line-height:1.8}
.modal {position:fixed;inset:0;z-index:500;background:rgba(26,23,22,.76);display:grid;place-items:center;padding:20px}
.modal-card {display:flex;flex-direction:column;background:#faf7f4;width:min(1070px,100%);height:min(94dvh,930px);border-radius:11px;overflow:hidden;box-shadow:0 30px 80px #0004}
.modal-topbar {flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;gap:15px;padding:16px 23px;background:#fff}
.modal-document {min-width:0}
.modal-document .modal-label {font-size:10px;letter-spacing:.17em;color:#a8776e;font-weight:700}
.modal-document h3 {font:500 20px/1.2 'Playfair Display',Georgia,serif;margin:5px 0 4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.modal-document p {font-size:11px;color:#92827b}
.modal-actions {display:flex;align-items:center;gap:17px;flex-shrink:0}
.modal-actions>a {font-size:12px;font-weight:700;color:#895a50}
.modal-actions button {display:grid;place-items:center;width:38px;height:38px;background:#f1e7e2;border:0;border-radius:50%;color:#7f574e;font-size:27px;line-height:1}
#pdfFrame {border:0;display:block;background:#ddd;flex:1;width:100%;min-height:0}
.modal-bottom {flex-shrink:0;background:#fff;padding:10px 20px;color:#84776f;font-size:11px;text-align:center}
@media(max-width:1080px) {
  .container {width:min(1200px,calc(100% - 52px))}
  .header-nav {gap:20px}
  .hero-content {padding-left:50px;max-width:580px}
  .hero-photo {width:60%}
  .material-cover {flex-basis:158px}
  .material-content {padding:20px 16px 14px}
  .material-content h3 {font-size:22px}
  .card-right {gap:8px}
  .guide-section {gap:50px}
}
@media(max-width:800px) {
  .header-inner {height:82px}
  .brand img {width:215px}
  .header-nav {display:none}
  .hero-section {padding-top:18px}
  .hero-panel {min-height:540px}
  .hero-content {min-height:540px;padding:66px 0 48px 35px;max-width:480px}
  .hero-photo {width:65%;object-position:42% center;opacity:.84}
  .hero-grain {background:linear-gradient(90deg,rgba(235,225,215,.85) 0%,rgba(235,225,215,.6) 48%,transparent 100%)}
  h1 {font-size:52px;max-width:440px}
  .hero-content>p {max-width:375px}
  .material-grid {grid-template-columns:1fr}
  .material-cover {flex-basis:215px}
  .material-card {min-height:240px}
  .material-content h3 {font-size:25px}
  .guide-section {grid-template-columns:1fr;gap:35px}
  .signature-inner {flex-wrap:wrap;gap:12px;padding-top:25px;padding-bottom:25px}
  .signature-inner>span {margin-left:0;width:100%;padding-left:66px}
}
@media(max-width:600px) {
  .container {width:calc(100% - 32px)}
  .header-inner {height:74px}
  .brand img {width:194px}
  .header-action {padding:10px 12px;font-size:11px;gap:6px}
  .hero-panel {min-height:720px;display:flex;flex-direction:column;justify-content:flex-end;border-radius:9px}
  .hero-photo {width:100%;height:60%;inset:0 0 auto 0;opacity:1;object-position:center 30%;-webkit-mask-image:linear-gradient(to bottom,#000 0%,#000 49%,transparent 100%);mask-image:linear-gradient(to bottom,#000 0%,#000 49%,transparent 100%)}
  .hero-grain {background:linear-gradient(to bottom,transparent 0%,transparent 37%,rgba(234,225,217,.42) 55%,#eae1d9 69%,#eae1d9 100%)}
  .hero-content {min-height:unset;max-width:none;padding:0 23px 35px;margin-top:330px}
  .hero-eyebrow {font-size:10px;letter-spacing:.15em}
  h1 {font-size:clamp(39px,10vw,52px);line-height:1.12;letter-spacing:-.04em;margin:19px 0 16px}
  .hero-content>p {font-size:13px;line-height:1.75;margin-bottom:20px;max-width:450px}
  .primary-button {min-height:49px;padding:0 17px;font-size:12px}
  .hero-footnote {padding-top:20px;font-size:11px}
  .library-section {padding:62px 0 70px}
  .section-heading {align-items:flex-start;gap:15px;margin-bottom:23px}
  .section-heading h2,.guide-intro h2 {font-size:39px;margin:14px 0 10px}
  .section-heading p {font-size:12px;line-height:1.7}
  .library-summary {display:none}
  .section-eyebrow {font-size:10px;letter-spacing:.14em}
  .library-tools {flex-direction:column;align-items:stretch;gap:10px;margin-bottom:18px}
  .search-box {max-width:none;width:100%;min-height:49px}
  .sort-control {justify-content:flex-end}
  .filter-row {gap:7px;padding-bottom:18px;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;margin-right:-16px;padding-right:16px}
  .filter-row::-webkit-scrollbar {display:none}
  .filter-btn {padding:10px 12px;font-size:11px;flex-shrink:0}
  .results-row {margin:17px 0;font-size:11px}
  .results-note {display:none}
  .material-grid {gap:12px}
  .material-cover {flex:0 0 132px}
  .material-cover img {width:81%;height:82%}
  .material-card {min-height:243px}
  .material-content {padding:17px 14px 12px}
  .material-content h3 {font-size:21px;line-height:1.19;margin-bottom:9px}
  .card-category {font-size:10px;margin-bottom:7px}
  .material-description {font-size:11px;line-height:1.65;margin-bottom:9px;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
  .card-pages {font-size:10px}
  .card-actions {padding-top:8px;gap:5px}
  .read-link {font-size:11px;white-space:nowrap}
  .card-right {gap:6px}
  .download-link {width:31px;height:31px}
  .material-cover .highlight {font-size:9px;left:7px;top:8px;padding:5px 7px}
  .guide-section {padding-top:66px;padding-bottom:68px}
  .guide-intro h2 {max-width:390px}
  .guide-intro p {margin-top:10px;font-size:12px}
  .guide-step {padding:19px 0;gap:15px}
  .guide-step>span {font-size:25px;min-width:36px}
  .signature-inner {gap:5px;min-height:unset}
  .signature-icon {width:29px;font-size:24px}
  .signature-inner p {font-size:21px;max-width:calc(100% - 43px)}
  .signature-inner>span {padding-left:35px;font-size:11px}
  .footer-inner {flex-direction:column;align-items:flex-start;gap:18px;padding:28px 0}
  .footer-inner>p {text-align:left}
  .modal {padding:0}
  .modal-card {height:100dvh;width:100%;border-radius:0}
  .modal-topbar {padding:12px;gap:8px}
  .modal-document h3 {max-width:150px;font-size:16px}
  .modal-document .modal-label {font-size:9px}
  .modal-actions {gap:6px}
  .modal-actions>a {font-size:10px;max-width:77px;line-height:1.3}
  .modal-actions button {width:34px;height:34px;flex-shrink:0}
  .modal-bottom {font-size:10px;padding:10px}
}
@media(max-width:380px) {
  .brand img {width:168px}
  .header-action {font-size:10px}
  .hero-panel {min-height:695px}
  .hero-content {margin-top:325px;padding-bottom:25px}
  h1 {font-size:39px}
  .material-cover {flex-basis:112px}
  .material-content {padding:13px 11px 10px}
  .material-content h3 {font-size:19px}
  .material-description {font-size:11px;-webkit-line-clamp:2}
  .card-pages {display:none}
}
@media(prefers-reduced-motion:reduce) {
  html {scroll-behavior:auto}
  *,*::before,*::after {transition-duration:0.01ms!important;animation-duration:0.01ms!important}
}

/* Estado inicial neutro: evita mostrar o login enquanto a sessão é validada. */
.portal-bootstrap{min-height:100vh;min-height:100dvh;display:grid;place-items:center;padding:24px;background:#faf8f5}
.portal-bootstrap-content{display:flex;flex-direction:column;align-items:center;gap:18px;text-align:center;color:#8a7773;font:500 13px 'DM Sans',sans-serif;animation:portal-bootstrap-reveal .2s ease .3s both}
.portal-bootstrap-content img{display:block;width:170px;max-width:70vw;height:auto}
@keyframes portal-bootstrap-reveal{from{opacity:0}to{opacity:1}}
@media(prefers-reduced-motion:reduce){.portal-bootstrap-content{animation:none}}

/* V3: área privada e administração */
[hidden]{display:none!important}
.account-actions{display:flex;align-items:center;gap:12px}
.logout-button,.secondary-button{border:1px solid #b9a49c;background:transparent;color:#61464a;padding:11px 18px;border-radius:999px;font:600 13px 'DM Sans',sans-serif;cursor:pointer;text-decoration:none}
.logout-button:hover,.secondary-button:hover{background:#f2e9e7}
.access-page{min-height:100vh;display:grid;place-items:center;padding:28px 18px;background:radial-gradient(circle at 100% 0%,#f0e0dc,#faf8f5 55%)}
.access-card{width:min(100%,470px);background:#fff;border:1px solid #f0e8e3;border-radius:22px;padding:clamp(25px,5vw,48px);box-shadow:0 20px 70px #7f5a4517;display:flex;flex-direction:column;gap:16px}
.access-card>img{width:190px;height:auto;align-self:flex-start;margin-bottom:14px}
.access-card h1,.admin-heading h1{font-family:'Playfair Display',Georgia,serif;font-weight:400;color:#523739;line-height:1.1;font-size:clamp(34px,4vw,51px);margin:0}
.access-card h1 em,.admin-heading h1 em{font-weight:400;color:#aa747b}
.access-card p{color:#756f6b;line-height:1.65;margin:0}
.access-card small{font-size:12px;color:#817a75}
.portal-form{display:flex;flex-direction:column;gap:10px}
.portal-password{display:flex;flex-direction:column;gap:10px}
.portal-form label{font-size:13px;font-weight:600;color:#4b4140}
.portal-form input:not([type="checkbox"]),.portal-form select,.portal-form textarea{background:white;width:100%;min-width:0;box-sizing:border-box;border:1px solid #d9ceca;border-radius:10px;padding:13px 14px;font:15px 'DM Sans',sans-serif;color:#4b4140}
.portal-form input:focus-visible,.portal-form select:focus-visible,.portal-form textarea:focus-visible{outline:2px solid #ad7b83;outline-offset:2px}
.portal-form .primary-button{justify-content:center;border:0;cursor:pointer;font:600 14px 'DM Sans',sans-serif;margin-top:8px}
.portal-form button:disabled{opacity:.55;cursor:wait}
.portal-status{min-height:20px;color:#75525d;font-size:13px;line-height:1.5}
.document-placeholder{height:100%;min-height:210px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;background:linear-gradient(155deg,#efe0dd,#f9f2ef);color:#a57379;font:italic 56px 'Playfair Display',serif}
.document-placeholder span{font:500 11px 'DM Sans',sans-serif;letter-spacing:.12em;text-transform:uppercase}
.download-link{border:0;cursor:pointer;font-size:22px;line-height:1}
.admin-main{padding-top:52px;padding-bottom:100px}
.admin-heading{margin-bottom:32px}
.admin-heading h1{margin:12px 0}
.admin-heading p{color:#736c67}
.admin-columns{display:grid;grid-template-columns:1fr 1fr;gap:24px;align-items:start}
.admin-card{background:white;border:1px solid #eee5df;border-radius:18px;padding:clamp(20px,3vw,30px);box-shadow:0 6px 24px #6a4f4a0a}
.admin-card h2{font:400 29px 'Playfair Display',serif;color:#503738;margin:0 0 20px}
.admin-card p{color:#766f68;line-height:1.5;font-size:14px}
.admin-edit-hint{
  padding:12px 14px;
  margin:0 0 16px;
  background:#f8f0eb;
  border-left:3px solid #aa7c70;
  border-radius:0 8px 8px 0;
  color:#654b46!important;
  font-size:13px!important;
}
.admin-cover-preview{
  display:flex;
  align-items:center;
  gap:14px;
  margin:2px 0 8px;
  padding:12px;
  border:1px solid #e9d9d1;
  border-radius:12px;
  background:#fcf8f5;
}
.admin-cover-preview img{
  display:block;
  flex:0 0 auto;
  width:auto;
  max-width:110px;
  height:150px;
  object-fit:contain;
  box-shadow:0 7px 18px #63453c22;
  background:#fff;
  border-radius:3px;
}
.admin-cover-preview span{
  font-size:12px;
  line-height:1.5;
  color:#795f58;
}
.admin-cover-guidance{
  font-size:13px;
  color:#76615c;
  margin-bottom:14px!important;
}
@media(max-width:420px){
  .admin-cover-preview img{max-width:90px;height:124px}
}
.admin-edit-note{
  font-size:12px!important;
  line-height:1.55!important;
  color:#806d66!important;
  margin:-3px 0 6px!important;
}
.admin-form-status{
  display:block;
  padding:7px 0;
  font-weight:600;
  overflow-wrap:anywhere;
}
.admin-main>.portal-status{
  margin:-12px 0 20px;
}
.admin-duo{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.admin-duo>div{display:flex;flex-direction:column;gap:10px}
.admin-check{display:flex;align-items:center;gap:8px;margin:10px 0}
.admin-library{margin-top:24px}
.admin-list{display:grid;gap:8px;margin-top:22px}
.admin-item{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:13px 0;border-bottom:1px solid #eee9e6}
.admin-item strong{display:block;color:#433739;font-size:14px;overflow-wrap:anywhere}
.admin-item small{display:block;margin-top:4px;font-size:12px;color:#807976}
.admin-item-actions{display:flex;gap:8px;flex-wrap:wrap}
.admin-item .secondary-button{white-space:nowrap;padding:9px 13px;font-size:12px}
@media(max-width:800px){.admin-columns{grid-template-columns:1fr}.account-actions{gap:6px}.account-actions .header-action{font-size:12px;padding:9px}.logout-button{font-size:12px;padding:9px}}
@media(max-width:420px){.admin-item{align-items:flex-start;flex-direction:column}.admin-item-actions{width:100%}}


/* Ordenação visual: arrastar no desktop, setas no celular/teclado */
.reorder-help{font-size:13px!important;line-height:1.6;margin:-5px 0 12px!important;color:#746b68}
.admin-sort-list{gap:10px;margin-top:16px}
.admin-sort-item{display:grid;grid-template-columns:34px minmax(0,1fr) auto auto;align-items:center;gap:12px;padding:13px 14px;background:#fff;border:1px solid #e8dfdb;border-radius:12px;transition:border-color .15s,box-shadow .15s}
.admin-sort-item:hover{border-color:#cbb6af}
.admin-sort-item.is-dragging{opacity:.48}
.admin-sort-item.drop-before{box-shadow:0 -4px 0 #a6767b}
.admin-sort-item.drop-after{box-shadow:0 4px 0 #a6767b}
.admin-drag-handle{width:34px;min-height:42px;border:0;background:#f8f3f0;color:#8b6868;border-radius:8px;font-size:25px;cursor:grab;user-select:none}
.admin-drag-handle:active{cursor:grabbing}
.admin-sort-details{min-width:0}
.admin-sort-details strong{display:block;font-size:14px;color:#4b3939;line-height:1.4;overflow-wrap:anywhere}
.admin-sort-details small{display:block;font-size:12px;color:#807976;margin-top:5px}
.admin-move-actions{display:flex;align-items:center;gap:5px}
.admin-move-button{display:grid;place-items:center;width:32px;height:34px;background:#fcf9f7;border:1px solid #ddceca;border-radius:8px;color:#775358;font-size:17px;cursor:pointer}
.admin-move-button:hover:not(:disabled){background:#f1e4e0;border-color:#b99590}
.admin-move-button:disabled,.admin-drag-handle:disabled{opacity:.35;cursor:default}
.admin-sort-item .admin-item-actions{gap:6px;flex-wrap:nowrap}
.admin-sort-item .admin-item-actions button{font-size:12px;padding:8px 11px}
.admin-sort-item button:focus-visible{outline:2px solid #a6767b;outline-offset:2px}
#reorderStatus{margin:12px 0 0}
@media(max-width:720px){
  .admin-sort-item{grid-template-columns:34px minmax(0,1fr) auto;grid-template-areas:"drag details moves" "actions actions actions";gap:10px;padding:12px}
  .admin-drag-handle{grid-area:drag}
  .admin-sort-details{grid-area:details}
  .admin-move-actions{grid-area:moves}
  .admin-sort-item .admin-item-actions{grid-area:actions;border-top:1px solid #f0e8e5;padding-top:9px;justify-content:flex-end;width:auto;flex-direction:row}
}

/* Hero do Método L.A.: tipografia legível e proporções fluidas */
.hero-panel{
  min-height:clamp(520px,38vw,720px);
}
.hero-content{
  width:min(63%,810px);
  max-width:none;
  min-height:clamp(520px,38vw,720px);
  padding:clamp(44px,5vw,94px) clamp(32px,5vw,92px);
  justify-content:center;
  align-items:center;
  text-align:center;
}
.hero-identity{
  display:inline-flex;
  flex-direction:column;
  align-items:center;
  align-self:center;
  max-width:100%;
}
.hero-content .hero-name{
  font-family:Georgia,'Times New Roman',serif;
  font-size: clamp(42px, 5vw, 76px);
  line-height:1.12;
  font-weight:400;
  letter-spacing:0.06em;
  text-transform:uppercase;
  color:#704c49;
  white-space:nowrap;
  margin:0;
  max-width:none;
  word-spacing: 20px;
}
.hero-profession{
  margin:8px 0 0;
  align-self:center;
  color:#835f5c;
  font-family:Arial,Helvetica,sans-serif;
  font-size: clamp(18px, 2.5vw, 35px);
  font-weight:400;
  line-height:1.5;
  letter-spacing:.23em;
  text-transform:uppercase;
  text-align:center;
}
.hero-method{
  display:flex;
  flex-direction:column;
  align-items:center;
  align-self:center;
  margin-top:clamp(28px,3vw,46px);
}
.hero-method-rule{
  display:none;
  width:46px;
  height:1px;
  background:#ac8679;
  margin-bottom:12px;
}
.hero-method-name{
  margin:0;
  color:#754f4d;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  font:400 clamp(30px,2.85vw,43px)/1.08 'Playfair Display',Georgia,serif;
  font-style:normal;
  letter-spacing:-.035em;
  padding:9px clamp(18px,1.6vw,26px) 11px;
  border:1px solid rgba(130,83,78,.7);
  border-radius:21px;
  background:rgba(255,250,247,.14);
}
.hero-content > p.hero-description{
  max-width:410px;
  margin:clamp(17px,1.8vw,25px) 0 25px;
  color:#5f514e;
  font-size:clamp(14px,1.1vw,16px);
  line-height:1.75;
  text-wrap:pretty;
}
.hero-content .hero-ctas{margin:clamp(25px,3vw,43px) 0 0;align-self:center}
/* A biblioteca começa diretamente após a foto, sem uma faixa intermediária */
.library-section{margin-top:clamp(28px,3.2vw,56px);border-top:1px solid #efe8e3}

@media(max-width:1080px) and (min-width:721px){
  .hero-content{
    width:65%;
    padding-left:clamp(32px,4.2vw,52px);
    padding-right:28px;
  }
  .hero-content .hero-name{font-size:clamp(34px,4.6vw,49px)}
  .hero-method-name{font-size:clamp(33px,3.9vw,43px)}
  .hero-content > p.hero-description{max-width:360px}
}
@media(max-width:720px){
  /* No celular e em tablets estreitos, foto e texto se empilham sem sobreposição. */
  .hero-panel{
    display:block;
    min-height:0;
    border-radius:10px;
  }
  .hero-photo{
    inset:0 0 auto 0;
    width:100%;
    height:clamp(335px,94vw,490px);
    object-position:center 28%;
    opacity:1;
    -webkit-mask-image:linear-gradient(to bottom,#000 0%,#000 56%,transparent 100%);
    mask-image:linear-gradient(to bottom,#000 0%,#000 56%,transparent 100%);
  }
  .hero-grain{
    background:linear-gradient(to bottom,transparent 0%,transparent 36%,rgba(234,225,217,.4) 57%,#eae1d9 76%);
  }
  .hero-content{
    width:100%;
    max-width:none;
    min-height:0;
    margin:0;
    padding:clamp(315px,81vw,444px) clamp(22px,5vw,38px) clamp(30px,6vw,48px);
  }
  .hero-content .hero-name{font-size:clamp(24px,7.4vw,50px); word-spacing: 6px;}
  .hero-profession{font-size: clamp(16px, 4.5vw, 22px);letter-spacing:.18em;margin:6px 0 0}
  .hero-method{margin-top:24px}
  .hero-method-rule{margin-bottom:9px}
  .hero-method-name{font-size:clamp(29px,6.2vw,38px);padding:8px 20px 10px;border-radius:18px}
  .hero-content .hero-ctas{margin-top:28px}
  .library-section{margin-top:26px}
}
@media(max-width:380px){
  .hero-content{padding-top:clamp(303px,83vw,330px);padding-right:18px;padding-left:18px}
  .hero-content .hero-name{font-size:clamp(24px,7.4vw,28px)}
  .hero-method-name{font-size:29px;padding:7px 17px 9px}
}


/* Vitrine fluida de materiais — faixa infinita com transparência nas bordas */
.material-carousel{
  width:100%;
  min-width:0;
  position:relative;
  margin-top:9px;
  padding-inline:clamp(48px,4vw,64px);
}
.material-viewport{
  position:relative;
  width:100%;
  /* Folga vertical para o card realmente sair da superfície sem ser recortado. */
  padding:44px 0 68px;
  overflow-x:auto;
  overflow-y:hidden;
  scrollbar-width:none;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior-x:contain;
  scroll-behavior:auto;
  cursor:grab;
  outline-offset:-4px;
  -webkit-mask-image:linear-gradient(to right, transparent 0%,#000 7%,#000 93%,transparent 100%);
  mask-image:linear-gradient(to right, transparent 0%,#000 7%,#000 93%,transparent 100%);
}
.material-viewport::-webkit-scrollbar{display:none}
.material-viewport.is-dragging{cursor:grabbing;user-select:none}
.material-viewport:focus-visible{outline:2px solid var(--rose-dark)}
.material-grid{
  display:flex;
  flex-wrap:nowrap;
  align-items:stretch;
  grid-template-columns:none;
  gap:24px;
  width:max-content;
  padding:30px 10px 58px;
  min-height:0;
}

.material-card{
  /* A própria capa A4 ocupa todo o card; a área de toque não se movimenta. */
  position:relative;
  display:block;
  flex:0 0 clamp(208px,18.2vw,292px);
  width:clamp(208px,18.2vw,292px);
  aspect-ratio:1001 / 1415;
  min-width:0;
  min-height:0;
  border:0;
  border-radius:12px;
  background:transparent;
  box-shadow:none;
  overflow:visible;
}
.material-card:hover,.material-card:focus-within,.material-card.is-hovered{
  z-index:5;
  transform:none;
  border-color:transparent;
  box-shadow:none;
}
.material-card::after{
  content:"";
  position:absolute;
  bottom:-26px;
  left:13%;
  right:13%;
  height:18px;
  z-index:-1;
  border-radius:50%;
  background:rgba(67,37,31,.38);
  filter:blur(19px);
  opacity:.22;
  transform:scale(.75);
  transition:opacity .48s ease,transform .48s ease;
  pointer-events:none;
}
.material-card:hover::after,.material-card.is-hovered::after,.material-card:focus-within::after{
  opacity:.9;
  transform:scale(1.25);
}
.material-card-open{
  display:block;
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  padding:0;
  border:0;
  border-radius:12px;
  overflow:hidden;
  background:#fff;
  color:inherit;
  text-align:left;
  cursor:pointer;
  transform:perspective(1100px) translate3d(0,0,0) scale(1) rotateX(0) rotateY(0);
  transform-origin:center 50%;
  box-shadow:0 16px 34px rgba(75,45,38,.12),0 3px 8px rgba(75,45,38,.035);
  backface-visibility:hidden;
  transition:transform .5s cubic-bezier(.18,1,.28,1),box-shadow .45s ease;
  will-change:transform;
}
.material-card:hover .material-card-open,
.material-card:focus-within .material-card-open,
.material-card.is-hovered .material-card-open{
  transform:perspective(1100px) translate3d(0,-23px,0) scale(1.045) rotateX(var(--rot-x,0deg)) rotateY(var(--rot-y,0deg));
  box-shadow:0 53px 72px -20px rgba(65,37,31,.31),0 26px 48px rgba(65,37,31,.14);
}
.material-cover{
  display:block;
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  margin:0;
  padding:0;
  border:0;
  border-radius:inherit;
  overflow:hidden;
  background:#fff;
}
.material-cover img{
  display:block;
  width:100%;
  height:100%;
  max-width:none;
  max-height:none;
  object-fit:contain;
  box-shadow:none;
  filter:none;
  background:#fff;
  transform:none;
  animation:none;
  transition:filter .45s ease;
}
.material-card:hover .material-cover img,
.material-card:focus-within .material-cover img,
.material-card.is-hovered .material-cover img{
  transform:none;
  filter:saturate(1.07) contrast(1.025);
}
.material-card-open::before{
  content:"";
  position:absolute;
  inset:0;
  z-index:2;
  pointer-events:none;
  opacity:0;
  background:radial-gradient(circle at var(--light-x,50%) var(--light-y,30%),rgba(255,255,255,.35),transparent 57%);
  transition:opacity .3s ease;
}
.material-card:hover .material-card-open::before,
.material-card.is-hovered .material-card-open::before,
.material-card:focus-within .material-card-open::before{opacity:.75}
.material-open-cue{
  position:absolute;
  z-index:3;
  right:12px;
  bottom:12px;
  display:grid;
  place-items:center;
  width:40px;
  height:40px;
  border:1px solid rgba(214,195,187,.75);
  border-radius:50%;
  background:rgba(255,253,250,.94);
  color:#80544d;
  font:500 21px/1 'DM Sans',Arial,sans-serif;
  box-shadow:0 6px 18px rgba(55,34,28,.11);
  opacity:0;
  transform:translateY(9px);
  transition:opacity .25s ease,transform .35s cubic-bezier(.18,1,.28,1);
  pointer-events:none;
}
.material-card:hover .material-open-cue,
.material-card.is-hovered .material-open-cue,
.material-card:focus-within .material-open-cue{
  opacity:1;
  transform:translateY(0);
}
.material-card-open:focus-visible{
  outline:3px solid #a57570;
  outline-offset:4px;
}
.material-card-open.is-loading{cursor:progress}
.material-card-open.is-loading::after{
  content:"Abrindo PDF...";
  position:absolute;
  inset:0;
  z-index:4;
  display:grid;
  place-items:center;
  background:rgba(255,252,249,.8);
  color:#80574f;
  font:700 13px 'DM Sans',sans-serif;
  letter-spacing:.06em;
}

.carousel-controls{
  position:absolute;
  z-index:7;
  inset:0;
  pointer-events:none;
}
.carousel-arrow,.carousel-toggle{
  display:grid;
  place-items:center;
  flex:0 0 auto;
  height:43px;
  width:43px;
  border:1px solid #e2d4cd;
  border-radius:50%;
  background:#fff;
  color:#805751;
  font:500 21px/1 'DM Sans',sans-serif;
  box-shadow:0 4px 13px rgba(77,53,46,.045);
  transition:transform .2s ease,background .2s ease,border-color .2s ease;
}
.carousel-arrow{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  pointer-events:auto;
}
#carouselPrev{left:2px}
#carouselNext{right:2px}
.results-tools{display:flex;align-items:center;gap:11px}
.results-tools .carousel-toggle{
  width:29px;
  height:29px;
  font-size:12px;
  font-weight:600;
  color:#8c6c65;
  background:#fffdfb;
  box-shadow:none;
}
.carousel-arrow:hover:not(:disabled),.carousel-toggle:hover:not(:disabled){
  background:#f4e8e2;
  border-color:#c9aea3;
}
.carousel-arrow:hover:not(:disabled){transform:translateY(calc(-50% - 2px))}
.results-tools .carousel-toggle:hover:not(:disabled){transform:translateY(-2px)}
.carousel-arrow:disabled{opacity:.35;cursor:default}
.modal-actions .modal-download{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:37px;
  width:auto;
  min-width:95px;
  padding:0 12px;
  border-radius:6px;
  border:1px solid #d9bdb3;
  background:#f5eae5;
  color:#83564f;
  font:700 12px 'DM Sans',sans-serif;
  white-space:nowrap;
}
.modal-actions .modal-download:hover{background:#ead5cd}
.modal-actions .modal-download:disabled{opacity:.5;cursor:wait}

@media(max-width:800px){
  .material-grid{grid-template-columns:none;gap:19px}
  .material-card{flex:0 0 clamp(205px,30vw,260px);width:clamp(205px,30vw,260px)}
}
@media(max-width:600px){
  .material-viewport{
    padding-top:30px;
    padding-bottom:38px;
    -webkit-mask-image:linear-gradient(to right,transparent 0%,#000 10%,#000 90%,transparent 100%);
    mask-image:linear-gradient(to right,transparent 0%,#000 10%,#000 90%,transparent 100%);
  }
  .material-grid{gap:16px;padding:22px 6px 44px}
  .material-card{flex:0 0 clamp(194px,61vw,255px);width:clamp(194px,61vw,255px);border-radius:10px}
  .material-card-open{border-radius:10px}
  /* Em telas de toque a seta sugere que a capa pode ser aberta. */
  .material-open-cue{width:34px;height:34px;right:10px;bottom:10px;font-size:18px;opacity:.9;transform:none}
  .material-carousel{padding-inline:43px}
  .carousel-arrow{width:38px;height:38px;font-size:19px}
  #carouselPrev{left:0}
  #carouselNext{right:0}
  .results-tools{gap:6px}
  .modal-actions .modal-download{min-width:75px;height:34px;font-size:11px;padding:0 7px}
  .modal-topbar{flex-wrap:wrap;gap:10px}
  .modal-document{flex:1 1 100%}
  .modal-document h3{max-width:100%}
  .modal-actions{flex:1 1 100%;justify-content:space-between}
  .modal-actions>a{max-width:none}
}
@media(max-width:380px){
  .material-card{flex-basis:clamp(182px,61vw,226px);width:clamp(182px,61vw,226px)}
  .modal-actions{gap:5px}
  .modal-actions .modal-download{min-width:66px;font-size:10px}
}

@media(hover:none){
  .material-card:hover:not(.is-hovered):not(:focus-within) .material-card-open{
    transform:none;
    box-shadow:0 16px 34px rgba(75,45,38,.12),0 3px 8px rgba(75,45,38,.035);
  }
  .material-card:hover:not(.is-hovered):not(:focus-within) .material-cover img{filter:none}
  .material-card:hover:not(.is-hovered):not(:focus-within) .material-open-cue{opacity:.9;transform:none}
}
@media(prefers-reduced-motion:reduce){
  .material-card-open,.material-card-open::before,.material-card::after,.material-cover img,.material-open-cue,.carousel-arrow,.carousel-toggle{transition:none!important}
  .material-card:hover .material-card-open,
  .material-card:focus-within .material-card-open,
  .material-card.is-hovered .material-card-open{
    transform:translateY(-10px) scale(1.02);
    box-shadow:0 37px 55px rgba(65,37,31,.23),0 12px 25px rgba(65,37,31,.10);
  }
}

/* Fotografia de teste com retorno automático para a imagem original. */
.hero-photo-refined{
  width:100%;
  object-position:center center;
  -webkit-mask-image:linear-gradient(to right,transparent 0%,rgba(0,0,0,.18) 23%,#000 53%);
  mask-image:linear-gradient(to right,transparent 0%,rgba(0,0,0,.18) 23%,#000 53%);
}
.hero-panel:has(.hero-photo-refined){background:#eadbd0}
@media(max-width:720px){
  .hero-photo-refined{
    width:100%;
    height:clamp(335px,94vw,490px);
    object-position:66% center;
    -webkit-mask-image:linear-gradient(to bottom,#000 0%,#000 56%,transparent 100%);
    mask-image:linear-gradient(to bottom,#000 0%,#000 56%,transparent 100%);
  }
}

@media (min-width: 721px) {
  .hero-photo-refined {
    width: 55%;
    object-position: 70% center;
  }
}