/* =========================================================================
   SEGUE · Importação Acadêmica — tema institucional
   Direção "registro acadêmico oficial": navy tinta + dourado de brasão +
   serif (Georgia) nos títulos. Reskin sobre Bootstrap 3.4.
   ========================================================================= */

:root {
  --ink:      #14243c;   /* navy profundo */
  --ink-2:    #1d3350;
  --ink-3:    #33507a;   /* navy claro (gradiente de botão) */
  --paper:    #e7ebf2;   /* fundo geral */
  --surface:  #ffffff;   /* cartões */
  --gold:     #b6892f;   /* dourado institucional */
  --gold-2:   #dcb055;
  --ok:       #1c7a4d;
  --err:      #b23a3a;
  --warn:     #a9761d;
  --info:     #2c5d86;
  --text:     #1b2432;
  --muted:    #64718a;
  --line:     #d3dbe6;
  --radius:   12px;
  --shadow-sm:0 1px 2px rgba(20,36,60,.06);
  --shadow:   0 2px 6px rgba(20,36,60,.06), 0 14px 40px rgba(20,36,60,.10);
  --serif:    Georgia, "Times New Roman", serif;
  --sans:     system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(1100px 420px at 50% -160px, rgba(20,36,60,.07), transparent 70%),
    var(--paper);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--info); text-decoration: none; }
a:hover { color: var(--ink); }
::selection { background: rgba(182,137,47,.25); }

/* ---------- Selo / wordmark -------------------------------------------- */
.app-brand__seal {
  font-family: var(--serif); font-weight: 700; font-size: 22px;
  width: 42px; height: 42px; display: grid; place-items: center;
  color: var(--ink);
  background: linear-gradient(150deg, var(--gold-2), var(--gold));
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.35), 0 4px 12px rgba(182,137,47,.35);
}

/* ---------- Cabeçalho institucional (menu) ----------------------------- */
.app-header {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(180deg, var(--ink), var(--ink-2));
  border-bottom: 3px solid var(--gold);
  box-shadow: 0 6px 20px rgba(20,36,60,.18);
  color: #eaf0f7;
}
.app-header__inner {
  max-width: 1140px; margin: 0 auto; padding: 12px 22px;
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
}
.app-brand { display: flex; align-items: center; gap: 12px; color: inherit; }
.app-brand:hover { color: inherit; }
.app-brand__text { display: flex; flex-direction: column; line-height: 1.12; }
.app-brand__text strong { font-family: var(--serif); font-size: 21px; letter-spacing: .5px; }
.app-brand__text small { color: #9fb0c6; font-size: 11px; letter-spacing: .6px; text-transform: uppercase; }

.app-nav { display: flex; gap: 3px; margin-left: auto; flex-wrap: wrap; }
.app-nav a {
  display: inline-flex; align-items: center; gap: 8px;
  color: #cdd8e6; font-size: 13.5px; font-weight: 600;
  padding: 9px 15px; border-radius: 9px; white-space: nowrap;
  border: 1px solid transparent; transition: background .15s, color .15s;
}
.app-nav a .glyphicon { font-size: 12px; opacity: .8; top: 1px; }
.app-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.app-nav a.is-active { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 0 -2px 0 var(--gold); }
.app-nav a.is-active .glyphicon { opacity: 1; color: var(--gold-2); }

.app-signout {
  display: inline-flex; align-items: center; gap: 7px;
  color: #eec7c7; font-size: 13px; font-weight: 600;
  padding: 9px 14px; border-radius: 9px; border: 1px solid rgba(238,199,199,.3);
  transition: background .15s, color .15s;
}
.app-signout:hover { background: rgba(178,58,58,.25); color: #fff; }
.app-signout .glyphicon { font-size: 11px; top: 1px; }

/* ---------- Conteúdo ---------------------------------------------------- */
#content.container, body > .container { max-width: 1000px; padding-top: 30px; padding-bottom: 56px; }

legend, .section-title {
  font-family: var(--serif); font-size: 23px; font-weight: 700; color: var(--ink);
  border: 0; margin: 0 0 20px; padding: 0 0 12px; position: relative; width: auto;
}
legend::after, .section-title::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 56px; height: 3px; background: var(--gold); border-radius: 2px;
}

/* ---------- Cartão de formulário --------------------------------------- */
fieldset {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 28px 32px 32px; max-width: 640px; margin: 0 auto 20px;
}
.form-horizontal .control-label {
  display: block; text-align: left; font-weight: 600; color: var(--ink);
  font-size: 13px; letter-spacing: .2px; padding: 0; margin: 0 0 7px;
}
.form-horizontal .form-group { margin: 0 0 20px; }
.form-horizontal .form-group > .control-label,
.form-horizontal .form-group > div[class^="col-"] { width: 100%; float: none; }

.form-control {
  height: 46px; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: none; font-size: 15px; color: var(--text); padding: 8px 14px;
  background: #fcfdff; transition: border-color .15s, box-shadow .15s, background .15s;
}
.form-control:focus {
  border-color: var(--gold); background: #fff;
  box-shadow: 0 0 0 4px rgba(182,137,47,.16);
}
.form-control::placeholder { color: #9aa6ba; }
.help-block { color: var(--muted); font-size: 12.5px; min-height: 18px; margin: 7px 0 0; }
.help-block:not(:empty)::before {
  font-family: "Glyphicons Halflings"; content: "\e013"; color: var(--ok);
  font-size: 11px; margin-right: 6px;
}
.help-block:not(:empty) { color: var(--ink); font-weight: 600; }

/* Campo com ícone à esquerda */
.field { margin-bottom: 18px; }
.field > label { display: block; font-weight: 600; font-size: 13px; color: var(--ink); margin-bottom: 7px; }
.field-input { position: relative; }
.field-input .glyphicon.field-ico {
  position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
  color: #9aa6ba; font-size: 15px; pointer-events: none; z-index: 2;
}
.field-input input.form-control { padding-left: 42px; }
.field-input:focus-within .field-ico { color: var(--gold); }

/* ---------- Botões ------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  border-radius: 10px; font-weight: 600; font-size: 14.5px; padding: 11px 22px;
  border: 1px solid transparent; transition: background .15s, box-shadow .15s, transform .06s;
}
.btn .glyphicon { font-size: 13px; top: 1px; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(180deg, var(--ink-3), var(--ink-2));
  border-color: var(--ink-2); color: #fff;
  box-shadow: 0 3px 10px rgba(20,36,60,.28);
}
.btn-primary:hover, .btn-primary:focus { background: linear-gradient(180deg, var(--ink-2), var(--ink)); color: #fff; }
.btn-primary:focus-visible { outline: 3px solid rgba(182,137,47,.5); outline-offset: 2px; }

/* Link "Voltar" -> botão fantasma */
.container > a[href*="history.back"], #content > a[href*="history.back"] {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 20px;
  padding: 9px 18px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink); font-weight: 600;
}
.container > a[href*="history.back"]:hover, #content > a[href*="history.back"]:hover {
  border-color: var(--ink); box-shadow: var(--shadow-sm);
}
.container > a[href*="history.back"]::before, #content > a[href*="history.back"]::before { content: "\2039"; font-size: 18px; line-height: 1; }

/* ---------- Painéis de status (feedback da importação) ------------------ */
.alert {
  display: flex; align-items: flex-start; gap: 11px;
  border: 1px solid var(--line); border-left-width: 4px; border-radius: 10px;
  background: var(--surface); color: var(--text); padding: 13px 16px;
  box-shadow: var(--shadow-sm); margin-bottom: 11px;
}
.alert strong { color: var(--ink); }
.alert::before {
  font-family: "Glyphicons Halflings"; font-size: 13px; line-height: 1.5; flex: none;
}
.alert-success { border-left-color: var(--ok); }
.alert-danger  { border-left-color: var(--err); }
.alert-info    { border-left-color: var(--info); }
.alert-warning { border-left-color: var(--warn); }
.alert-success::before { content: "\e013"; color: var(--ok); }
.alert-danger::before  { content: "\e014"; color: var(--err); }
.alert-info::before    { content: "\e086"; color: var(--info); }
.alert-warning::before { content: "\e101"; color: var(--warn); }

.text-success { color: var(--ok) !important; }
.text-danger  { color: var(--err) !important; }
p.text-success, p.text-danger {
  background: var(--surface); border: 1px solid var(--line);
  border-left: 4px solid currentColor; border-radius: 10px; padding: 11px 15px; margin: 0 0 9px;
}
p.text-success { border-left-color: var(--ok); }
p.text-danger  { border-left-color: var(--err); }

/* ---------- Tabelas de disciplinas ------------------------------------- */
.table {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.table > thead > tr > th {
  background: var(--ink); color: #eaf0f7; border-bottom: 0; font-weight: 600;
  vertical-align: middle; padding: 12px; font-size: 13px; letter-spacing: .2px;
}
.thead-inverse th { background: var(--ink); color: #eaf0f7; text-align: center; }
.table > tbody > tr > td { padding: 11px 12px; border-color: var(--line); font-variant-numeric: tabular-nums; }
.table-bordered, .table-bordered > tbody > tr > td, .table-bordered > thead > tr > th { border-color: var(--line); }
.table > tbody > tr:nth-child(odd) > td { background: #f7f9fc; }
.table > tbody > tr:hover > td { background: #eef3fb; }
.end-histo-temp { border-right: 3px solid var(--gold) !important; }
.table > tbody > tr.check > td, .table > tbody > tr > td.check { background: rgba(182,137,47,.14) !important; }
.table tfoot th { background: #eef2f8; color: var(--ink); font-weight: 700; }
.chk_disciplina, #chk_disciplina_all { width: 16px; height: 16px; cursor: pointer; accent-color: var(--gold); }

/* ---------- Legados preservados ---------------------------------------- */
.personid { color: var(--info); cursor: pointer; font-weight: 700; }
.personid:hover { color: var(--ink); }
.info-titulo { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(182,137,47,.16); outline: 0; }
.close-info { display: none; } .open-info { display: block; }
.barra-area { position: relative; display: block; width: 300px; }
.barra { position: relative; display: block; width: 100%; background: #e3e8f0; padding: 3px; border-radius: 7px; box-shadow: inset 0 1px 3px rgba(20,36,60,.15); }
.carga { height: 18px; display: block; background: linear-gradient(90deg, var(--gold), var(--gold-2)); width: 0; border-radius: 5px; transition: width .8s ease; }

/* =======================================================================
   Login — split screen (painel institucional + formulário)
   ======================================================================= */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }

.auth__brand {
  position: relative; overflow: hidden; color: #eaf0f7;
  background: linear-gradient(160deg, var(--ink), var(--ink-2) 60%, #0e1b2e);
  display: flex; align-items: center; padding: 56px;
}
.auth__brand::before { /* trama de pontos sutil */
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(182,137,47,.16) 1.2px, transparent 1.2px);
  background-size: 22px 22px; opacity: .5;
}
.auth__brand::after { /* monograma fantasma */
  content: "S"; position: absolute; right: -40px; bottom: -80px;
  font-family: var(--serif); font-size: 460px; line-height: 1; font-weight: 700;
  color: rgba(255,255,255,.035);
}
.auth__brand-inner { position: relative; max-width: 420px; }
.auth__brand .app-brand__seal { width: 60px; height: 60px; font-size: 32px; border-radius: 14px; margin-bottom: 26px; }
.auth__brand h1 { font-family: var(--serif); font-size: 46px; margin: 0; letter-spacing: 1px; }
.auth__tag { color: var(--gold-2); text-transform: uppercase; letter-spacing: 2px; font-size: 13px; font-weight: 600; margin: 6px 0 26px; }
.auth__desc { color: #b7c4d6; font-size: 15.5px; line-height: 1.65; margin: 0 0 34px; }
.auth__flow { display: flex; align-items: center; gap: 12px; }
.auth__flow .chip {
  font-weight: 700; font-size: 13px; letter-spacing: .5px;
  padding: 9px 16px; border-radius: 9px; border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.05);
}
.auth__flow .chip.dst { border-color: rgba(182,137,47,.5); color: var(--gold-2); }
.auth__flow .arrow { color: var(--gold-2); font-size: 16px; }

.auth__form { display: grid; place-items: center; padding: 40px 24px; }
.login-card { width: 100%; max-width: 384px; }
.login-card h2 { font-family: var(--serif); font-size: 27px; color: var(--ink); margin: 0 0 4px; }
.login-card .lead { color: var(--muted); font-size: 14px; margin: 0 0 26px; }
.login-card .btn-primary { width: 100%; margin-top: 4px; padding: 13px; }
.login-foot { text-align: center; color: var(--muted); font-size: 11.5px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
/* selo topo do form em telas pequenas */
.login-mini-brand { display: none; text-align: center; margin-bottom: 22px; }
.login-mini-brand .app-brand__seal { width: 52px; height: 52px; font-size: 27px; margin: 0 auto 10px; }
.login-mini-brand strong { font-family: var(--serif); font-size: 24px; color: var(--ink); display: block; }
.login-mini-brand small { color: var(--muted); text-transform: uppercase; letter-spacing: 1px; font-size: 11px; }

/* ---------- Responsivo / acessibilidade -------------------------------- */
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth__brand { display: none; }
  .login-mini-brand { display: block; }
}
@media (max-width: 620px) {
  .app-header__inner { gap: 12px; }
  .app-nav { width: 100%; margin-left: 0; }
  .app-nav a { flex: 1; justify-content: center; }
  fieldset { padding: 22px 18px 24px; }
}
*:focus-visible { outline: 3px solid rgba(182,137,47,.5); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
