/* =========================================================================
   PlusFax design system — layered on Bootstrap 5.3
   Palette: deep navy ink, teal signal accent, warm paper surfaces.
   ========================================================================= */
:root {
  --fb-navy: #12213f;
  --fb-navy-2: #1b2f57;
  --fb-ink: #16213a;
  --fb-muted: #5b6478;
  --fb-line: #e3e6ee;
  --fb-paper: #f7f6f2;
  --fb-surface: #ffffff;
  --fb-teal: #0f9d8f;
  --fb-teal-dark: #0b7f74;
  --fb-teal-soft: #e3f5f2;
  --fb-amber: #f2a93b;
  --fb-amber-soft: #fff3dc;
  --fb-red: #d64545;
  --fb-red-soft: #fde8e8;
  --fb-blue-soft: #e6eefb;
  --fb-radius: 14px;
  --fb-shadow: 0 1px 2px rgba(18,33,63,.06), 0 8px 24px -12px rgba(18,33,63,.18);
  --bs-primary: var(--fb-teal);
  --bs-primary-rgb: 15,157,143;
  --bs-body-color: var(--fb-ink);
  --bs-body-bg: var(--fb-paper);
  --bs-link-color: var(--fb-teal-dark);
  --bs-link-hover-color: var(--fb-navy);
  --bs-link-color-rgb: 11,127,116;
  --bs-link-hover-color-rgb: 18,33,63;
  --bs-font-sans-serif: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-border-color: var(--fb-line);
}
html { scroll-behavior: smooth; }
body { font-family: var(--bs-font-sans-serif); color: var(--fb-ink); background: var(--fb-paper); -webkit-font-smoothing: antialiased; }
h1, h2, h3, .display-font { font-family: "Fraunces", Georgia, serif; font-weight: 600; letter-spacing: -.01em; color: var(--fb-navy); }
h4, h5, h6 { font-weight: 600; color: var(--fb-navy); }
.lead { color: var(--fb-muted); font-weight: 400; }
.text-muted { color: var(--fb-muted) !important; }
.small-caps { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; color: var(--fb-teal-dark); }
a { text-decoration: none; }
a:hover { text-decoration: underline; }
/* Inline icons: default to text size; larger contexts override below. */
svg[aria-hidden="true"] { width: 1.1em; height: 1.1em; vertical-align: -0.2em; flex-shrink: 0; }
.feature .icon svg { width: 22px; height: 22px; }
.dz-icon svg { width: 48px; height: 48px; }
.btn svg { margin-right: .25rem; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .875em; }

/* Buttons ---------------------------------------------------------------- */
.btn { border-radius: 10px; font-weight: 600; padding: .6rem 1.1rem; }
.btn-sm { padding: .35rem .75rem; font-size: .85rem; }
.btn-lg { padding: .85rem 1.5rem; font-size: 1.05rem; }
.btn-primary { background: var(--fb-teal); border-color: var(--fb-teal); color: #fff; }
.btn-primary:hover, .btn-primary:focus { background: var(--fb-teal-dark); border-color: var(--fb-teal-dark); color: #fff; }
.btn-primary:disabled, .btn-primary.disabled { background: var(--fb-teal); border-color: var(--fb-teal); color: #fff; opacity: .55; }
.btn-navy:disabled, .btn-outline-navy:disabled { opacity: .55; }
.btn-navy { background: var(--fb-navy); border-color: var(--fb-navy); color: #fff; }
.btn-navy:hover { background: var(--fb-navy-2); border-color: var(--fb-navy-2); color: #fff; }
.btn-outline-navy { border-color: var(--fb-navy); color: var(--fb-navy); }
.btn-outline-navy:hover { background: var(--fb-navy); color: #fff; }
.btn-soft { background: var(--fb-teal-soft); color: var(--fb-teal-dark); border-color: transparent; }
.btn-soft:hover { background: #cfeee9; color: var(--fb-teal-dark); }
.btn-link { font-weight: 500; }

/* Navbar ----------------------------------------------------------------- */
.fb-nav { background: rgba(247,246,242,.9); backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid var(--fb-line); }
.fb-nav .nav-link { color: var(--fb-ink); font-weight: 500; padding: .5rem .9rem; }
.fb-nav .nav-link:hover, .fb-nav .nav-link.active { color: var(--fb-teal-dark); }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-family: "Fraunces", Georgia, serif; font-weight: 700; font-size: 1.35rem; color: var(--fb-navy); }
.brand:hover { text-decoration: none; color: var(--fb-navy); }
.brand svg, .brand .brand-mark { width: 32px; height: 32px; }
.brand .accent { color: var(--fb-teal); }

/* Hero ------------------------------------------------------------------- */
.hero { padding: 5.5rem 0 4rem; position: relative; overflow: hidden; }
.hero h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); line-height: 1.08; }
.hero .eyebrow { display: inline-flex; align-items: center; gap: .5rem; background: var(--fb-teal-soft); color: var(--fb-teal-dark); border-radius: 999px; padding: .35rem .9rem; font-size: .85rem; font-weight: 600; }
.hero-grid { position: absolute; inset: 0; background-image: linear-gradient(var(--fb-line) 1px, transparent 1px), linear-gradient(90deg, var(--fb-line) 1px, transparent 1px); background-size: 48px 48px; opacity: .35; mask-image: radial-gradient(ellipse at 70% 20%, #000 10%, transparent 70%); pointer-events: none; }
.hero-card { background: var(--fb-surface); border: 1px solid var(--fb-line); border-radius: var(--fb-radius); box-shadow: var(--fb-shadow); }
.trust-row { display: flex; flex-wrap: wrap; gap: 1.25rem; color: var(--fb-muted); font-size: .9rem; }
.trust-row span { display: inline-flex; align-items: center; gap: .4rem; }

/* Cards & surfaces ------------------------------------------------------- */
.card { border: 1px solid var(--fb-line); border-radius: var(--fb-radius); box-shadow: var(--fb-shadow); background: var(--fb-surface); }
.card-header { background: transparent; border-bottom: 1px solid var(--fb-line); font-weight: 600; padding: 1rem 1.25rem; }
.card-body { padding: 1.25rem; }
.section { padding: 4.5rem 0; }
.section-title { margin-bottom: 2.5rem; }
.feature { display: flex; gap: 1rem; }
.feature .icon { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 12px; background: var(--fb-teal-soft); color: var(--fb-teal-dark); display: grid; place-items: center; }
.feature h5 { margin-bottom: .25rem; }
.step { position: relative; padding-left: 3.25rem; }
.step .num { position: absolute; left: 0; top: 0; width: 40px; height: 40px; border-radius: 50%; background: var(--fb-navy); color: #fff; display: grid; place-items: center; font-weight: 700; font-family: "Fraunces", Georgia, serif; }

/* Pricing ---------------------------------------------------------------- */
.pricing-card { position: relative; height: 100%; }
.pricing-card.featured { border-color: var(--fb-teal); box-shadow: 0 0 0 3px var(--fb-teal-soft), var(--fb-shadow); }
.pricing-card .ribbon { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--fb-teal); color: #fff; font-size: .75rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: .25rem .8rem; border-radius: 999px; }
.price { font-family: "Fraunces", Georgia, serif; font-size: 2.6rem; font-weight: 600; color: var(--fb-navy); line-height: 1; }
.price small { font-family: var(--bs-font-sans-serif); font-size: 1rem; color: var(--fb-muted); font-weight: 500; }
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { padding: .35rem 0 .35rem 1.75rem; position: relative; }
.check-list li::before { content: ""; position: absolute; left: 0; top: .6rem; width: 18px; height: 18px; border-radius: 50%; background: var(--fb-teal-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%230b7f74' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-6'/%3E%3C/svg%3E") center/12px no-repeat; }

/* Forms ------------------------------------------------------------------ */
.form-control, .form-select { border-radius: 10px; border-color: #cfd4df; padding: .65rem .9rem; }
.form-control:focus, .form-select:focus { border-color: var(--fb-teal); box-shadow: 0 0 0 .2rem rgba(15,157,143,.18); }
.form-label { font-weight: 600; font-size: .9rem; color: var(--fb-navy); }
.form-text { color: var(--fb-muted); }
.input-group-text { border-radius: 10px; background: #f1f3f8; border-color: #cfd4df; }
.dropzone { border: 2px dashed #c3cad8; border-radius: var(--fb-radius); background: #fbfbf9; padding: 2rem 1.25rem; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.drag { border-color: var(--fb-teal); background: var(--fb-teal-soft); }
.dropzone input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone .dz-icon { width: 48px; height: 48px; margin: 0 auto .75rem; color: var(--fb-teal-dark); }
.dz-files { text-align: left; margin-top: 1rem; }
.dz-files .file { display: flex; align-items: center; gap: .6rem; padding: .5rem .75rem; background: #fff; border: 1px solid var(--fb-line); border-radius: 10px; margin-top: .4rem; font-size: .9rem; }
.dz-files .file .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* Badges ----------------------------------------------------------------- */
.badge-status { display: inline-block; padding: .3rem .65rem; border-radius: 999px; font-size: .75rem; font-weight: 700; letter-spacing: .02em; }
.badge-success { background: var(--fb-teal-soft); color: var(--fb-teal-dark); }
.badge-danger { background: var(--fb-red-soft); color: var(--fb-red); }
.badge-warning { background: var(--fb-amber-soft); color: #9a5b00; }
.badge-info { background: var(--fb-blue-soft); color: #2a4f9b; }
.badge-neutral { background: #eceef3; color: var(--fb-muted); }
.pulse::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-right: .4rem; animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100% { opacity: .35 } 50% { opacity: 1 } }

/* Alerts ----------------------------------------------------------------- */
.alert { border-radius: 12px; border: 1px solid transparent; }
.alert-success { background: var(--fb-teal-soft); color: var(--fb-teal-dark); border-color: #bfe6df; }
.alert-danger { background: var(--fb-red-soft); color: #9b2c2c; border-color: #f5c6c6; }
.alert-warning { background: var(--fb-amber-soft); color: #7a4a00; border-color: #f6dfb4; }
.alert-info { background: var(--fb-blue-soft); color: #23448a; border-color: #cfdcf5; }

/* Tables ----------------------------------------------------------------- */
.table { --bs-table-bg: transparent; }
.table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--fb-muted); border-bottom: 1px solid var(--fb-line); font-weight: 600; }
.table td { vertical-align: middle; border-color: var(--fb-line); }
.table-hover tbody tr:hover { background: #f6f8fb; }

/* App shell (customer + admin) ------------------------------------------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 250px; flex: 0 0 250px; background: var(--fb-navy); color: #cbd3e3; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { color: #fff; padding: 1.25rem 1.25rem .75rem; }
.sidebar .brand { color: #fff; }
.sidebar .brand .accent { color: #2fc4b4; }
.sidebar nav { padding: .5rem .75rem; flex: 1; overflow-y: auto; }
.sidebar .nav-link { display: flex; align-items: center; gap: .7rem; color: #c3cce0; border-radius: 10px; padding: .6rem .85rem; font-weight: 500; margin-bottom: .15rem; }
.sidebar .nav-link svg { width: 18px; height: 18px; opacity: .85; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.sidebar .nav-link.active { background: var(--fb-teal); color: #fff; }
.sidebar .nav-heading { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: #7f8cab; padding: 1rem .85rem .35rem; }
.sidebar .sidebar-foot { padding: 1rem 1.25rem; border-top: 1px solid rgba(255,255,255,.08); font-size: .85rem; }
.sidebar.admin { background: #0b1326; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { background: var(--fb-surface); border-bottom: 1px solid var(--fb-line); padding: .75rem 1.5rem; display: flex; align-items: center; gap: 1rem; }
.topbar .balance { background: var(--fb-teal-soft); color: var(--fb-teal-dark); border-radius: 999px; padding: .35rem .85rem; font-weight: 600; font-size: .9rem; }
.content { padding: 1.75rem 1.5rem 3rem; max-width: 1240px; width: 100%; }
.page-title { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.page-title h1 { font-size: 1.7rem; margin: 0; }
.stat { background: var(--fb-surface); border: 1px solid var(--fb-line); border-radius: var(--fb-radius); padding: 1.1rem 1.25rem; box-shadow: var(--fb-shadow); height: 100%; }
.stat .label { font-size: .8rem; color: var(--fb-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.stat .value { font-family: "Fraunces", Georgia, serif; font-size: 1.9rem; font-weight: 600; color: var(--fb-navy); line-height: 1.2; }
.stat .sub { font-size: .85rem; color: var(--fb-muted); }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: .45rem 1rem; font-size: .95rem; }
.kv dt { color: var(--fb-muted); font-weight: 500; }
.kv dd { margin: 0; }
.progress { height: 8px; border-radius: 99px; background: #e9ecf3; }
.progress-bar { background: var(--fb-teal); }
.empty { text-align: center; padding: 3rem 1rem; color: var(--fb-muted); }
.empty svg { width: 48px; height: 48px; margin-bottom: .75rem; opacity: .5; display: block; margin-left: auto; margin-right: auto; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 120px; }
.bars .bar { flex: 1; background: var(--fb-teal); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; }
.bars .bar span { position: absolute; bottom: -1.4rem; left: 0; right: 0; text-align: center; font-size: .65rem; color: var(--fb-muted); }
.check-ok { color: var(--fb-teal-dark); }
.check-bad { color: var(--fb-red); }
.copy-field { display: flex; gap: .5rem; align-items: center; }
.copy-field code { flex: 1; background: #f1f3f8; padding: .5rem .75rem; border-radius: 8px; overflow: auto; white-space: nowrap; }
.secret-note { font-size: .8rem; color: var(--fb-muted); }

/* Auth ------------------------------------------------------------------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card .card-body { padding: 2rem; }

/* Footer ----------------------------------------------------------------- */
.footer { background: var(--fb-navy); color: #aab4cc; padding: 3rem 0 2rem; margin-top: 3rem; }
.footer a { color: #d8deeb; }
.footer .brand { color: #fff; }
.footer h6 { color: #fff; font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: .4rem; }

/* Status timeline -------------------------------------------------------- */
.timeline { list-style: none; padding: 0; margin: 0; display: flex; gap: 0; }
.timeline li { flex: 1; text-align: center; position: relative; padding-top: 1.75rem; font-size: .8rem; color: var(--fb-muted); }
.timeline li::before { content: ""; position: absolute; top: .45rem; left: 50%; transform: translateX(-50%); width: 14px; height: 14px; border-radius: 50%; background: #d9dde6; z-index: 1; }
.timeline li::after { content: ""; position: absolute; top: .85rem; left: 50%; right: -50%; height: 2px; background: #d9dde6; }
.timeline li:last-child::after { display: none; }
.timeline li.done::before, .timeline li.done::after { background: var(--fb-teal); }
.timeline li.done { color: var(--fb-teal-dark); font-weight: 600; }
.timeline li.failed::before { background: var(--fb-red); }

/* Install ---------------------------------------------------------------- */
.install-wrap { max-width: 760px; margin: 3rem auto; }

/* Responsive ------------------------------------------------------------- */
@media (max-width: 991.98px) {
  .sidebar { position: fixed; left: -260px; z-index: 1040; transition: left .2s; height: 100vh; }
  .sidebar.open { left: 0; box-shadow: 0 0 0 100vw rgba(0,0,0,.4); }
  .content { padding: 1.25rem 1rem 3rem; }
  .kv { grid-template-columns: 1fr; gap: .1rem .5rem; }
  .kv dt { margin-top: .5rem; }
  .hero { padding: 3.5rem 0 2.5rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .pulse::before { animation: none; } }

/* Utility classes replacing inline styles (CSP: no style attributes) --------- */
.mw-160 { max-width: 160px; } .mw-180 { max-width: 180px; } .mw-200 { max-width: 200px; } .mw-220 { max-width: 220px; }
.mw-360 { max-width: 360px; } .mw-480 { max-width: 480px; } .mw-520 { max-width: 520px; } .mw-600 { max-width: 600px; }
.mw-620 { max-width: 620px; } .mw-640 { max-width: 640px; }
.log-tail { max-height: 420px; overflow: auto; }
.text-prewrap { white-space: pre-wrap; }
.sidebar-link { color: #c3cce0; } .sidebar-link:hover { color: #fff; }
.sidebar-muted { color: #8e9bbd; }
.footer-line { border-top: 1px solid rgba(255,255,255,.15); }
