/**
 * Tema energia solar — COOPERE BR mobile
 */

.solar-app {
  --solar-gold: #f5b800;
  --solar-sky: #0d3d2e;
}

.solar-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 120% 80% at 85% -10%, rgba(245, 184, 0, .18) 0%, transparent 55%),
    radial-gradient(ellipse 90% 60% at 10% 100%, rgba(0, 177, 82, .12) 0%, transparent 50%),
    linear-gradient(165deg, #071a12 0%, #0d2b1f 35%, #0a0f14 100%);
}

.solar-app .mobile-shell {
  position: relative;
  z-index: 1;
}

.solar-app .slides-wrap {
  background: transparent;
}

.solar-app .story-header__logo {
  filter: drop-shadow(0 0 8px rgba(0, 177, 82, .45));
}

.solar-app .story-progress__seg.active .story-progress__fill {
  background: linear-gradient(90deg, #00b152, #7dd956);
}

.solar-app .fab-nav {
  background: linear-gradient(135deg, #00b152, #007c39);
  box-shadow: 0 4px 20px rgba(0, 177, 82, .45);
}

.solar-app .cover h1 {
  background: linear-gradient(135deg, #007c39 0%, #00b152 50%, #f5b800 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.solar-app .cover-chip {
  border-color: rgba(0, 177, 82, .25);
  background: linear-gradient(135deg, rgba(0, 177, 82, .08), rgba(245, 184, 0, .06));
}

.solar-app .cover-chip .ms {
  color: #f5b800;
}

/* Infográfico */
.slide-panel--infographic {
  padding: .75rem .65rem 1rem;
}

.infographic-wrap {
  margin: .5rem 0;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid rgba(0, 177, 82, .2);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .12);
  background: #f3f5f8;
  cursor: zoom-in;
  position: relative;
  z-index: 40;
  min-height: 120px;
}

.infographic-wrap.is-loading::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #eef2f5 0%, #f8fafc 50%, #eef2f5 100%);
  background-size: 200% 100%;
  animation: imgShimmer 1.2s ease-in-out infinite;
  z-index: 1;
}

@keyframes imgShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.infographic-wrap.is-loaded::before {
  display: none;
}

.infographic-wrap::after {
  content: "ampliar";
  position: absolute;
  right: .5rem;
  bottom: .5rem;
  font-size: .62rem;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, .55);
  padding: .2rem .45rem;
  border-radius: 6px;
  pointer-events: none;
}

.infographic-img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: top;
  cursor: zoom-in;
  pointer-events: auto;
  opacity: 0;
  transition: opacity .2s ease;
  position: relative;
  z-index: 2;
}

.infographic-wrap.is-loaded .infographic-img {
  opacity: 1;
}

.infographic-actions {
  display: flex;
  justify-content: center;
  margin: .65rem 0 .25rem;
}

.img-dl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .65rem 1.1rem;
  border-radius: 12px;
  font: inherit;
  font-size: .82rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  background: #fff;
  color: var(--green-d);
  border: 2px solid rgba(0, 177, 82, .35);
  transition: transform .15s ease, box-shadow .15s ease;
}

.img-dl-btn:active {
  transform: scale(.98);
}

.img-dl-btn:hover {
  box-shadow: 0 4px 14px rgba(0, 177, 82, .2);
}

/* Lightbox */
.img-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, .92);
  display: flex;
  flex-direction: column;
  padding: 0;
}

.img-lightbox[hidden] {
  display: none !important;
}

.img-lightbox__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: calc(env(safe-area-inset-top, 0px) + .5rem) .75rem .5rem;
  background: rgba(15, 61, 46, .95);
  color: #fff;
  flex-shrink: 0;
}

.img-lightbox__title {
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.img-lightbox__actions {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-shrink: 0;
}

.img-lightbox__dl {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .35rem .65rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, .15);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  text-decoration: none;
}

.img-lightbox img {
  flex: 1;
  max-width: 100%;
  max-height: 100%;
  margin: 0 auto;
  object-fit: contain;
  cursor: zoom-out;
  transform-origin: center center;
  transition: transform .2s ease;
  padding: .5rem;
}

.img-lightbox img.is-zoomed {
  transform: scale(1.75);
  cursor: zoom-out;
}

.img-lightbox__close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .15);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

/* Slide PDF */
.slide-panel--pdf {
  text-align: center;
}

.pdf-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.25rem auto;
  max-width: 360px;
  padding: 1.1rem 1.2rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  text-align: left;
}

.pdf-card__icon {
  font-size: 2.75rem;
  color: #dc2626;
  flex-shrink: 0;
}

.pdf-card__meta {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.pdf-card__meta strong {
  font-size: .92rem;
  color: var(--text);
}

.pdf-card__meta span {
  font-size: .75rem;
  color: var(--muted);
}

.pdf-actions {
  display: flex;
  flex-direction: column;
  gap: .65rem;
  max-width: 320px;
  margin: 0 auto;
}

.pdf-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  width: 100%;
  padding: .85rem 1rem;
  border-radius: 12px;
  font: inherit;
  font-size: .9rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: transform .15s ease, box-shadow .15s ease;
}

.pdf-btn:active {
  transform: scale(.98);
}

.pdf-btn--view {
  background: var(--green);
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 177, 82, .35);
}

.pdf-btn--download {
  background: #fff;
  color: var(--green-d);
  border: 2px solid rgba(0, 177, 82, .35);
}

.pdf-btn--download:hover,
.pdf-btn--view:hover {
  box-shadow: 0 6px 20px rgba(0, 177, 82, .25);
}

body.is-web .pdf-actions {
  flex-direction: row;
  max-width: 420px;
}

body.is-web .pdf-btn {
  flex: 1;
}

.pdf-share {
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.pdf-share__lbl {
  font-size: .72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: .55rem;
}

.pdf-share__actions {
  display: flex;
  flex-direction: column;
  gap: .65rem;
}

.pdf-btn--external {
  background: #1e4d8f;
  color: #fff;
  box-shadow: 0 4px 16px rgba(30, 77, 143, .3);
}

.pdf-btn--copy {
  background: #f3f4f6;
  color: var(--text);
  border: 1px solid var(--border);
}

.pdf-btn--copy.is-copied {
  background: var(--green-l);
  color: var(--green-d);
  border-color: rgba(0, 177, 82, .35);
}

body.is-web .pdf-share__actions {
  flex-direction: row;
}

body.is-web .pdf-share__actions .pdf-btn {
  flex: 1;
}

/* Lightbox PDF */
.pdf-lightbox {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: #1c2733;
  display: flex;
  flex-direction: column;
}

.pdf-lightbox[hidden] {
  display: none !important;
}

.pdf-lightbox__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: calc(env(safe-area-inset-top, 0px) + .5rem) .75rem .5rem;
  background: #0f3d2e;
  color: #fff;
  flex-shrink: 0;
}

.pdf-lightbox__title {
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdf-lightbox__actions {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-shrink: 0;
}

.pdf-lightbox__dl {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .35rem .65rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, .15);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  text-decoration: none;
}

.pdf-lightbox__close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .15);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.pdf-lightbox__frame {
  flex: 1;
  width: 100%;
  border: none;
  background: #525659;
}

.pdf-lightbox__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
}

.pdf-lightbox__fallback {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem 1.25rem;
  text-align: center;
  color: #fff;
}

.pdf-lightbox__fallback[hidden] {
  display: none !important;
}

.pdf-lightbox__fallback-icon {
  font-size: 3.5rem;
  color: #f5b800;
}

.pdf-lightbox__fallback p {
  font-size: .9rem;
  color: rgba(255, 255, 255, .85);
  max-width: 28ch;
}

.pdf-lightbox__fallback .pdf-btn {
  max-width: 280px;
}

/* Login */
body:not(.is-authenticated) .mobile-shell {
  visibility: hidden;
  pointer-events: none;
}

.login-gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(env(safe-area-inset-top, 0px) + 1rem) 1.25rem calc(env(safe-area-inset-bottom, 0px) + 1rem);
}

.login-gate[hidden] {
  display: none !important;
}

.login-gate .solar-bg {
  z-index: 0;
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(100%, 360px);
  background: rgba(255, 255, 255, .98);
  border-radius: 22px;
  padding: 1.5rem 1.25rem 1.35rem;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .35);
  text-align: center;
}

.login-card__logo {
  width: 72px;
  height: auto;
  border-radius: 12px;
  margin-bottom: .65rem;
}

.login-card__title {
  font-size: 1.45rem;
  font-weight: 800;
  margin: 0 0 .2rem;
  background: linear-gradient(135deg, #007c39, #00b152);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.login-card__sub {
  font-size: .78rem;
  color: #6b7280;
  margin: 0 0 1.1rem;
}

.login-label {
  display: block;
  text-align: left;
  font-size: .72rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: .35rem;
}

.login-field {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: #f3f4f6;
  border: 2px solid #e5e7eb;
  border-radius: 14px;
  padding: .55rem .75rem;
  margin-bottom: .65rem;
  transition: border-color .2s, box-shadow .2s;
}

.login-field:focus-within {
  border-color: #00b152;
  box-shadow: 0 0 0 3px rgba(0, 177, 82, .15);
  background: #fff;
}

.login-field--error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .12) !important;
}

.login-field--ok {
  border-color: #00b152 !important;
  box-shadow: 0 0 0 3px rgba(0, 177, 82, .18) !important;
}

.login-field__icon {
  color: #00b152;
  font-size: 1.25rem;
}

.login-input {
  flex: 1;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: #111827;
  outline: none;
  min-width: 0;
}

.login-input::placeholder {
  color: #9ca3af;
  font-weight: 500;
}

.login-error {
  font-size: .78rem;
  color: #dc2626;
  margin: 0 0 .5rem;
  text-align: left;
}

.login-greeting {
  font-size: .95rem;
  font-weight: 700;
  color: #007c39;
  margin: 0 0 .65rem;
  text-align: center;
}

.login-btn {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: .85rem 1rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #00b152, #007c39);
  box-shadow: 0 4px 16px rgba(0, 177, 82, .35);
  cursor: pointer;
}

.login-btn:active {
  transform: scale(.98);
}

.login-btn:disabled {
  opacity: .7;
  cursor: default;
}

.login-foot {
  font-size: .65rem;
  color: #9ca3af;
  margin: .85rem 0 0;
}

.login-web-hint {
  font-size: .68rem;
  color: #6b7280;
  margin: .5rem 0 0;
}

body.is-web .login-card {
  width: min(100%, 420px);
}

body.is-web .login-input {
  font-size: 1.25rem;
  letter-spacing: .04em;
}

body.is-web .story-tap {
  pointer-events: auto;
  cursor: pointer;
}

body.is-web .story-tap--prev {
  width: 14%;
}

body.is-web .story-tap--next {
  width: 14%;
}

body.is-web .story-tap--prev:hover,
body.is-web .story-tap--next:hover {
  background: rgba(255, 255, 255, .04);
}

/* Setas visíveis — somente desktop com mouse (não touch/mobile) */
.story-nav {
  display: none !important;
}

body.is-web:not(.is-touch) .story-nav {
  display: flex;
  position: absolute;
  top: 50%;
  z-index: 40;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: var(--green-d);
  box-shadow: 0 4px 20px rgba(0, 0, 0, .25);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: transform .2s ease, background .2s ease, opacity .2s ease;
}

body.is-web:not(.is-touch) .story-nav[hidden] {
  display: none !important;
}

.story-nav .ms {
  font-size: 1.75rem;
}

.story-nav:hover:not(:disabled) {
  background: #fff;
  transform: translateY(-50%) scale(1.06);
}

.story-nav:active:not(:disabled) {
  transform: translateY(-50%) scale(.96);
}

.story-nav:disabled {
  opacity: .35;
  cursor: default;
  pointer-events: none;
}

.story-nav--prev {
  left: max(.75rem, env(safe-area-inset-left));
}

.story-nav--next {
  right: max(.75rem, env(safe-area-inset-right));
}

body.is-web.lightbox-open .story-tap,
body.is-web.sheet-open .story-nav,
body.is-web.lightbox-open .story-nav,
body.is-web.pdf-lightbox-open .story-nav {
  pointer-events: none;
  opacity: 0;
}

/* Navegador desktop — 100% da janela */
body.is-web {
  height: 100vh;
  overflow: hidden;
}

body.is-web .mobile-shell {
  width: 100%;
  max-width: none;
  height: 100vh;
  margin: 0;
  box-shadow: none;
}

body.is-web .slides-wrap {
  width: 100%;
  border-radius: 0;
}

body.is-web .slide {
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
}

body.is-web .slide-panel {
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
}

body.is-web .slide-panel--infographic {
  max-width: min(1100px, 92vw);
}

body.is-web .infographic-wrap {
  max-height: calc(100vh - 14rem);
}

body.is-web .infographic-img {
  max-height: calc(100vh - 14rem);
  width: auto;
  max-width: 100%;
  margin: 0 auto;
  object-fit: contain;
}

body.is-web .story-chrome {
  padding-left: max(.65rem, env(safe-area-inset-left));
  padding-right: max(.65rem, env(safe-area-inset-right));
}

body.is-web .story-header__title {
  font-size: .85rem;
}

body.is-web .story-header__user {
  max-width: none;
  flex-shrink: 0;
}

body.is-web .fab-nav {
  right: max(1rem, env(safe-area-inset-right));
}

body.is-web .mobile-link-desktop {
  left: max(1rem, env(safe-area-inset-left));
}

/* Usuário logado no header */
.story-header__user {
  max-width: 38%;
  padding: .2rem .45rem;
  border-radius: 999px;
  background: rgba(0, 177, 82, .25);
  border: 1px solid rgba(255, 255, 255, .35);
  color: #fff;
  font-size: .62rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: auto;
}

.story-header__title {
  min-width: 0;
}

/* Slide 6 — blocos por seção */
.slide-section {
  margin-top: .85rem;
  padding: .75rem .85rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fafbfc;
}

.slide-section__head {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-bottom: .5rem;
  flex-wrap: wrap;
}

.slide-section__head .ms {
  font-size: 1.2rem;
  color: var(--green);
}

.slide-section__head h3 {
  flex: 1;
  font-size: .88rem;
  font-weight: 800;
  color: var(--text);
  margin: 0;
}

.slide-section__badge {
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .15rem .45rem;
  border-radius: 999px;
  background: rgba(0, 177, 82, .12);
  color: var(--green-d);
}

.slide-section__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.slide-section__list li {
  font-size: .78rem;
  line-height: 1.45;
  color: var(--muted);
  padding: .25rem 0 .25rem .85rem;
  position: relative;
}

.slide-section__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .55rem;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
}

.slide-section--cb2 {
  border-color: rgba(0, 177, 82, .25);
  background: var(--green-l);
}

.slide-section--usina {
  border-color: rgba(30, 77, 143, .2);
  background: #eff6ff;
}

.slide-section--usina .slide-section__head .ms {
  color: var(--blue);
}

.slide-section--usina .slide-section__badge {
  background: rgba(30, 77, 143, .12);
  color: var(--blue);
}

.slide-section--exfishes {
  border-color: rgba(220, 38, 38, .2);
  background: #fef2f2;
}

.slide-section--exfishes .slide-section__head .ms {
  color: #dc2626;
}

.slide-section--exfishes .slide-section__badge {
  background: rgba(220, 38, 38, .1);
  color: #b91c1c;
}

.slide-section--sinergia {
  border-color: rgba(180, 83, 9, .2);
  background: #fffbeb;
}

.slide-section--sinergia .slide-section__head .ms {
  color: #b45309;
}

.slide-section--sinergia .slide-section__badge {
  background: rgba(180, 83, 9, .12);
  color: #92400e;
}

.stat-pills--compact {
  margin-top: .5rem;
}

.stat-pills--compact .stat-pill {
  padding: .4rem .35rem;
}

.stat-pills--compact .stat-pill__v {
  font-size: 1rem;
}

.stat-pills--compact .stat-pill__l {
  font-size: .58rem;
}

/* Total devido — slide inadimplência */
.debt-total {
  text-align: center;
  margin: .75rem 0 1rem;
  padding: 1rem 1.1rem;
  border-radius: 16px;
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border: 1px solid rgba(220, 38, 38, .25);
}

.debt-total__lbl {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #991b1b;
}

.debt-total__val {
  font-size: clamp(1.85rem, 6vw, 2.75rem);
  font-weight: 800;
  color: #dc2626;
  line-height: 1.15;
  margin: .2rem 0;
  letter-spacing: -.02em;
}

.debt-total__sub {
  font-size: .75rem;
  color: #7f1d1d;
  font-weight: 600;
}

/* Encerramento — logo grande */
.cover--closing {
  gap: 1rem;
}

.cover-logos--hero {
  width: min(92%, 420px);
  padding: 1.25rem 1.5rem;
  justify-content: center;
  background: #fff;
}

.cover-logos--hero img {
  height: auto;
  width: 100%;
  max-height: min(42vh, 280px);
  object-fit: contain;
  padding: 0;
  border: none;
  border-radius: 12px;
  background: transparent;
}

body.is-web .cover-logos--hero {
  width: min(70%, 520px);
}

body.is-web .cover-logos--hero img {
  max-height: min(48vh, 340px);
}
