/* Tema claro/escuro do site (www, contas, área do cliente).
 *
 * O tema claro é o visual original do site; este arquivo só acrescenta:
 *  1) o botão de alternância (.cd-theme-toggle), e
 *  2) o tema escuro, ativado por html[data-theme="dark"] (ver templates/partials/theme_init.html).
 *
 * Paleta escura: fundo #060c29 (azul da marca), superfícies #0d1435 / #131a40, bordas #262f65,
 * texto #cfd6f3 e títulos brancos. O laranja da marca (#ff7a00) não muda.
 * Páginas com CSS próprio (login, cadastro, fatura...) têm suas classes ajustadas na seção 4. */

/* ===== 1. Botão de alternância ===== */

.cd-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin: 0;
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  line-height: 1;
  cursor: pointer;
}
.cd-theme-toggle:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; border-radius: 6px; }
.cd-theme-toggle .cd-theme-toggle__sol,
html[data-theme="dark"] .cd-theme-toggle .cd-theme-toggle__lua { display: none; }
html[data-theme="dark"] .cd-theme-toggle .cd-theme-toggle__sol { display: inline-block; }

/* No topbar (navbar laranja): ícone sempre visível; o texto só no menu recolhido (mobile). */
.navbar .cd-theme-toggle { color: var(--bs-white, #fff); font-size: 18px; padding: 10px; }
.navbar .cd-theme-toggle:hover { color: #000; }
.navbar .cd-theme-toggle .cd-theme-toggle__rotulo { display: none; font-size: 1rem; }
@media (max-width: 991.98px) {
  .navbar .cd-theme-toggle { width: 100%; justify-content: flex-start; }
  .navbar .cd-theme-toggle .cd-theme-toggle__rotulo { display: inline; }
}

/* ===== 2. Tema escuro: base ===== */

html[data-theme="dark"] body {
  background-color: #060c29;
  color: #cfd6f3;
}
html[data-theme="dark"] h1, html[data-theme="dark"] h2, html[data-theme="dark"] h3,
html[data-theme="dark"] h4, html[data-theme="dark"] h5, html[data-theme="dark"] h6,
html[data-theme="dark"] .h1, html[data-theme="dark"] .h2, html[data-theme="dark"] .h3,
html[data-theme="dark"] .h4, html[data-theme="dark"] .h5, html[data-theme="dark"] .h6 { color: #fff; }
html[data-theme="dark"] a:not([class]) { color: #9fb0ff; }
html[data-theme="dark"] a:not([class]):hover { color: #c5ceff; }
html[data-theme="dark"] hr { color: #262f65; }
html[data-theme="dark"] ::placeholder { color: #7e89b8; opacity: 1; }
html[data-theme="dark"] ::selection { background: rgba(255, 122, 0, .35); color: #fff; }

html[data-theme="dark"] .bg-light,
html[data-theme="dark"] .bg-white { background-color: #0d1435 !important; }
html[data-theme="dark"] .bg-dark { background-color: #040720 !important; }
html[data-theme="dark"] .text-dark,
html[data-theme="dark"] .link-dark { color: #e6eaff !important; }
html[data-theme="dark"] .text-muted { color: #9aa4cf !important; }
html[data-theme="dark"] .text-primary { color: #8ea2ff !important; }
html[data-theme="dark"] .cd-text-color-pri { color: #b5c0ff !important; }
/* Sobre o laranja (marca no topbar, faixa de números) o azul institucional continua nos dois temas. */
html[data-theme="dark"] .navbar-brand .cd-text-color-pri,
html[data-theme="dark"] .cd-background-color .cd-text-color-pri { color: #262f65 !important; }
html[data-theme="dark"] .cd-background-color .text-primary { color: #1842b6 !important; }
html[data-theme="dark"] a.h7 { color: #9fb0ff; }
html[data-theme="dark"] .border,
html[data-theme="dark"] .border-top,
html[data-theme="dark"] .border-bottom,
html[data-theme="dark"] .border-start,
html[data-theme="dark"] .border-end { border-color: #262f65 !important; }
html[data-theme="dark"] .shadow,
html[data-theme="dark"] .shadow-sm,
html[data-theme="dark"] .shadow-lg { box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .55) !important; }

/* ===== 3. Tema escuro: componentes do Bootstrap ===== */

html[data-theme="dark"] .card {
  background-color: #0d1435;
  border-color: rgba(150, 168, 240, .2);
  color: #cfd6f3;
}
html[data-theme="dark"] .card-header,
html[data-theme="dark"] .card-footer {
  background-color: rgba(255, 255, 255, .04);
  border-color: rgba(150, 168, 240, .2);
}
html[data-theme="dark"] .list-group-item {
  background-color: #0d1435;
  border-color: #262f65;
  color: #cfd6f3;
}
html[data-theme="dark"] .dropdown-menu {
  background-color: #0d1435;
  border-color: #262f65;
  color: #cfd6f3;
}
html[data-theme="dark"] .dropdown-item { color: #cfd6f3; }
html[data-theme="dark"] .dropdown-item:hover,
html[data-theme="dark"] .dropdown-item:focus { background: #131a40; color: #fff; }
html[data-theme="dark"] .dropdown-divider { border-top-color: #262f65; }
html[data-theme="dark"] .modal-content { background-color: #0d1435; color: #cfd6f3; border-color: #262f65; }
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer { border-color: #262f65; }
html[data-theme="dark"] .btn-close { filter: invert(1) grayscale(1) brightness(2); }

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .input-group-text {
  background-color: #0a1030;
  border-color: #262f65;
  color: #e6eaff;
}
html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus {
  background-color: #0a1030;
  border-color: #ff7a00;
  color: #fff;
  box-shadow: 0 0 0 .2rem rgba(255, 122, 0, .25);
}
html[data-theme="dark"] .form-control:disabled,
html[data-theme="dark"] .form-control[readonly] { background-color: #0d1435; color: #9aa4cf; }
html[data-theme="dark"] .form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23cfd6f3' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
}
html[data-theme="dark"] .form-check-input { background-color: #0a1030; border-color: #3a4578; }
html[data-theme="dark"] .form-check-input:checked { background-color: #ff7a00; border-color: #ff7a00; }

html[data-theme="dark"] .table {
  color: #cfd6f3;
  border-color: #262f65;
  --bs-table-striped-color: #cfd6f3;
  --bs-table-striped-bg: rgba(255, 255, 255, .04);
  --bs-table-hover-color: #fff;
  --bs-table-hover-bg: rgba(255, 255, 255, .06);
  --bs-table-active-color: #fff;
  --bs-table-active-bg: rgba(255, 255, 255, .08);
}
html[data-theme="dark"] .table > :not(caption) > * > * { border-bottom-color: #262f65; }
html[data-theme="dark"] .table-light {
  --bs-table-bg: #131a40;
  --bs-table-striped-bg: #131a40;
  color: #e6eaff;
  border-color: #262f65;
}

html[data-theme="dark"] .btn-light { background-color: #131a40; border-color: #262f65; color: #e6eaff; }
html[data-theme="dark"] .btn-light:hover { background-color: #1a2250; border-color: #3a4578; color: #fff; }
html[data-theme="dark"] .btn-outline-dark { color: #e6eaff; border-color: #e6eaff; }
html[data-theme="dark"] .btn-outline-dark:hover { background-color: #e6eaff; color: #060c29; }

html[data-theme="dark"] .alert-success { background-color: rgba(25, 135, 84, .18); border-color: rgba(25, 135, 84, .45); color: #7fdcae; }
html[data-theme="dark"] .alert-danger,
html[data-theme="dark"] .alert-error { background-color: rgba(220, 53, 69, .18); border-color: rgba(220, 53, 69, .45); color: #f1aeb5; }
html[data-theme="dark"] .alert-warning { background-color: rgba(255, 193, 7, .14); border-color: rgba(255, 193, 7, .4); color: #ffda6a; }
html[data-theme="dark"] .alert-info { background-color: rgba(13, 202, 240, .14); border-color: rgba(13, 202, 240, .4); color: #6edff6; }
html[data-theme="dark"] .alert-secondary,
html[data-theme="dark"] .alert-light { background-color: rgba(255, 255, 255, .06); border-color: #262f65; color: #cfd6f3; }

html[data-theme="dark"] .breadcrumb-item.active { color: #9aa4cf; }
html[data-theme="dark"] .page-link { background-color: #0d1435; border-color: #262f65; color: #8ea2ff; }
html[data-theme="dark"] .page-link:hover { background-color: #131a40; color: #c5ceff; }
html[data-theme="dark"] .page-item.disabled .page-link { background-color: #0a1030; border-color: #262f65; color: #6b76a8; }

/* ===== 4. Tema escuro: componentes do site ===== */

/* Topbar/navbar: o menu suspenso do site tem estilo próprio. */
html[data-theme="dark"] .navbar .dropdown-menu { background-color: #0d1435; }
html[data-theme="dark"] .navbar .dropdown-item { color: #cfd6f3; }
html[data-theme="dark"] .navbar .dropdown-item:hover { color: #fff; }

html[data-theme="dark"] .team-item { background: rgba(13, 20, 53, .85); }
html[data-theme="dark"] .testimonial-item { background: #0d1435; }
html[data-theme="dark"] .testimonial-carousel .owl-item.center .testimonial-item {
  background: #131a40 !important;
  box-shadow: 0 0 30px rgba(0, 0, 0, .55);
}
html[data-theme="dark"] .testimonial-carousel .owl-dot { background: #262f65; }
html[data-theme="dark"] .contact-form,
html[data-theme="dark"] .contact-map { background: rgba(255, 122, 0, .12); }
html[data-theme="dark"] .services .services-item { box-shadow: 0 0 60px rgba(0, 0, 0, .45); }

/* Páginas de conta (login, recuperar senha, cadastro): cartões e blocos brancos. */
html[data-theme="dark"] .login-card,
html[data-theme="dark"] .reset-card,
html[data-theme="dark"] .done-card,
html[data-theme="dark"] .cadastro-card,
html[data-theme="dark"] .success-card { background: #0d1435; color: #cfd6f3; box-shadow: 0 15px 45px rgba(0, 0, 0, .5); }
html[data-theme="dark"] .login-card .form-label,
html[data-theme="dark"] .reset-card .form-label,
html[data-theme="dark"] .cadastro-card .form-label { color: #e6eaff; }
html[data-theme="dark"] .section-title,
html[data-theme="dark"] .step-content h5,
html[data-theme="dark"] .feature-box h5,
html[data-theme="dark"] .success-message h4,
html[data-theme="dark"] .alert-box strong { color: #fff; }
html[data-theme="dark"] .step-content p,
html[data-theme="dark"] .feature-box p,
html[data-theme="dark"] .success-message p,
html[data-theme="dark"] .info-list li { color: #b4bde0; }
html[data-theme="dark"] .info-list,
html[data-theme="dark"] .step-item,
html[data-theme="dark"] .feature-box,
html[data-theme="dark"] .register-link,
html[data-theme="dark"] .email-box,
html[data-theme="dark"] .contact-box { background: #131a40; }
html[data-theme="dark"] .feature-box:hover { background: #1a2250; }
html[data-theme="dark"] .btn-secondary-link,
html[data-theme="dark"] .btn-back { background: #131a40; border-color: #262f65; color: #e6eaff; }
html[data-theme="dark"] .btn-secondary-link:hover,
html[data-theme="dark"] .btn-back:hover { background: #1a2250; border-color: #ff7a00; color: #fff; }
html[data-theme="dark"] .divider span { background: #0d1435; color: #9aa4cf; }
html[data-theme="dark"] .divider::before,
html[data-theme="dark"] .divider::after { border-bottom-color: #262f65; }
html[data-theme="dark"] .register-link a:hover { color: #ffb15c; }

/* Fatura (portal de pagamento). O QR Code continua branco: precisa de contraste para ser lido. */
html[data-theme="dark"] .payment-area,
html[data-theme="dark"] .info-item,
html[data-theme="dark"] .pix-copia-cola { background: #131a40; color: #cfd6f3; }
html[data-theme="dark"] .pix-copia-cola:hover { background: #1a2250; }
html[data-theme="dark"] .info-item strong { color: #fff; }
html[data-theme="dark"] .item-table { background: #0d1435; color: #cfd6f3; }
html[data-theme="dark"] .item-table th { background: #131a40; color: #e6eaff; }

/* Banner e modal de cookies. */
html[data-theme="dark"] .cookie-consent-banner { background: #0d1435; border-top: 1px solid #262f65; box-shadow: 0 -4px 24px rgba(0, 0, 0, .5); }
html[data-theme="dark"] .cookie-message strong,
html[data-theme="dark"] .cookie-modal-header h3,
html[data-theme="dark"] .cookie-category-header strong { color: #fff; }
html[data-theme="dark"] .cookie-message p,
html[data-theme="dark"] .cookie-modal-intro,
html[data-theme="dark"] .cookie-category-desc { color: #b4bde0; }
html[data-theme="dark"] .cookie-message a { color: #8ea2ff; }
html[data-theme="dark"] .cookie-message a:hover { color: #c5ceff; }
html[data-theme="dark"] .cookie-modal-content { background: #0d1435; color: #cfd6f3; }
html[data-theme="dark"] .cookie-modal-close { color: #9aa4cf; }
html[data-theme="dark"] .cookie-modal-close:hover { color: #fff; }
html[data-theme="dark"] .cookie-category { background: #131a40; }
