/* =========================================================
   Portal do Cliente — UI 2026 (mobile-first fintech)
   ========================================================= */
:root {
  --bg: #f1f5f9;
  --bg-elevated: #ffffff;
  --ink: #0f172a;
  --ink-soft: #475569;
  --muted: #94a3b8;
  --line: #e2e8f0;
  --primary: #2563eb;
  --primary-soft: #eff6ff;
  --primary-deep: #1d4ed8;
  --pix: #00b37e;
  --pix-soft: #ecfdf5;
  --pix-deep: #059669;
  --warn: #f59e0b;
  --warn-soft: #fffbeb;
  --danger: #ef4444;
  --danger-soft: #fef2f2;
  --ok: #16a34a;
  --ok-soft: #f0fdf4;
  --info: #0ea5e9;
  --info-soft: #f0f9ff;
  --radius: 18px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, .12);
  --nav-h: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
}

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-deep); }
img { max-width: 100%; display: block; }
button, input, textarea { font-family: inherit; }

/* ---------- Shell autenticado ---------- */
.pc-app {
  min-height: 100vh;
  padding-bottom: calc(88px + var(--safe-bottom));
}

.pc-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(226, 232, 240, .9);
}

.pc-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.pc-brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(37, 99, 235, .28);
}

.pc-brand-text {
  min-width: 0;
}

.pc-brand-text strong {
  display: block;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pc-brand-text span {
  display: block;
  font-size: 12px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pc-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pc-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: .2s ease;
}
.pc-icon-btn:hover {
  border-color: #cbd5e1;
  color: var(--ink);
  background: #f8fafc;
}

.pc-container {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 20px 16px 8px;
}

/* ---------- Hero / greeting ---------- */
.pc-hero {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  padding: 22px 20px;
  margin-bottom: 18px;
  color: #fff;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(56, 189, 248, .35), transparent 45%),
    linear-gradient(145deg, #0f172a 0%, #1e3a8a 48%, #2563eb 100%);
  box-shadow: var(--shadow-lg);
}

.pc-hero::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -30px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  pointer-events: none;
}

.pc-hero-kicker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .75;
  margin-bottom: 6px;
}

.pc-hero h1 {
  margin: 0 0 6px;
  font-size: clamp(1.35rem, 4vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.2;
}

.pc-hero p {
  margin: 0;
  opacity: .85;
  font-size: 14px;
  max-width: 36ch;
  line-height: 1.5;
}

/* ---------- Stats ---------- */
.pc-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.pc-stat {
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 14px;
  padding: 10px 12px;
  backdrop-filter: blur(8px);
}

.pc-stat .label {
  font-size: 11px;
  opacity: .75;
  font-weight: 600;
}

.pc-stat .value {
  margin-top: 2px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.02em;
}

/* ---------- Tabs ---------- */
.pc-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 12px;
  margin: 0 0 8px;
  scrollbar-width: none;
}
.pc-tabs::-webkit-scrollbar { display: none; }

.pc-tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: .2s ease;
  white-space: nowrap;
}
.pc-tab:hover { color: var(--ink); border-color: #cbd5e1; }
.pc-tab.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.pc-tab .count {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: var(--radius-pill);
  display: inline-grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  background: #f1f5f9;
  color: var(--ink-soft);
}
.pc-tab.active .count {
  background: rgba(255, 255, 255, .18);
  color: #fff;
}

/* ---------- Cards de parcela ---------- */
.pc-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pc-card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.pc-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(15, 23, 42, .08);
}

.pc-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.pc-card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.pc-card-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 500;
}

.pc-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
  white-space: nowrap;
}
.pc-badge.ok { background: var(--ok-soft); color: #15803d; }
.pc-badge.warn { background: var(--warn-soft); color: #b45309; }
.pc-badge.info { background: var(--info-soft); color: #0369a1; }
.pc-badge.open { background: #f1f5f9; color: #475569; }
.pc-badge.late { background: #f8fafc; color: #334155; border: 1px solid #e2e8f0; }
.pc-badge.danger { background: var(--danger-soft); color: #b91c1c; }

.pc-grid-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.pc-meta-item {
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  padding: 10px 12px;
}
.pc-meta-item .k {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 2px;
}
.pc-meta-item .v {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.pc-meta-item .v.danger { color: var(--danger); }

.pc-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.pc-amount {
  display: flex;
  flex-direction: column;
}
.pc-amount .label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.pc-amount .value {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--ink);
}

.pc-btn {
  appearance: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -.01em;
  transition: .2s ease;
  text-decoration: none;
  line-height: 1;
}
.pc-btn:disabled { opacity: .55; cursor: not-allowed; }

.pc-btn-pix {
  background: linear-gradient(135deg, #00c896, #00a884);
  color: #fff !important;
  box-shadow: 0 8px 20px rgba(0, 168, 132, .28);
}
.pc-btn-pix:hover {
  filter: brightness(1.05);
  color: #fff !important;
  transform: translateY(-1px);
}

.pc-btn-primary {
  background: var(--primary);
  color: #fff !important;
  box-shadow: 0 8px 20px rgba(37, 99, 235, .25);
}
.pc-btn-primary:hover {
  background: var(--primary-deep);
  color: #fff !important;
}

.pc-btn-secondary {
  background: #fff;
  color: var(--ink) !important;
  border: 1px solid var(--line);
}
.pc-btn-secondary:hover {
  background: #f8fafc;
  color: var(--ink) !important;
}

.pc-btn-ghost {
  background: transparent;
  color: var(--ink-soft) !important;
  border: 1px solid transparent;
}
.pc-btn-ghost:hover {
  background: #f8fafc;
  color: var(--ink) !important;
}

.pc-btn-block { width: 100%; }

/* ---------- Empty ---------- */
.pc-empty {
  text-align: center;
  padding: 48px 20px;
  background: var(--bg-elevated);
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius);
  color: var(--ink-soft);
}
.pc-empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 16px;
  background: #f1f5f9;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 22px;
}
.pc-empty strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  margin-bottom: 4px;
}

/* ---------- Bottom nav ---------- */
.pc-bottomnav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(12px + var(--safe-bottom));
  width: min(420px, calc(100% - 24px));
  height: 64px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 6px;
  background: rgba(15, 23, 42, .94);
  border-radius: 20px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, .28);
  z-index: 60;
  backdrop-filter: blur(12px);
}

.pc-bottomnav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 14px;
  color: rgba(255, 255, 255, .55);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  transition: .2s ease;
}
.pc-bottomnav a i { font-size: 16px; }
.pc-bottomnav a.active,
.pc-bottomnav a:hover {
  background: rgba(255, 255, 255, .1);
  color: #fff;
}

/* ---------- Alertas ---------- */
.pc-alert {
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: 14px;
}
.pc-alert-danger {
  background: var(--danger-soft);
  color: #b91c1c;
  border: 1px solid #fecaca;
}
.pc-alert-warn {
  background: var(--warn-soft);
  color: #b45309;
  border: 1px solid #fde68a;
}
.pc-alert-ok {
  background: var(--ok-soft);
  color: #15803d;
  border: 1px solid #bbf7d0;
}
.pc-alert-info {
  background: var(--primary-soft);
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

/* ---------- Página PIX ---------- */
.pc-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 14px;
}
.pc-back:hover { color: var(--ink); }

.pc-pix-shell {
  width: min(480px, 100%);
  margin: 0 auto;
}

.pc-pix-card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px 20px;
  box-shadow: var(--shadow);
}

.pc-pix-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.pc-pix-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: var(--pix-soft);
  color: var(--pix);
  display: grid;
  place-items: center;
  font-size: 22px;
}
.pc-pix-head h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.02em;
}
.pc-pix-head p {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--ink-soft);
}

.pc-pix-amount {
  text-align: center;
  padding: 8px 0 16px;
}
.pc-pix-amount .label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.pc-pix-amount .value {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -.04em;
  color: var(--ink);
  margin-top: 2px;
}

.pc-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: var(--warn-soft);
  color: #b45309;
  font-size: 12px;
  font-weight: 800;
  margin: 0 auto 18px;
}
.pc-status-wrap { text-align: center; }
.pc-status.ok {
  background: var(--ok-soft);
  color: #15803d;
}
.pc-status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 1.4s ease infinite;
}
.pc-status.ok .dot { animation: none; }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .45; transform: scale(.85); }
}

.pc-qr {
  width: min(240px, 70vw);
  margin: 0 auto 18px;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: inset 0 0 0 1px #f8fafc;
}
.pc-qr img {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.pc-copy-box {
  margin-bottom: 14px;
}
.pc-copy-box label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.pc-copy-box textarea {
  width: 100%;
  min-height: 96px;
  resize: none;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #f8fafc;
  padding: 12px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink);
  outline: none;
}
.pc-copy-box textarea:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
  background: #fff;
}

.pc-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pc-hint {
  margin-top: 16px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

/* Toast */
.pc-toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + var(--safe-bottom));
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: .25s ease;
  z-index: 80;
  box-shadow: var(--shadow-lg);
}
.pc-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Login (sem auth) ---------- */
.pc-auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(37, 99, 235, .18), transparent 55%),
    radial-gradient(700px 400px at 100% 100%, rgba(14, 165, 233, .14), transparent 50%),
    linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
}

.pc-auth-card {
  width: min(420px, 100%);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(226, 232, 240, .9);
  border-radius: 28px;
  padding: 32px 28px;
  box-shadow: var(--shadow-lg);
}

.pc-auth-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 20px;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 26px;
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(37, 99, 235, .3);
}

.pc-auth-card h1 {
  margin: 0 0 6px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -.03em;
}

.pc-auth-card .subtitle {
  text-align: center;
  color: var(--ink-soft);
  font-size: 14px;
  margin: 0 0 24px;
  line-height: 1.5;
}

.pc-field { margin-bottom: 16px; }
.pc-field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}
.pc-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 14px;
  transition: .2s ease;
}
.pc-input-wrap:focus-within {
  background: #fff;
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}
.pc-input-wrap i { color: var(--muted); }
.pc-input-wrap input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  padding: 14px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: .02em;
}
.pc-input-wrap input::placeholder {
  color: #94a3b8;
  font-weight: 500;
  letter-spacing: 0;
}

.pc-auth-footer {
  margin-top: 18px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.pc-auth-footer a {
  color: var(--primary);
  font-weight: 700;
}

.pc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 18px;
}
.pc-chip {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
  background: #f1f5f9;
  border-radius: var(--radius-pill);
  padding: 6px 10px;
}

@media (min-width: 768px) {
  .pc-container { padding: 28px 24px 16px; }
  .pc-card { padding: 18px 20px; }
  .pc-bottomnav { width: min(360px, calc(100% - 24px)); }
}

@media (max-width: 380px) {
  .pc-stats { grid-template-columns: 1fr; }
  .pc-grid-meta { grid-template-columns: 1fr; }
  .pc-pix-amount .value { font-size: 30px; }
}
