@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; }

body {
  background: #16313A;
  color: #fff;
  font-family: 'Inter', sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: #CE9569; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Header ─────────────────────────────────────────────────────── */
.portal-header {
  background: #1c3d48;
  border-bottom: 1px solid rgba(206, 149, 105, 0.2);
  padding: .85rem 0;
}

.portal-header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.portal-logo { max-height: 36px; max-width: 160px; }

.portal-header-right {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}

.portal-greeting {
  font-size: .85rem;
  color: rgba(255, 255, 255, 0.6);
}

/* ─── Main ────────────────────────────────────────────────────────── */
.portal-main { flex: 1; padding: 2.5rem 0; }

.portal-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.portal-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  color: #fff;
  margin: 0 0 1.75rem;
  font-weight: 600;
}

/* ─── Buttons ─────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .6rem 1.2rem;
  border-radius: 8px;
  background: #CE9569;
  color: #16313A;
  font-family: 'Inter', sans-serif;
  font-size: .9rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: opacity .18s, transform .12s;
}

.btn-primary:hover { opacity: .88; transform: translateY(-1px); text-decoration: none; }

.btn-outline-sm {
  display: inline-flex;
  align-items: center;
  padding: .35rem .85rem;
  border-radius: 6px;
  border: 1px solid rgba(206, 149, 105, 0.45);
  color: #CE9569;
  font-size: .78rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity .18s;
}

.btn-outline-sm:hover { opacity: .75; text-decoration: none; }

/* ─── Alerts ─────────────────────────────────────────────────────── */
.alert {
  border-radius: 8px;
  padding: .75rem 1rem;
  font-size: .9rem;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.alert-error {
  background: rgba(192, 57, 43, 0.15);
  border: 1px solid #c0392b;
  color: #e74c3c;
}

/* ─── Login ───────────────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.login-box {
  background: #1c3d48;
  border: 1px solid rgba(206, 149, 105, 0.25);
  border-radius: 14px;
  padding: 2.5rem;
  max-width: 400px;
  width: 100%;
}

.login-logo {
  text-align: center;
  margin-bottom: 1.75rem;
}

.login-logo h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  color: #CE9569;
  margin: .5rem 0 .25rem;
}

.login-logo p {
  font-size: .8rem;
  color: rgba(255, 255, 255, 0.45);
  margin: 0;
}

/* ─── Form ────────────────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  margin-bottom: 1.2rem;
}

.form-group label {
  font-size: .8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.65);
  letter-spacing: .02em;
}

.form-group input {
  background: #16313A;
  border: 1px solid rgba(206, 149, 105, 0.3);
  border-radius: 8px;
  padding: .7rem 1rem;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: .95rem;
  width: 100%;
  outline: none;
  transition: border-color .2s;
}

.form-group input:focus { border-color: #CE9569; }

/* ─── Processos grid ──────────────────────────────────────────────── */
.processos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.processo-card {
  display: block;
  background: #1c3d48;
  border: 1px solid rgba(206, 149, 105, 0.15);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  text-decoration: none;
  color: #fff;
  transition: border-color .2s, transform .15s, box-shadow .2s;
}

.processo-card:hover {
  border-color: rgba(206, 149, 105, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
  text-decoration: none;
  color: #fff;
}

.processo-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .75rem;
}

.processo-tribunal {
  background: rgba(206, 149, 105, 0.15);
  color: #CE9569;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  padding: .2rem .6rem;
  border-radius: 99px;
}

.processo-andamentos {
  font-size: .72rem;
  color: rgba(255, 255, 255, 0.4);
}

.processo-numero {
  font-family: monospace;
  font-size: .88rem;
  color: #fff;
  font-weight: 600;
  margin-bottom: .35rem;
  word-break: break-all;
}

.processo-apelido {
  font-size: .82rem;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: .5rem;
  font-style: italic;
}

.processo-vara {
  font-size: .78rem;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: .65rem;
}

.processo-status {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  font-size: .8rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: .5rem;
  line-height: 1.4;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2ecc71;
  flex-shrink: 0;
  margin-top: .35rem;
}

.processo-sync {
  font-size: .72rem;
  color: rgba(255, 255, 255, 0.3);
  margin-bottom: .75rem;
}

.processo-ver {
  font-size: .8rem;
  color: #CE9569;
  font-weight: 600;
  margin-top: .5rem;
}

/* ─── Detalhe do processo ─────────────────────────────────────────── */
.processo-detalhe-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(206, 149, 105, 0.15);
  flex-wrap: wrap;
}

.processo-meta {
  background: #1c3d48;
  border: 1px solid rgba(206, 149, 105, 0.15);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  font-size: .85rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.8;
}

.processo-meta strong { color: rgba(255, 255, 255, 0.9); }

/* ─── Timeline ────────────────────────────────────────────────────── */
.timeline-titulo {
  font-size: 1rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: .04em;
  text-transform: uppercase;
  margin: 0 0 1.25rem;
}

.timeline {
  position: relative;
  padding-left: 1.5rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: rgba(206, 149, 105, 0.2);
}

.timeline-item {
  position: relative;
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.timeline-dot {
  position: absolute;
  left: -1.5rem;
  top: 10px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #CE9569;
  border: 2px solid #16313A;
  flex-shrink: 0;
}

.timeline-dot--decisao      { background: #e2b96f; }
.timeline-dot--audiencia    { background: #9b59b6; }
.timeline-dot--juntada      { background: #3498db; }
.timeline-dot--notificacao  { background: #1abc9c; }
.timeline-dot--concluso     { background: #e67e22; }
.timeline-dot--recurso      { background: #e74c3c; }
.timeline-dot--encerramento { background: #2ecc71; }
.timeline-dot--outros       { background: rgba(255,255,255,.3); }

.timeline-content {
  background: #1c3d48;
  border: 1px solid rgba(206, 149, 105, 0.12);
  border-radius: 10px;
  padding: .9rem 1.1rem;
  flex: 1;
}

.timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .45rem;
  flex-wrap: wrap;
}

.timeline-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: .2rem .6rem;
  border-radius: 99px;
  white-space: nowrap;
}

.timeline-badge--decisao      { background: rgba(226,185,111,.15); color: #e2b96f; }
.timeline-badge--audiencia    { background: rgba(155, 89,182,.15); color: #c39bd3; }
.timeline-badge--juntada      { background: rgba( 52,152,219,.15); color: #7fb3d3; }
.timeline-badge--notificacao  { background: rgba( 26,188,156,.15); color: #76d7c4; }
.timeline-badge--concluso     { background: rgba(230,126, 34,.15); color: #e59866; }
.timeline-badge--recurso      { background: rgba(231, 76, 60,.15); color: #e6908a; }
.timeline-badge--encerramento { background: rgba( 46,204,113,.15); color: #82e0aa; }
.timeline-badge--outros       { background: rgba(255,255,255,.06); color: rgba(255,255,255,.45); }

.timeline-data {
  font-size: .73rem;
  color: rgba(255, 255, 255, 0.35);
  font-weight: 500;
  white-space: nowrap;
}

.timeline-desc {
  font-size: .88rem;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.55;
}

/* ─── Legenda da timeline ─────────────────────────────────────────── */
.timeline-legenda {
  font-size: .78rem;
  color: rgba(255,255,255,.38);
  line-height: 1.6;
  margin-bottom: 1.75rem;
  padding-left: .25rem;
}

.timeline-legenda strong { color: rgba(255,255,255,.55); }
.timeline-legenda em { font-style: normal; color: #e2a96f; }

/* ─── Timeline item importante ────────────────────────────────────── */
.timeline-content--importante {
  border-color: rgba(230, 126, 34, 0.35);
  background: rgba(230, 126, 34, 0.06);
}

.timeline-aviso {
  margin-top: .65rem;
  padding: .55rem .75rem;
  background: rgba(230, 126, 34, 0.1);
  border-left: 3px solid #e67e22;
  border-radius: 0 6px 6px 0;
  font-size: .78rem;
  color: rgba(255,255,255,.65);
  line-height: 1.5;
}

.timeline-aviso a {
  color: #e2b96f;
  font-weight: 600;
  white-space: nowrap;
}

/* ─── Empty state ─────────────────────────────────────────────────── */
.portal-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: rgba(255, 255, 255, 0.4);
}

/* ─── Footer ──────────────────────────────────────────────────────── */
.portal-footer {
  text-align: center;
  padding: 1.5rem;
  border-top: 1px solid rgba(206, 149, 105, 0.1);
  font-size: .78rem;
  color: rgba(255, 255, 255, 0.3);
  line-height: 1.8;
}

.portal-footer a { color: rgba(206, 149, 105, 0.6); }

/* ─── Responsivo ──────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .processos-grid { grid-template-columns: 1fr; }
  .processo-detalhe-header { flex-direction: column; }
  .portal-title { font-size: 1.3rem; }
}
