/* Glass cards */
.glass-card {
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}

.glass-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

[data-theme="light"] .glass-card,
body.citizen-theme .glass-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(96, 96, 98, 0.1);
  color: #2a2a2c;
  box-shadow: 0 4px 24px rgba(96, 96, 98, 0.08);
}

[data-theme="light"] .btn-ghost,
body.citizen-theme .btn-ghost {
  background: #fff;
  border-color: rgba(96, 96, 98, 0.14);
  color: #606062;
}

[data-theme="light"] .field input,
[data-theme="light"] .field select,
body.citizen-theme .field input,
body.citizen-theme .field select {
  background: #fff;
  border-color: #d4d4d6;
  color: #2a2a2c;
}

.toast-container {
  position: fixed;
  bottom: calc(var(--nav-height, 72px) + 16px + var(--safe-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(420px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: rgba(26, 28, 31, 0.94);
  backdrop-filter: blur(16px);
  color: #f8f7f5;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
  animation: toast-in var(--dur-normal) var(--ease-out);
}

.toast--success { border-color: rgba(61, 214, 140, 0.45); }
.toast--error { border-color: rgba(239, 83, 80, 0.5); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
  transition: all var(--dur-fast) var(--ease-out);
}

.btn-primary {
  background: linear-gradient(135deg, var(--eco-orange) 0%, #e85a1a 100%);
  color: #fff;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-glow);
}

.btn-primary:active { transform: scale(0.98); }

.btn-ghost {
  background: var(--bg-glass-light);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-primary);
}

.btn-ghost:hover { background: rgba(255,255,255,0.1); }

.btn-block { width: 100%; }

/* Inputs */
.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.field input,
.field select {
  width: 100%;
  padding: 16px 18px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}

.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Impact metrics */
.impact-ring {
  position: relative;
  width: 120px;
  height: 120px;
}

.impact-ring svg {
  transform: rotate(-90deg);
}

.impact-ring__value {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
}

.impact-metric {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-glass-light);
}

.impact-metric__icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.impact-metric__icon--water { background: rgba(79, 195, 247, 0.15); color: var(--water); }
.impact-metric__icon--co2 { background: rgba(129, 199, 132, 0.15); color: var(--co2); }
.impact-metric__icon--energy { background: rgba(255, 183, 77, 0.15); color: var(--energy); }
.impact-metric__icon--trees { background: rgba(102, 187, 106, 0.15); color: var(--trees); }

/* Bottom nav — citizen */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(480px, 100%);
  padding: 12px 20px calc(12px + var(--safe-bottom));
  background: var(--bg-glass);
  backdrop-filter: blur(24px);
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  justify-content: space-around;
  z-index: 100;
}

.bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: color var(--dur-fast);
  border-radius: var(--radius-pill);
}

.bottom-nav__item.active,
.bottom-nav__item:hover {
  color: var(--accent);
}

.bottom-nav__item.active {
  background: var(--accent-soft);
}

/* Operator sidebar */
.op-sidebar {
  width: 260px;
  min-height: 100dvh;
  background: var(--bg-panel);
  border-right: 1px solid rgba(255,255,255,0.05);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.op-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  transition: all var(--dur-fast);
}

.op-nav-item:hover,
.op-nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
}

/* Queue pills */
.queue-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
}

.queue-pill--queued { background: rgba(255,183,77,0.15); color: #ffb74d; }
.queue-pill--processing { background: rgba(79,195,247,0.15); color: #4fc3f7; }
.queue-pill--completed { background: rgba(61,214,140,0.15); color: var(--success); }

/* Loader */
.loader {
  width: 32px;
  height: 32px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.offline-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255, 183, 77, 0.15);
  color: #ffb74d;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
}

.offline-badge.online {
  background: rgba(61, 214, 140, 0.15);
  color: var(--success);
}

/* Modal overlay (cidadão QR, operador cadastro expresso, etc.) */
.qr-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-normal) var(--ease-out),
              visibility var(--dur-normal) var(--ease-out);
}

.qr-modal.open {
  display: flex;
  opacity: 1;
  visibility: visible;
}

.qr-modal__content {
  text-align: center;
  padding: 32px;
  max-width: 320px;
  width: 100%;
  animation: fadeUp var(--dur-normal) var(--ease-out);
}

.qr-modal__content--form {
  text-align: left;
  max-width: 400px;
  padding: 28px;
}

.qr-modal__backdrop {
  position: absolute;
  inset: 0;
  cursor: pointer;
  border: none;
  background: transparent;
  z-index: 0;
}

.qr-modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
}

/* Rodapé institucional (admin / operador) */
:root {
  --eco-footer-height: 5.5rem;
}

.eco-site-footer {
  position: fixed;
  bottom: 0;
  right: 0;
  z-index: 85;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.eco-site-footer--admin {
  left: 280px;
}

.eco-site-footer--operator {
  left: 0;
}

.eco-site-footer__inner {
  max-width: 1400px;
  margin: 0 auto;
  min-height: var(--eco-footer-height);
  display: flex;
  align-items: center;
  padding: 8px 24px calc(8px + var(--safe-bottom, 0px));
  box-sizing: border-box;
}

.eco-contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  width: 100%;
  gap: 8px 28px;
  font-size: 0.6875rem;
  line-height: 1.45;
  color: var(--accent);
  font-weight: 500;
}

.eco-contact--stack {
  flex-direction: column;
  gap: 14px;
  font-size: 0.8125rem;
  color: var(--accent);
}

.eco-contact__block {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  min-width: 0;
  flex: 1 1 200px;
}

.eco-contact--stack .eco-contact__block {
  flex: 1 1 auto;
}

.eco-contact__block p {
  margin: 0;
}

.eco-contact__icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--accent);
}

.eco-contact--stack .eco-contact__icon {
  width: 18px;
  height: 18px;
}

.eco-contact a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.eco-contact a:hover {
  color: #c45a22;
}

.eco-contact-modal__title {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--accent);
}

/* Botão localização — cidadão (topo, ao lado das notificações) */
.eco-location-fab {
  position: fixed;
  z-index: 90;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(145deg, var(--eco-orange), #e86528);
  color: #fff;
  box-shadow: 0 4px 16px rgba(240, 115, 53, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform var(--dur-fast), box-shadow var(--dur-fast);
}

.eco-location-fab--top {
  top: 18px;
  right: calc(18px + 44px + 10px);
}

.eco-location-fab:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(240, 115, 53, 0.5);
}

.eco-location-fab svg {
  width: 20px;
  height: 20px;
}

body.admin-theme .eco-site-footer .eco-contact,
body.operator-theme .eco-site-footer .eco-contact {
  color: var(--eco-orange, #f07335);
}

body.admin-theme .admin-content {
  padding-bottom: calc(var(--eco-footer-height) + 24px);
}

body.operator-theme .operator-main {
  padding-bottom: calc(var(--eco-footer-height) + 24px);
}

@media (max-width: 1200px) {
  .eco-site-footer--admin {
    left: 0;
  }

  .eco-contact {
    flex-direction: column;
    gap: 6px;
  }

  .eco-contact__block {
    flex: 1 1 auto;
  }
}

@media (max-width: 480px) {
  .eco-site-footer__inner {
    padding-left: 16px;
    padding-right: 16px;
  }

  :root {
    --eco-footer-height: 7.5rem;
  }
}
