:root {
  color-scheme: dark;
  --bg: #0a0612;
  --panel: #23112f;
  --panel-2: #2f1840;
  --accent: #b34cff;
  --accent-2: #ff6bd7;
  --text: #f4f0ff;
  --muted: #b5a9c8;
  --border: rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
}

/* FIX CRITICO: respetar hidden aunque existan reglas display en .modal */
[hidden] { display: none !important; }
.modal[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: radial-gradient(circle at top, #3b1c59 0%, #0b0715 55%);
  color: var(--text);
  min-height: 100vh;
}

.app {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 20px 120px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

h1 {
  margin: 4px 0 0;
  font-size: 28px;
}

h2, h3 {
  margin: 0 0 8px;
}

.card {
  background: rgba(26, 13, 37, 0.9);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
}

.card.highlight {
  background: linear-gradient(135deg, rgba(179, 76, 255, 0.2), rgba(255, 107, 215, 0.15));
}

.auth {
  max-width: 480px;
  margin: 0 auto;
}

.status-pill {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 12px;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.row.space-between {
  justify-content: space-between;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.grid {
  display: grid;
  gap: 12px;
}

.grid.cards {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.grid.small {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

.field input,
.field select {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
}

.field.password {
  position: relative;
}

.field.password button {
  position: absolute;
  right: 8px;
  bottom: 6px;
  border: none;
  background: transparent;
  color: var(--text);
}

button {
  padding: 10px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
}

button.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
}

button.ghost {
  background: transparent;
}

button.full {
  width: 100%;
}

.muted {
  color: var(--muted);
}

.amount-row {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
}

.badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  font-size: 12px;
}

.pill {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list li {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.month-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.tabs {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(10, 6, 18, 0.95);
  display: flex;
  justify-content: space-around;
  padding: 10px 8px 16px;
  border-top: 1px solid var(--border);
  z-index: 10;
}

.tab {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 13px;
}

.tab.active {
  color: var(--text);
}

.fab {
  position: fixed;
  bottom: 64px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  font-size: 28px;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  z-index: 11;
}

.tab-view {
  display: none;
  flex-direction: column;
  gap: 16px;
}

.tab-view.active {
  display: flex;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  z-index: 30;
}

.modal-content {
  background: #1a0f26;
  border-radius: 18px;
  padding: 20px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--border);
}

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 16px 0 24px;
}

.footnote {
  margin-top: 12px;
}

@media (max-width: 720px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .month-bar {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
}

/* Firma institucional A•NEMO•IA: única modificación visual prevista. */
.meapp-brand-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 20px 36px;
  border-top: 1px solid rgba(210, 151, 249, 0.16);
}
.meapp-brand-footer__brand {
  display: block;
  max-width: 100%;
  border-radius: 6px;
}
.meapp-brand-footer__brand:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}
.meapp-brand-footer__logo {
  display: block;
  width: 220px;
  max-width: min(62vw, 220px);
  height: auto;
  border-radius: 4px;
}
.meapp-brand-footer__credit,
.meapp-brand-footer__tagline {
  margin: 0;
  line-height: 1.5;
}
.meapp-brand-footer__credit {
  color: var(--text);
  font-size: 13px;
}
.meapp-brand-footer__credit strong { color: #d0a7f8; }
.meapp-brand-footer__tagline {
  color: var(--muted);
  font-size: 11px;
}
.meapp-brand-footer__links {
  margin: 2px 0 0;
  font-size: 11px;
  line-height: 1.8;
  text-align: center;
  overflow-wrap: anywhere;
}
.meapp-brand-footer__links a {
  color: var(--muted);
  text-decoration: none;
}
.meapp-brand-footer__links a:hover,
.meapp-brand-footer__links a:focus-visible {
  color: var(--text);
  text-decoration: underline;
}

/* Ocultar únicamente el botón flotante cuando el pie institucional está visible. */
.fab.fab--footer-near {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
