/*
 * ufv.css — identidade visual do Atendimentos DSA (UFV Campus Viçosa).
 * Carregar DEPOIS do bootstrap.min.css (5.3.3). Tons de marrom (o verde é do DVP; decisão do usuário, 26/11/2026).
 * Cabeçalho e rodapé estáticos; no celular, U/P têm a barra inferior fixa (app.css).
 */

:root {
  /* marca marrom DSA (contraste >= 4,5:1 sobre branco) */
  --dsa-marrom: #7a4b2a;
  --dsa-marrom-rgb: 122, 75, 42;
  --dsa-marrom-hover: #64391f;
  --dsa-marrom-escuro: #5a3519;
  --dsa-marrom-claro: #9a6540;
  --dsa-marrom-suave: #f6efe8;
  --dsa-marrom-borda: #e6d6c6;
  --dsa-btn-pri-texto: #ffffff;

  /* superfícies e texto */
  --ufv-fundo: #f8f5f2;
  --ufv-superficie: #ffffff;
  --ufv-superficie-2: #f7f3ef;
  --ufv-borda: #e3d8ce;
  --ufv-texto: #2a221d;
  --ufv-texto-fraco: #645850;

  /* estados (contraste >= 4,5:1 sobre branco) */
  --ufv-sucesso: #1a7031;
  --ufv-aviso: #8a6100;
  --ufv-erro: #9d2a2a;
  --ufv-info: #1d6a8c;

  /* forma */
  --ufv-raio: .5rem;
  --ufv-raio-cartao: .75rem;
  --ufv-sombra: 0 1px 3px rgba(90, 53, 25, .08), 0 8px 24px rgba(90, 53, 25, .05);

  /* vidro claro para cabeçalho e rodapé */
  --ufv-vidro-bg: linear-gradient(135deg, rgba(252, 248, 244, .88), rgba(244, 236, 228, .82));
  --ufv-vidro-bg-forte: rgba(252, 249, 246, .96);
  --ufv-vidro-borda: rgba(255, 255, 255, .86);
  --ufv-vidro-brilho: rgba(255, 255, 255, .92);
  --ufv-vidro-filtro: blur(18px) saturate(150%);
  --ufv-vidro-sombra: 0 8px 26px rgba(90, 53, 25, .08), 0 2px 6px rgba(90, 53, 25, .04);
  --ufv-vidro-raio: 18px;
  --ufv-fundo-degrade:
    radial-gradient(860px 460px at 6% -8%, rgba(196, 160, 128, .20), transparent 60%),
    radial-gradient(720px 500px at 100% 6%, rgba(230, 214, 198, .40), transparent 60%),
    linear-gradient(160deg, #faf7f4 0%, #efe7df 100%);

  /* tipografia */
  --ufv-fonte: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --ufv-fonte-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --ufv-texto-xs: .75rem;
  --ufv-texto-sm: .875rem;
  --ufv-texto-base: .9375rem;
  --ufv-texto-lg: 1.0625rem;
  --ufv-titulo-sm: 1rem;
  --ufv-titulo-md: 1.125rem;
  --ufv-titulo-lg: 1.375rem;
  --ufv-titulo-xl: 1.625rem;
  --ufv-peso-normal: 400;
  --ufv-peso-medio: 500;
  --ufv-peso-titulo: 600;
  --ufv-logo-filtro: none;
  --ufv-marca-cor: var(--dsa-marrom-escuro);

  /* Bootstrap recolorido */
  --bs-primary: var(--dsa-marrom);
  --bs-primary-rgb: var(--dsa-marrom-rgb);
  --bs-link-color: var(--dsa-marrom-escuro);
  --bs-link-color-rgb: var(--dsa-marrom-rgb);
  --bs-link-hover-color: var(--dsa-marrom-hover);
  --bs-body-font-family: var(--ufv-fonte);
  --bs-body-font-size: var(--ufv-texto-base);
  --bs-body-line-height: 1.5;
  --bs-body-color: var(--ufv-texto);
  --bs-border-color: var(--ufv-borda);
  --bs-border-radius: var(--ufv-raio);
  --bs-success: var(--ufv-sucesso);
  --bs-danger: var(--ufv-erro);
  --bs-warning-text-emphasis: var(--ufv-aviso);
  --bs-focus-ring-color: rgba(var(--dsa-marrom-rgb), .32);
}

:root[data-ufv-tema="escuro"] {
  --dsa-marrom: #b07a52;
  --dsa-marrom-hover: #c38c62;
  --dsa-marrom-escuro: #ecc9a8;
  --dsa-marrom-claro: #d39d72;
  --dsa-marrom-suave: rgba(176, 122, 82, .20);
  --dsa-marrom-borda: rgba(236, 201, 168, .25);
  --dsa-btn-pri-texto: #1d1209;

  --ufv-fundo: #17120e;
  --ufv-superficie: #211a15;
  --ufv-superficie-2: #2a211b;
  --ufv-borda: #3d3129;
  --ufv-texto: #f3ebe4;
  --ufv-texto-fraco: #bfae9f;

  --ufv-vidro-bg: rgba(50, 38, 29, .84);
  --ufv-vidro-bg-forte: rgba(41, 31, 24, .94);
  --ufv-vidro-borda: rgba(236, 201, 168, .18);
  --ufv-vidro-brilho: rgba(236, 201, 168, .08);
  --ufv-vidro-sombra: 0 10px 28px rgba(0, 0, 0, .42), 0 2px 8px rgba(0, 0, 0, .26);
  --ufv-fundo-degrade:
    radial-gradient(840px 480px at 6% -8%, rgba(176, 122, 82, .14), transparent 60%),
    radial-gradient(720px 500px at 100% 6%, rgba(122, 75, 42, .12), transparent 60%),
    linear-gradient(160deg, #17120e 0%, #221a14 100%);
  --ufv-logo-filtro: brightness(0) invert(.90);
  --ufv-marca-cor: #ecc9a8;

  --bs-link-color: #ecc9a8;
  --bs-link-color-rgb: 236, 201, 168;
  --bs-body-color: var(--ufv-texto);
  --bs-body-bg: var(--ufv-fundo);
}

/* Base */
body.ufv {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ufv-fundo-degrade), var(--ufv-fundo);
  color: var(--ufv-texto);
  font-family: var(--ufv-fonte);
  font-size: var(--ufv-texto-base);
  line-height: 1.5;
}
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
  font-weight: var(--ufv-peso-titulo);
  line-height: 1.3;
  text-wrap: balance;
}
h3, .h3 { font-size: var(--ufv-titulo-xl); }
h4, .h4 { font-size: var(--ufv-titulo-lg); }
h5, .h5 { font-size: var(--ufv-titulo-md); }
h6, .h6 { font-size: var(--ufv-titulo-sm); }
small, .small { font-size: var(--ufv-texto-sm); }
strong, b { font-weight: var(--ufv-peso-medio); }
.btn { font-size: var(--ufv-texto-base); font-weight: var(--ufv-peso-medio); }
.btn-sm { font-size: var(--ufv-texto-sm); }
.btn-lg { font-size: var(--ufv-texto-lg); }
.form-control, .form-select { font-size: var(--ufv-texto-base); }
.form-label, legend.form-label { font-size: var(--ufv-texto-sm); font-weight: var(--ufv-peso-normal); }
:focus-visible { outline: 2px solid var(--dsa-marrom); outline-offset: 2px; }
.ufv-num, td.text-end, .ufv-tabela td.num { font-variant-numeric: tabular-nums; }
code, kbd, .ufv-mono { font-family: var(--ufv-fonte-mono); }

/* Botões primários */
.btn-primary {
  --bs-btn-bg: var(--dsa-marrom);
  --bs-btn-border-color: var(--dsa-marrom);
  --bs-btn-color: var(--dsa-btn-pri-texto);
  --bs-btn-hover-bg: var(--dsa-marrom-hover);
  --bs-btn-hover-border-color: var(--dsa-marrom-hover);
  --bs-btn-hover-color: var(--dsa-btn-pri-texto);
  --bs-btn-active-bg: var(--dsa-marrom-hover);
  --bs-btn-active-border-color: var(--dsa-marrom-hover);
  --bs-btn-active-color: var(--dsa-btn-pri-texto);
  --bs-btn-disabled-bg: var(--dsa-marrom);
  --bs-btn-disabled-border-color: var(--dsa-marrom);
  --bs-btn-focus-shadow-rgb: var(--dsa-marrom-rgb);
}
.btn-outline-primary {
  --bs-btn-color: var(--dsa-marrom-escuro);
  --bs-btn-border-color: var(--dsa-marrom);
  --bs-btn-hover-bg: var(--dsa-marrom);
  --bs-btn-hover-border-color: var(--dsa-marrom);
  --bs-btn-hover-color: var(--dsa-btn-pri-texto);
  --bs-btn-active-bg: var(--dsa-marrom-hover);
  --bs-btn-active-border-color: var(--dsa-marrom-hover);
  --bs-btn-focus-shadow-rgb: var(--dsa-marrom-rgb);
}

/* Cabeçalho (vidro claro, padrão SisAusencia, sem acompanhar a rolagem) */
.ufv-cab {
  position: static;
  margin: 12px 16px 0;
  padding: .6rem .9rem;
  background: var(--ufv-vidro-bg);
  border: 1px solid var(--ufv-vidro-borda);
  border-radius: var(--ufv-vidro-raio);
  box-shadow: var(--ufv-vidro-sombra), inset 0 1px 0 var(--ufv-vidro-brilho);
  -webkit-backdrop-filter: var(--ufv-vidro-filtro);
  backdrop-filter: var(--ufv-vidro-filtro);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .ufv-cab { background: var(--ufv-vidro-bg-forte); }
}
.ufv-marca {
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
  color: var(--ufv-marca-cor);
  min-width: 0;
}
.ufv-marca img { height: 38px; width: auto; filter: var(--ufv-logo-filtro); flex-shrink: 0; }
.ufv-marca-texto {
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 2px solid var(--ufv-marca-cor);
  padding-left: .75rem;
  min-height: 38px;
  line-height: 1.2;
}
.ufv-marca-campus { font-size: var(--ufv-texto-xs); font-weight: var(--ufv-peso-normal); }
.ufv-marca-sistema { font-size: var(--ufv-texto-base); font-weight: var(--ufv-peso-titulo); }
.ufv-usuario { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.ufv-usuario-nome { font-size: var(--ufv-texto-sm); color: var(--ufv-texto-fraco); font-weight: var(--ufv-peso-normal); }
.ufv-pilula {
  border-radius: 999px;
  background: var(--ufv-superficie);
  border: 1px solid var(--dsa-marrom-borda);
  color: var(--dsa-marrom-escuro);
  min-height: 36px;
  font-weight: var(--ufv-peso-medio);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
}
.ufv-pilula:hover { background: var(--dsa-marrom-suave); color: var(--dsa-marrom-escuro); }
.ufv-sair:hover { color: var(--dsa-btn-pri-texto); background: var(--dsa-marrom); border-color: var(--dsa-marrom); }

/* Conteúdo sólido */
.ufv-conteudo { flex: 1 0 auto; padding-top: 1.15rem; padding-bottom: 1.5rem; }
.card {
  --bs-card-bg: var(--ufv-superficie);
  --bs-card-border-color: var(--ufv-borda);
  --bs-card-border-radius: var(--ufv-raio-cartao);
  --bs-card-cap-bg: var(--ufv-superficie);
  box-shadow: var(--ufv-sombra);
  margin-bottom: 1.25rem;
}
.ufv-titulo { border-bottom: 3px solid var(--dsa-marrom); }
.ufv-titulo .h5, .ufv-titulo h1, .ufv-titulo h2 { font-weight: var(--ufv-peso-titulo); }

.table { --bs-table-bg: var(--ufv-superficie); font-size: var(--ufv-texto-base); }
.table > thead th {
  background: var(--ufv-superficie-2);
  color: var(--dsa-marrom-escuro);
  font-weight: var(--ufv-peso-medio);
  font-size: var(--ufv-texto-sm);
  text-wrap: balance;
  border-bottom: 1px solid var(--ufv-borda);
}
:root[data-ufv-tema="escuro"] .table > thead th { color: var(--ufv-texto); }

.ufv-filtros {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: end;
  padding: .75rem 1rem;
  background: var(--ufv-superficie-2);
  border-bottom: 1px solid var(--ufv-borda);
}
.ufv-vazio { text-align: center; color: var(--ufv-texto-fraco); padding: 2.5rem 1rem; }
.ufv-vazio > .bi { font-size: 2.5rem; display: block; margin-bottom: .5rem; }
.ufv-bloqueio-icone { font-size: 4rem; color: var(--ufv-erro); }
.ufv-obrigatorio { color: var(--ufv-erro); }

/* Rodapé estático base */
.ufv-rodape {
  position: static;
  flex-shrink: 0;
  font-size: var(--ufv-texto-sm);
  color: var(--dsa-marrom-escuro);
}

/* Ajustes para celular */
@media (max-width: 640px) {
  .ufv-cab {
    margin: 8px 8px 0;
    padding: .5rem .7rem;
    --ufv-vidro-raio: 14px;
  }
  .ufv-marca { gap: .5rem; }
  .ufv-marca img { height: 28px; width: auto; }
  .ufv-marca-texto {
    padding-left: .5rem;
    min-height: 30px;
  }
  .ufv-marca-campus {
    display: block !important;
    font-size: var(--ufv-texto-xs);
    white-space: nowrap;
  }
  .ufv-marca-sistema { font-size: var(--ufv-texto-sm); white-space: nowrap; }
  .ufv-sair span { display: none; }
  .form-control, .form-select { font-size: 1rem; }
}

@media (pointer: coarse) {
  .btn, .nav-link, .page-link { min-height: 44px; min-width: 44px; }
  /* Radio/caixa: o alvo de toque é a linha da opção (o rótulo marca), não o campo esticado a 44px */
  .form-check { min-height: 44px; padding-top: .6rem; }
  .form-check-input { width: 1.25em; height: 1.25em; margin-top: .125em; }
  .btn { touch-action: manipulation; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Modal de confirmação após incluir ou alterar agendamento (View::modalSucessoAgendamento) */
.dsa-modal-topo { background: var(--dsa-marrom); color: var(--dsa-btn-pri-texto); }
.dsa-modal-topo .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
.dsa-modal-topo .badge { background: rgba(255, 255, 255, .22); color: inherit; }
:root[data-ufv-tema="escuro"] .dsa-modal-topo .btn-close { filter: none; }
:root[data-ufv-tema="escuro"] .dsa-modal-topo .badge { background: rgba(0, 0, 0, .15); }
.dsa-modal-icone { width: 3rem; height: 3rem; background: var(--dsa-marrom-suave); color: var(--dsa-marrom-escuro); }
.dsa-modal-icone-cancelado { background: var(--bs-danger-bg-subtle); color: var(--bs-danger-text-emphasis); }

@media print {
  :root { color-scheme: light; }
  body.ufv { background: #fff; color: #000; }
  .dsa-menu-movel, .dsa-base-movel, .dsa-trilha, .btn, .ufv-filtros, .ufv-rodape { display: none !important; }
  .ufv-cab { box-shadow: none; border: 0; background: #fff; backdrop-filter: none; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}
