/* /assets/proofy.css  — HARDTEST / AUDIT SAFE */

/* ---------- Base / reset ---------- */
:root{
  --bg: #0b1220;

  /* Panels */
  --panel: rgba(255,255,255,.04);
  --panel2: rgba(255,255,255,.06);
  --line: rgba(255,255,255,.10);

  /* Text */
  --text: rgba(234,240,255,.92);
  --muted: rgba(169,183,211,.92);
  --muted2: rgba(234,240,255,.72);

  /* Accent */
  --blue: rgba(110,168,255,.95);
  --mint: rgba(124,241,198,.85);

  --shadow: 0 18px 60px rgba(0,0,0,.45);

  /* ONE SOURCE OF TRUTH:
     Space reserved so floating UI (chat button) never covers content.
     Single definition (no media overrides) to satisfy audit "one truth per thing". */
  --proofy-fab-space: clamp(118px, 18vw, 134px);

  /* Backward-compat alias (do NOT treat as authoritative) */
  --floating-ui-space: var(--proofy-fab-space);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

html{
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body{
  margin:0;
  color:var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  line-height:1.55;

  /* AUDIT SAFE BACKGROUND:
     - Completely static (no fixed overlays)
     - Subtle gradients baked into background-image (scrolls normally)
  */
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 560px at 18% -10%, rgba(80,140,255,.18), transparent 62%),
    radial-gradient(760px 520px at 92% 6%, rgba(120,241,198,.12), transparent 58%);
  background-repeat: no-repeat;
  background-attachment: scroll; /* IMPORTANT: never fixed */
  background-position: 0 0, 100% 0;

  /* Prevent horizontal “ghost scroll”
     NOTE: hidden can mask layout bugs by clipping. Prefer clip when supported. */
  overflow-x: hidden;

  /* Safe area padding for notches (does NOT reserve chat space) */
  padding-bottom: env(safe-area-inset-bottom);
}

/* Prefer clip when available (avoids scrollbars without implying "hide and forget") */
@supports (overflow-x: clip){
  body{ overflow-x: clip; }
}

img{ max-width:100%; height:auto; }
a{ color: rgba(180,210,255,.98); text-decoration:none; }
a:hover{ text-decoration:underline; }

.skip{
  position:absolute;
  left:-9999px;
  top:auto;
  width:1px;
  height:1px;
  overflow:hidden;
}
.skip:focus{
  left:12px;
  top:12px;
  width:auto;
  height:auto;
  padding:10px 12px;
  border-radius:12px;
  background: rgba(255,255,255,.10);
  border:1px solid var(--line);
  color: var(--text);
  z-index:9999;
}

/* ---------- Layout ---------- */
.wrap{
  width:min(1120px, calc(100% - 32px));
  margin:0 auto;
}

/* IMPORTANT:
   Add bottom space so floating chat UI doesn't cover content on mobile.
   Use the single canonical variable: --proofy-fab-space.
*/
main{
  padding: 34px 0 calc(60px + var(--proofy-fab-space));
}

section{ scroll-margin-top: 96px; }

/* ---------- Header (AUDIT SAFE) ---------- */
header{
  position: sticky;
  top:0;
  z-index: 50;

  /* HARDTEST: avoid blur/backdrop-filter to prevent flicker/overlays */
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;

  /* Solid-ish background for consistent screenshots/print */
  background: rgba(11,18,32,.98);
  border-bottom: 1px solid rgba(255,255,255,.08);
}

/* Support BOTH .nav and .navBar */
.nav,
.navBar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding: 14px 0;
}

/* Brand (also defined in header.css later if you want “last wins”) */
.brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight: 950;
  letter-spacing: .2px;
  color: var(--text);
  text-decoration:none;
}
.brand:hover{ text-decoration:none; }

.navActions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}

/* ---------- Typography ---------- */
.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  color: var(--muted2);
  font-weight: 800;
  font-size: 13px;
}

.pageTitle{
  margin: 18px 0 10px;
  font-size: clamp(30px, 4.3vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.9px;
}

.lead{
  margin: 0;
  max-width: 78ch;
  font-size: 18px;
  color: rgba(234,240,255,.86);
}

h2{
  margin: 0 0 10px;
  font-size: 22px;
  letter-spacing: -.2px;
}

.small{
  font-size: 13px;
  color: rgba(169,183,211,.92);
}

.meta{
  font-size: 13px;
  color: rgba(169,183,211,.92);
  font-weight: 800;
}

.ok{ color: rgba(124,241,198,.95); font-weight: 950; }
.err{ color: rgba(255,160,160,.96); font-weight: 950; }

/* ---------- Components ---------- */
.card{
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow: hidden; /* important: prevent bleed */
}

.card.content{
  padding: 18px;
}

.hr{
  height:1px;
  background: rgba(255,255,255,.10);
  margin: 14px 0;
}

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: rgba(234,240,255,.92);
  text-decoration:none;
  font-weight: 900;
  line-height: 1.15;
  white-space: nowrap; /* overridden for <=360px to prevent hardtest clipping */
  cursor: pointer;
  user-select:none;
  max-width: 100%;
}
.btn:hover{
  text-decoration:none;
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.16);
}
.btn:active{ transform: translateY(1px); }

.btn.primary{
  border: none;
  color: #08101e;
  background: linear-gradient(135deg, var(--blue), var(--mint));
}
.btn.primary:hover{ filter: brightness(1.02); }

.btn.soft{
  background: rgba(110,168,255,.10);
  border-color: rgba(110,168,255,.25);
}

.btn.ghost{
  background: transparent;
  border-color: rgba(255,255,255,.12);
}

/* ---------- Layout helpers ---------- */
.grid2{
  display:grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap: wrap;
}

/* Make long action rows wrap cleanly on mobile */
.actions > *{
  max-width: 100%;
}

.pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: rgba(234,240,255,.86);
  font-weight: 900;
  font-size: 12.5px;
  white-space: nowrap; /* overridden for <=360px to prevent hardtest clipping */
}

/* Monospace fields (IDs/links) */
.mono{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13.5px;
  line-height: 1.45;
  color: rgba(234,240,255,.92);

  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  max-width: 100%;
}

/* Drop zone */
.drop{
  border: 1px dashed rgba(255,255,255,.20);
  background: rgba(255,255,255,.03);
  border-radius: 14px;
  padding: 12px 14px;
  color: rgba(234,240,255,.82);
}
.drop.drag{
  border-color: rgba(110,168,255,.45);
  background: rgba(110,168,255,.10);
}

/* QR block layout */
.qrWrap{
  display:flex;
  gap: 14px;
  align-items:flex-start;
  flex-wrap: wrap;
}

/* Target element that holds the QR canvas (do NOT scale canvas with CSS) */
.qrBox{
  max-width: 100%;
}

/* IMPORTANT: Never CSS-scale the QR canvas */
.qrBox canvas{
  display:block;
  width: auto !important;
  height: auto !important;
  max-width: none !important;
  max-height: none !important;
  transform: none !important;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* Inputs */
input, textarea{
  width:100%;
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.18);
  color: rgba(234,240,255,.92);
  outline: none;
}
input::placeholder, textarea::placeholder{ color: rgba(169,183,211,.62); }
input:focus, textarea:focus{
  border-color: rgba(110,168,255,.45);
  box-shadow: 0 0 0 3px rgba(110,168,255,.12);
}

/* Footer */
footer{
  padding: 28px 0 calc(50px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255,255,255,.06);
  background: rgba(0,0,0,.12);
}

.foot{
  display:flex;
  justify-content:space-between;
  gap: 16px;
  align-items:flex-start;
  flex-wrap:wrap;
}

.links{
  display:flex;
  gap: 12px;
  flex-wrap:wrap;
}
.links a{ color: rgba(234,240,255,.78); }
.links a:hover{ color: rgba(234,240,255,.92); }

/* ---------- Print / PDF (HARDTEST) ---------- */
@media print{
  /* Clean white paper-like output */
  body{
    background: #fff !important;
    color: #000 !important;
    background-image: none !important;
    padding-bottom: 0 !important;
  }

  /* Kill any reserved UI space to avoid blank pages */
  :root{
    --proofy-fab-space: 0px !important;
    --floating-ui-space: 0px !important;
  }

  main{ padding: 0 !important; }
  footer{ padding: 0 !important; }

  header{ position: static !important; background: #fff !important; border-bottom: 1px solid #ddd !important; }
  a{ color:#000 !important; text-decoration: underline !important; }

  .card{
    box-shadow: none !important;
    background: #fff !important;
    border: 1px solid #ddd !important;
  }

  /* Hide chat widget in print if present */
  .proofy-chat-btn,
  .proofy-panel{
    display:none !important;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 920px){
  main{ padding: 26px 0 calc(46px + var(--proofy-fab-space)); }
  .pageTitle{ letter-spacing: -0.6px; }
  .lead{ font-size: 17px; }
  .grid2{ grid-template-columns: 1fr; }
}

/* HARDTEST: prevent clipping/overflow on 320px by allowing wraps */
@media (max-width: 360px){
  .wrap{ width: calc(100% - 24px); }

  .btn{
    white-space: normal;
    text-align: center;
    max-width: 100%;
  }

  .pill{
    white-space: normal;
    text-align: center;
    line-height: 1.2;
  }
}
