/* ============================================================================
   RPM ADVOCACIA · PORTAL DO CLIENTE — DESIGN SYSTEM "SERENIDADE DO MAR"
   ----------------------------------------------------------------------------
   Conceito: calma, clareza e confiança. Paleta oceânica (azul profundo,
   turquesa e espuma), tipografia serena, muito respiro e linguagem visual
   acolhedora para o cliente leigo.

   Compartilhado por: area-cliente-login.html, area-cliente.html,
                      area-cliente-processo.html
   ========================================================================== */

:root {
  /* ── Oceano: do mais profundo (âncora/confiança) ao mais claro (calma) ── */
  --abyss:        #06212f;   /* fundo navy-oceânico mais escuro */
  --deep:         #0b3550;   /* superfícies escuras */
  --deep-2:       #0f4a6b;
  --ocean:        #15689a;   /* primário */
  --ocean-2:      #1c84b8;
  --tide:         #2aa3c4;   /* maré clara */
  --teal:         #2a9d8f;   /* espuma esverdeada (acento) */
  --teal-deep:    #1f7d72;
  --aqua:         #69bfcf;
  --aqua-soft:    #b7e0e6;
  --foam:         #e4f2f5;   /* espuma */
  --mist:         #eef5f9;   /* fundo de página */
  --sky:          #f5fafc;
  --surface:      #ffffff;
  --surface-2:    #f7fbfd;

  /* ── Sussurro de areia/champagne — único toque quente, muito discreto ── */
  --sand:         #d8c39a;
  --sand-line:    rgba(216,195,154,.55);

  /* ── Tinta (texto) — alto contraste sobre claro ── */
  --ink:          #0d2330;
  --ink-2:        #3a5260;
  --ink-3:        #5f7a89;
  --ink-soft:     #607a88;   /* AA (~4.5:1 em fundo claro) p/ rótulos pequenos */
  --ink-faint:    #97a9b2;

  /* ── Texto sobre superfícies escuras ── */
  --on-deep:      rgba(255,255,255,.92);
  --on-deep-2:    rgba(255,255,255,.62);
  --on-deep-3:    rgba(255,255,255,.40);
  --on-deep-faint:rgba(255,255,255,.22);

  /* ── Bordas / linhas ── */
  --line:         #d6e6ee;
  --line-soft:    #e6f1f6;
  --line-strong:  #c4dae6;

  /* ── Semântica (suavizada para serenidade) ── */
  --ok:           #157a5b;  --ok-bg:   #e8f6f0;  --ok-line:  rgba(21,122,91,.18);
  --warn:         #9a6a12;  --warn-bg: #fbf2e3;  --warn-line:rgba(154,106,18,.20);
  --info:         #1668a3;  --info-bg: #e9f3fb;  --info-line:rgba(22,104,163,.18);
  --alert:        #b34a42;  --alert-bg:#fbeeec;  --alert-line:rgba(179,74,66,.18);
  --wpp:          #25a35a;  --wpp-hover:#1f8d4d;

  /* ── Sombras suaves e azuladas ── */
  --sh-xs:   0 1px 2px rgba(11,53,80,.05);
  --sh-sm:   0 2px 10px rgba(11,53,80,.06);
  --sh-md:   0 6px 22px rgba(11,53,80,.09);
  --sh-lg:   0 14px 44px rgba(11,53,80,.13);
  --sh-deep: 0 18px 50px rgba(6,33,47,.30);
  --sh-hover:0 12px 34px rgba(11,53,80,.14);

  /* ── Tipografia ── */
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* ── Raios ── */
  --r-xs: 6px; --r-sm: 9px; --r: 13px; --r-lg: 18px; --r-xl: 24px; --r-full: 999px;

  /* ── Movimento ── */
  --ease:  cubic-bezier(.33,.1,.25,1);
  --t:     .28s var(--ease);
  --t-fast:.16s var(--ease);
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--mist);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font-family: inherit; }

::selection { background: rgba(42,163,196,.18); color: var(--ink); }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; border: 2px solid var(--mist); }
::-webkit-scrollbar-thumb:hover { background: var(--aqua); }

/* ── Acessibilidade: foco visível e claro ── */
:focus-visible {
  outline: 3px solid var(--tide);
  outline-offset: 2px;
  border-radius: 4px;
}
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--tide);
  outline-offset: 2px;
}

/* Link "pular para o conteúdo" */
.skip-link {
  position: absolute;
  left: 12px; top: -56px;
  z-index: 999;
  background: var(--ocean);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--r);
  font-size: 13px; font-weight: 600;
  text-decoration: none;
  transition: top var(--t-fast);
  box-shadow: var(--sh-md);
}
.skip-link:focus { top: 12px; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ============================================================================
   FUNDO OCEÂNICO — gradiente sereno + ondas suaves
   ========================================================================== */
.ocean-bg::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 90% 55% at 12% -5%, rgba(42,163,196,.10) 0%, transparent 60%),
    radial-gradient(ellipse 70% 50% at 95% 100%, rgba(42,157,143,.08) 0%, transparent 62%),
    linear-gradient(180deg, var(--sky) 0%, var(--mist) 100%);
  pointer-events: none;
  z-index: 0;
}

/* Onda decorativa reutilizável (base de seções escuras) */
.wave {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  width: 100%; height: 38px;
  display: block;
  pointer-events: none;
}

/* ============================================================================
   HEADER
   ========================================================================== */
.app-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(245,250,252,.85);
  backdrop-filter: saturate(140%) blur(18px);
  -webkit-backdrop-filter: saturate(140%) blur(18px);
  border-bottom: 1px solid var(--line-soft);
}
.app-header__inner {
  max-width: 1080px; margin: 0 auto;
  padding: 0 28px; height: 68px;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand__mark { width: 42px; height: 42px; border-radius: 12px; overflow: hidden; flex-shrink: 0; box-shadow: var(--sh-sm); }
.brand__text { display: flex; flex-direction: column; line-height: 1.18; }
.brand__name { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--deep); letter-spacing: -.01em; }
.brand__sub  { font-size: 10px; color: var(--ink-soft); font-weight: 600; text-transform: uppercase; letter-spacing: .12em; }

.header-greeting {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 9px;
  font-size: 13px; color: var(--ink-3);
}
.header-greeting strong { color: var(--ink-2); font-weight: 600; }
.live-pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 0 rgba(42,157,143,.5); animation: livePulse 2.6s var(--ease) infinite; }
@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 rgba(42,157,143,.45); }
  70%  { box-shadow: 0 0 0 7px rgba(42,157,143,0); }
  100% { box-shadow: 0 0 0 0 rgba(42,157,143,0); }
}

.header-actions { display: flex; align-items: center; gap: 9px; }

/* ============================================================================
   BOTÕES
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: var(--r);
  font-family: var(--font-body); font-size: 13.5px; font-weight: 600;
  cursor: pointer; text-decoration: none; border: 1px solid transparent;
  transition: var(--t); white-space: nowrap; line-height: 1;
}
.btn:active { transform: translateY(1px); }

.btn--primary { background: linear-gradient(135deg, var(--ocean) 0%, var(--ocean-2) 100%); color: #fff; box-shadow: 0 4px 16px rgba(21,104,154,.26); }
.btn--primary:hover { box-shadow: 0 8px 24px rgba(21,104,154,.34); transform: translateY(-1px); }
.btn--primary:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn--ghost { background: var(--surface); color: var(--ink-2); border-color: var(--line); box-shadow: var(--sh-xs); }
.btn--ghost:hover { border-color: var(--aqua); color: var(--ocean); background: var(--foam); }

.btn--quiet { background: transparent; color: var(--ink-3); border-color: var(--line); }
.btn--quiet:hover { border-color: var(--aqua); color: var(--ocean); background: var(--foam); }

.btn--wpp { background: var(--wpp); color: #fff; box-shadow: 0 4px 16px rgba(37,163,90,.28); }
.btn--wpp:hover { background: var(--wpp-hover); transform: translateY(-1px); box-shadow: 0 8px 22px rgba(37,163,90,.34); }

.btn--exit { background: rgba(11,53,80,.06); color: var(--ink-3); border-color: var(--line); }
.btn--exit:hover { background: rgba(11,53,80,.10); color: var(--ink-2); }

.btn--block { width: 100%; }
.btn--lg { padding: 14px 22px; font-size: 14px; }

/* Botões claros sobre superfície escura */
.btn--on-deep { background: rgba(255,255,255,.08); color: var(--on-deep-2); border-color: rgba(255,255,255,.14); }
.btn--on-deep:hover { background: rgba(255,255,255,.14); color: #fff; }

/* ============================================================================
   CHIPS / BADGES
   ========================================================================== */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: var(--r-full);
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
  border: 1px solid transparent;
}
.badge__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--ok    { background: var(--ok-bg);    color: var(--ok);    border-color: var(--ok-line); }
.badge--warn  { background: var(--warn-bg);  color: var(--warn);  border-color: var(--warn-line); }
.badge--info  { background: var(--info-bg);  color: var(--info);  border-color: var(--info-line); }
.badge--alert { background: var(--alert-bg); color: var(--alert); border-color: var(--alert-line); }
.badge--neutral { background: var(--surface-2); color: var(--ink-3); border-color: var(--line); }
.badge--live  { background: rgba(42,157,143,.16); color: var(--teal-deep); border-color: rgba(42,157,143,.24); }

/* ============================================================================
   CARDS
   ========================================================================== */
.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
}
.card--pad { padding: 24px 26px; }

/* ============================================================================
   SEÇÕES
   ========================================================================== */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-title {
  font-family: var(--font-display); font-size: 20px; font-weight: 700;
  color: var(--ink); letter-spacing: -.015em;
  display: flex; align-items: center; gap: 12px;
}
.section-title__bar { width: 3px; height: 20px; border-radius: 99px; background: linear-gradient(180deg, var(--ocean), var(--teal)); flex-shrink: 0; }
.section-sub { font-size: 12.5px; color: var(--ink-soft); margin-left: 15px; margin-top: 4px; }

/* ============================================================================
   FOOTER
   ========================================================================== */
.app-footer { background: var(--abyss); padding: 26px 28px; position: relative; }
.app-footer__inner {
  max-width: 1080px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.app-footer__brand { font-family: var(--font-display); font-size: 13px; font-weight: 600; color: var(--on-deep-3); }
.app-footer__brand b { color: var(--aqua); font-weight: 700; }
.app-footer__meta { font-size: 11px; color: var(--on-deep-faint); }
.app-footer__secure { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: rgba(105,191,207,.55); }

/* ============================================================================
   SKELETON (carregamento)
   ========================================================================== */
.skeleton {
  background: linear-gradient(100deg, var(--line-soft) 30%, var(--foam) 50%, var(--line-soft) 70%);
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ============================================================================
   ANIMAÇÕES DE ENTRADA
   ========================================================================== */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.rise { animation: rise .5s var(--ease) both; }
.stagger > * { animation: rise .5s var(--ease) both; }
.stagger > *:nth-child(1) { animation-delay: .04s; }
.stagger > *:nth-child(2) { animation-delay: .10s; }
.stagger > *:nth-child(3) { animation-delay: .16s; }
.stagger > *:nth-child(4) { animation-delay: .22s; }
.stagger > *:nth-child(5) { animation-delay: .28s; }

/* ── Respeita quem prefere menos movimento ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Maior contraste para quem precisa ── */
@media (prefers-contrast: more) {
  :root { --ink-3: #3a5260; --ink-soft: #3a5260; --line: #9fbccb; }
}

/* ============================================================================
   UTILITÁRIOS
   ========================================================================== */
.flex { display: flex; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.mt-8 { margin-top: 8px; }
.hidden { display: none !important; }

/* ============================================================================
   MODO ESCURO — "mar à noite"
   Ativado por [data-theme="dark"] (toggle) ou prefers-color-scheme quando "auto".
   ========================================================================== */
[data-theme="dark"] {
  --abyss:        #03141d;
  --deep:         #082a3c;
  --deep-2:       #0c3a50;
  --mist:         #07202b;
  --sky:          #0a2733;
  --surface:      #0e2a36;
  --surface-2:    #123241;
  --foam:         #143a49;

  --ink:          #e9f3f6;
  --ink-2:        #c3d6dd;
  --ink-3:        #94aeb8;
  --ink-soft:     #738e98;
  --ink-faint:    #51707b;

  --line:         #1d404e;
  --line-soft:    #173542;
  --line-strong:  #2a5365;

  --ok-bg:    rgba(42,157,143,.16);  --ok-line:    rgba(42,157,143,.30);  --ok:    #6fd6c0;
  --warn-bg:  rgba(214,164,76,.16);  --warn-line:  rgba(214,164,76,.30);  --warn:  #e7c386;
  --info-bg:  rgba(42,163,196,.16);  --info-line:  rgba(42,163,196,.30);  --info:  #8fd0e2;
  --alert-bg: rgba(196,90,82,.16);   --alert-line: rgba(196,90,82,.32);   --alert: #e79c95;

  --sh-xs:   0 1px 2px rgba(0,0,0,.30);
  --sh-sm:   0 2px 10px rgba(0,0,0,.34);
  --sh-md:   0 6px 22px rgba(0,0,0,.40);
  --sh-lg:   0 14px 44px rgba(0,0,0,.48);
  --sh-hover:0 12px 34px rgba(0,0,0,.46);
}
[data-theme="dark"] body { background: var(--mist); }
[data-theme="dark"] .app-header { background: rgba(7,32,43,.82); }
[data-theme="dark"] .ocean-bg::before {
  background:
    radial-gradient(ellipse 90% 55% at 12% -5%, rgba(42,163,196,.14) 0%, transparent 60%),
    radial-gradient(ellipse 70% 50% at 95% 100%, rgba(42,157,143,.12) 0%, transparent 62%),
    linear-gradient(180deg, var(--sky) 0%, var(--mist) 100%);
}

/* ============================================================================
   CONTROLES DE CONFORTO (tema + tamanho de fonte) no header
   ========================================================================== */
.comfort-controls { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: var(--r-sm);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-3);
  cursor: pointer; font-size: 14px; transition: var(--t-fast); font-family: var(--font-body);
}
.icon-btn:hover { border-color: var(--aqua); color: var(--ocean); background: var(--foam); }
.icon-btn--sm { width: 32px; height: 32px; font-size: 12px; font-weight: 700; }

/* ============================================================================
   TOASTS
   ========================================================================== */
#portal-toasts {
  position: fixed; right: 18px; bottom: 18px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px; max-width: min(92vw, 360px);
}
.toast {
  display: flex; align-items: flex-start; gap: 11px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-left: 3px solid var(--ocean);
  border-radius: var(--r); padding: 13px 15px; box-shadow: var(--sh-lg);
  font-size: 13.5px; line-height: 1.45; animation: rise .3s var(--ease) both;
}
.toast i { margin-top: 1px; }
.toast--ok    { border-left-color: var(--ok); }    .toast--ok i    { color: var(--ok); }
.toast--err   { border-left-color: var(--alert); } .toast--err i   { color: var(--alert); }
.toast--info  { border-left-color: var(--info); }  .toast--info i  { color: var(--info); }
.toast--warn  { border-left-color: var(--warn); }  .toast--warn i  { color: var(--warn); }

/* ============================================================================
   CENTRAL DE DOCUMENTOS
   ========================================================================== */
.docs-list { display: flex; flex-direction: column; gap: 10px; }
.doc-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r); padding: 14px 16px; transition: var(--t-fast);
}
.doc-row:hover { border-color: rgba(42,163,196,.22); box-shadow: var(--sh-sm); }
.doc-row__icon {
  width: 40px; height: 40px; border-radius: var(--r-sm); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.doc-row__icon--ok   { background: var(--ok-bg);   color: var(--ok); }
.doc-row__icon--pend { background: var(--warn-bg); color: var(--warn); }
.doc-row__main { flex: 1; min-width: 0; }
.doc-row__name { font-size: 14px; font-weight: 600; color: var(--ink); }
.doc-row__meta { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.doc-row__action { flex-shrink: 0; }
.doc-empty { font-size: 13px; color: var(--ink-3); padding: 14px 2px; }
.file-input-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.upload-progress { height: 4px; border-radius: 99px; background: var(--line-soft); overflow: hidden; margin-top: 10px; display: none; }
.upload-progress.show { display: block; }
.upload-progress__bar { height: 100%; width: 30%; background: linear-gradient(90deg, var(--ocean), var(--teal)); border-radius: 99px; animation: indet 1.1s var(--ease) infinite; }
@keyframes indet { 0% { margin-left: -30%; } 100% { margin-left: 100%; } }

/* ============================================================================
   MODAL (aviso de sessão)
   ========================================================================== */
.portal-modal {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(6,33,47,.55); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.portal-modal.show { display: flex; }
.portal-modal__card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--sh-lg);
  max-width: 380px; width: 100%; padding: 28px; text-align: center;
  animation: rise .3s var(--ease) both;
}
.portal-modal__icon { font-size: 30px; color: var(--warn); margin-bottom: 12px; }
.portal-modal__title { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.portal-modal__text { font-size: 13.5px; color: var(--ink-3); line-height: 1.6; margin-bottom: 20px; }
.portal-modal__actions { display: flex; gap: 10px; }
.portal-modal__actions .btn { flex: 1; }

/* ============================================================================
   BOTÃO "INSTALAR APP" (PWA)
   ========================================================================== */
.install-banner {
  display: none; align-items: center; gap: 12px;
  background: var(--foam); border: 1px solid rgba(42,163,196,.22);
  border-radius: var(--r); padding: 12px 16px; margin-bottom: 18px;
}
.install-banner.show { display: flex; }
.install-banner__txt { flex: 1; font-size: 13px; color: var(--ink-2); }
.install-banner__txt b { color: var(--ink); }
