/* IGSP — small layer on top of Bootstrap. Mobile-first (375 px first).

   Neutral identity for now (D10): the colors of the brand are the --marca-* variables below.
   When the church's identity arrives, change them here (and the icons in static/img/, made
   from static/img/icon-source.svg). Colors of *data* (states, categories, charts) are not
   brand colors: they get their own variables, checked for color blindness. */

:root {
  --marca-primaria: #23436b; /* buttons, links, icons: white text on it is AAA */
  --marca-primaria-escura: #1a3352;
  --marca-escura: #1d2733; /* menu and login background */
  --marca-destaque: #f2c14e; /* attention (badges); never as text on a light background */
  --marca-fundo: #eef2f7;
  --marca-papel: #ffffff;
  --marca-texto: #1d2733;
  --marca-texto-suave: #556270; /* secondary text: AA on --marca-fundo and on white */
  --marca-linha: #d9e0e8;
  --marca-foco: rgba(35, 67, 107, 0.3);

  --bs-primary: var(--marca-primaria);
  --bs-primary-rgb: 35, 67, 107;
  --bs-link-color: var(--marca-primaria);
  --bs-link-color-rgb: 35, 67, 107;
  --bs-link-hover-color: var(--marca-primaria-escura);
  --bs-link-hover-color-rgb: 26, 51, 82;
  --bs-body-color: var(--marca-texto);
  --bs-body-color-rgb: 29, 39, 51;
  --bs-secondary-color: var(--marca-texto-suave);
  --bs-secondary-color-rgb: 85, 98, 112;
  --bs-border-color: var(--marca-linha);
  --bs-focus-ring-color: var(--marca-foco);
}

body {
  background-color: var(--marca-fundo);
}

.btn-primary {
  --bs-btn-bg: var(--marca-primaria);
  --bs-btn-border-color: var(--marca-primaria);
  --bs-btn-hover-bg: var(--marca-primaria-escura);
  --bs-btn-hover-border-color: var(--marca-primaria-escura);
  --bs-btn-active-bg: var(--marca-primaria-escura);
  --bs-btn-active-border-color: var(--marca-primaria-escura);
  --bs-btn-disabled-bg: var(--marca-primaria);
  --bs-btn-disabled-border-color: var(--marca-primaria);
  --bs-btn-focus-shadow-rgb: 35, 67, 107;
}

.btn-outline-primary {
  --bs-btn-color: var(--marca-primaria);
  --bs-btn-border-color: var(--marca-primaria);
  --bs-btn-hover-bg: var(--marca-primaria);
  --bs-btn-hover-border-color: var(--marca-primaria);
  --bs-btn-active-bg: var(--marca-primaria-escura);
  --bs-btn-active-border-color: var(--marca-primaria-escura);
  --bs-btn-focus-shadow-rgb: 35, 67, 107;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: var(--marca-primaria);
  box-shadow: 0 0 0 0.25rem var(--marca-foco);
}

.form-check-input:checked {
  background-color: var(--marca-primaria);
  border-color: var(--marca-primaria);
}

/* Attention (e.g. pending items): the highlight color with dark text. */
.text-bg-warning {
  color: var(--marca-texto) !important;
  background-color: var(--marca-destaque) !important;
}

/* --- Menu --------------------------------------------------------------------------------- */

.app-navbar {
  background-color: var(--marca-escura);
}

.app-brand {
  font-weight: 700;
  letter-spacing: 0.04em;
}

.app-navbar .nav-link {
  color: rgba(255, 255, 255, 0.75);
}

.app-navbar .nav-link.active,
.app-navbar .nav-link:hover {
  color: #fff;
}

/* The current page: a dot in the highlight color. */
.app-navbar .nav-link.active::before {
  content: "";
  display: inline-block;
  width: 0.4rem;
  height: 0.4rem;
  margin-right: 0.4rem;
  border-radius: 50%;
  background-color: var(--marca-destaque);
  vertical-align: 0.12em;
}

/* --- Login -------------------------------------------------------------------------------- */

.auth-body {
  min-height: 100vh;
  background-color: var(--marca-escura);
}

.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 8vh;
  padding-bottom: 3rem;
}

.auth-brand {
  margin-bottom: 1.5rem;
  text-align: center;
  color: #fff;
}

.auth-brand-name {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
}

.auth-tagline {
  margin-top: 0.5rem;
  color: rgba(255, 255, 255, 0.75);
  font-size: 1.1rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  border: 0;
  border-radius: 1rem;
}

/* --- Home --------------------------------------------------------------------------------- */

.home-card {
  color: inherit;
  transition: box-shadow 0.15s ease-in-out;
}

.home-card:hover {
  box-shadow: 0 0.35rem 1rem rgba(29, 39, 51, 0.08);
}

/* A chevron at the end of each card of the home page. */
.home-card .card-body::after {
  content: "";
  flex: 0 0 auto;
  width: 0.5rem;
  height: 0.5rem;
  margin-left: 0.75rem;
  border-top: 2px solid var(--marca-texto-suave);
  border-right: 2px solid var(--marca-texto-suave);
  transform: rotate(45deg);
}

/* --- Audit log: readable "Label: value" lines ---------------------------------------------- */

.audit-details {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.15rem 0.75rem;
  margin-top: 0.35rem;
  padding: 0.5rem 0.75rem;
  background: var(--bs-tertiary-bg);
  border-radius: 0.25rem;
}

.audit-details dt {
  font-weight: 600;
  color: var(--bs-secondary-color);
}

.audit-details dd {
  margin: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 575.98px) {
  .audit-details {
    grid-template-columns: minmax(0, 1fr);
  }

  .audit-details dd {
    margin-bottom: 0.25rem;
  }
}
