:root{
  --ink:#0f172a;
  --muted:#64748b;
  --line:#e2e8f0;
  --soft:#f8fafc;
  --brand:#0ea5e9;
  --brand-dark:#0284c7;
  --brand-light:#38bdf8;
  --accent:#ec4899;
  --success:#10b981;
  --danger:#ef4444;
  --paper:#ffffff;
  --bg-gradient:linear-gradient(135deg, #06b6d4 0%, #0284c7 100%);
  --radius:16px;
  --shadow:0 4px 20px rgba(14, 165, 233, 0.12);
  --shadow-lg:0 20px 50px rgba(14, 165, 233, 0.2);
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: 'Inter', ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--sans);
  color:var(--ink);
  line-height:1.6;
  font-size:15px;
  background:linear-gradient(135deg, #f5f3ff 0%, #faf5ff 50%, #fdf4ff 100%);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

a{color:inherit}

.page{
  max-width:1200px;
  margin:40px auto;
  padding:0 24px 60px;
}

.sheet{
  background:var(--paper);
  border:1px solid rgba(14, 165, 233, 0.1);
  border-radius:24px;
  box-shadow:var(--shadow-lg);
  overflow:hidden;
  backdrop-filter:blur(10px);
}

.topbar{
  display:flex;
  gap:20px;
  align-items:stretch;
  justify-content:space-between;
  padding:28px 32px;
  border-bottom:1px solid rgba(14, 165, 233, 0.15);
  background:linear-gradient(135deg, rgba(14, 165, 233, 0.08) 0%, rgba(236, 72, 153, 0.05) 100%);
  position:relative;
}

.topbar::after{
  content:'';
  position:absolute;
  bottom:0;
  left:0;
  right:0;
  height:3px;
  background:var(--bg-gradient);
}

.clientblock{
  display:flex;
  gap:14px;
  align-items:center;
  min-width:320px;
}

.clienttext .eyebrow{
  font-size:11px;
  letter-spacing:.9px;
  text-transform:uppercase;
  color:var(--muted);
}

.clienttext .clientname{
  margin-top:5px;
  font-weight:800;
  font-size:17px;
  letter-spacing:-.02em;
  background:var(--bg-gradient);
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
  background-clip:text;
}

.clienttext .clientmeta{
  margin-top:3px;
  color:var(--muted);
  font-size:12.5px;
}

.issuer{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  text-align:right;
  gap:6px;
}

.issuername{
  font-size:18px;
  font-weight:900;
  letter-spacing:-.02em;
  background:linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
  background-clip:text;
}

.issuermeta{
  margin-top:-2px;
  color:var(--muted);
  font-size:12.5px;
}

.logo{
  width:52px;
  height:52px;
  border-radius:14px;
  background:var(--bg-gradient);
  box-shadow:0 8px 24px rgba(14, 165, 233, 0.35);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  font-size:22px;
  color:#fff;
}



.badges{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:flex-start;
  justify-content:flex-end;
}

.badge{
  border:1px solid rgba(14, 165, 233, 0.2);
  background:rgba(255, 255, 255, 0.8);
  backdrop-filter:blur(10px);
  border-radius:999px;
  padding:8px 14px;
  font-size:12.5px;
  color:var(--muted);
  display:flex;
  gap:8px;
  align-items:center;
  font-weight:500;
}
.badge strong{
  color:var(--brand);
  font-weight:700;
}

.header{
  padding:32px 32px 20px;
}

.header h2{
  margin:0;
  font-size:28px;
  font-weight:800;
  letter-spacing:-.03em;
  color:var(--ink);
  line-height:1.2;
}
.header p{
  margin:12px 0 0;
  color:var(--muted);
  max-width:900px;
  line-height:1.7;
  font-size:16px;
}

.grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:20px;
  padding:20px 32px 28px;
}

.card{
  border:1px solid rgba(14, 165, 233, 0.12);
  border-radius:20px;
  padding:24px;
  background:linear-gradient(135deg, #ffffff 0%, #fefeff 100%);
  box-shadow:0 2px 12px rgba(14, 165, 233, 0.06);
  transition:all 0.3s ease;
}

.card:hover{
  box-shadow:0 8px 24px rgba(14, 165, 233, 0.12);
  transform:translateY(-2px);
}

.card h3{
  margin:0 0 10px;
  font-size:15px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:1.2px;
  color:var(--brand);
}
.card .hint{
  margin:0 0 16px;
  color:var(--muted);
  font-size:14px;
  line-height:1.6;
}

.kv{
  display:grid;
  grid-template-columns:160px 1fr;
  gap:10px;
  align-items:center;
}

.kv .k{color:var(--muted);font-size:12.5px}
.kv .v{font-family:var(--mono);font-size:12.5px;color:#0b1220}

.section{
  padding:0 32px 28px;
}

.sectionTitle{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:16px;
  margin:32px 0 16px;
  padding-bottom:12px;
  border-bottom:2px solid rgba(14, 165, 233, 0.1);
}

.sectionTitle h3{
  margin:0;
  font-size:16px;
  font-weight:800;
  letter-spacing:1px;
  text-transform:uppercase;
  color:var(--brand-dark);
}

.sectionTitle .sub{
  color:var(--muted);
  font-size:14px;
  font-weight:500;
}

.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  border:1px solid rgba(14, 165, 233, 0.12);
  border-radius:20px;
  overflow:hidden;
  box-shadow:0 2px 8px rgba(14, 165, 233, 0.04);
}

/*
  Form-first “invoice rows”:
  Put the response field UNDER the question text.
  This makes the questionnaire much easier to fill on phones and when printing.
*/
.table thead{display:none}

.table tbody tr{
  display:grid;
  grid-template-columns:80px 1fr 150px;
  grid-template-areas:
    "no question pri"
    "response response response";
  gap:14px 16px;
  padding:20px 18px;
  border-bottom:1px solid rgba(14, 165, 233, 0.08);
  transition:background 0.2s ease;
}

.table tbody tr:hover{
  background:rgba(14, 165, 233, 0.02);
}

.table tbody tr:last-child{border-bottom:0}

.table tbody td{
  border-bottom:0;
  padding:0;
  vertical-align:top;
}

.table tbody td:nth-child(1){grid-area:no}
.table tbody td:nth-child(2){
  grid-area:question;
  font-weight:600;
  color:var(--ink);
  font-size:15px;
  line-height:1.5;
}
.table tbody td:nth-child(3){grid-area:pri; justify-self:end}
.table tbody td:nth-child(4){grid-area:response}

.table tbody td:nth-child(4) input,
.table tbody td:nth-child(4) select,
.table tbody td:nth-child(4) textarea{
  width:100%;
}

.col-no{width:56px;color:var(--muted);font-family:var(--mono);font-size:12.5px}
.col-pri{width:120px}

.pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid rgba(14, 165, 233, 0.2);
  border-radius:999px;
  padding:5px 12px;
  font-size:11.5px;
  font-weight:600;
  color:var(--muted);
  background:#fff;
  letter-spacing:0.3px;
}
.pill.req{
  border-color:rgba(239, 68, 68, 0.25);
  background:linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
  color:#dc2626;
}
.pill.rec{
  border-color:rgba(14, 165, 233, 0.25);
  background:linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(14, 165, 233, 0.05));
  color:#0284c7;
}
.pill.opt{
  border-color:rgba(16, 185, 129, 0.25);
  background:linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
  color:#059669;
}

label{
  display:block;
  font-size:13.5px;
  font-weight:600;
  color:var(--ink);
  margin:0 0 8px;
  letter-spacing:-.01em;
}

input[type="text"], input[type="email"], input[type="tel"], input[type="url"], input[type="date"], select, textarea{
  width:100%;
  border:2px solid rgba(14, 165, 233, 0.15);
  border-radius:12px;
  padding:12px 14px;
  font-size:14px;
  line-height:1.5;
  outline:none;
  background:#fff;
  transition:all 0.2s ease;
  font-family:var(--sans);
  color:var(--ink);
}

textarea{
  min-height:100px;
  resize:vertical;
}

input:focus, select:focus, textarea:focus{
  border-color:var(--brand);
  box-shadow:0 0 0 4px rgba(14, 165, 233, 0.1);
}

input:hover:not(:focus), select:hover:not(:focus), textarea:hover:not(:focus){
  border-color:rgba(14, 165, 233, 0.25);
}

.row{
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
}

.row.two{
  grid-template-columns:1fr 1fr;
}

.checkgrid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px 14px;
}

.check{
  display:flex;
  gap:12px;
  align-items:flex-start;
  padding:14px;
  border:2px solid rgba(14, 165, 233, 0.12);
  border-radius:14px;
  background:linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);
  transition:all 0.2s ease;
  cursor:pointer;
}

.check:hover{
  border-color:rgba(14, 165, 233, 0.25);
  background:linear-gradient(135deg, #fefeff 0%, #ecfeff 100%);
  box-shadow:0 2px 8px rgba(14, 165, 233, 0.08);
}

.check input{
  margin-top:3px;
  width:18px;
  height:18px;
  cursor:pointer;
}
.check .t{
  font-size:14px;
  font-weight:700;
  color:var(--ink);
  letter-spacing:-.01em;
}
.check .d{
  font-size:13px;
  color:var(--muted);
  margin-top:4px;
  line-height:1.5;
}

.footer{
  padding:28px 32px;
  border-top:2px solid rgba(14, 165, 233, 0.1);
  background:linear-gradient(135deg, rgba(14, 165, 233, 0.04) 0%, rgba(236, 72, 153, 0.02) 100%);
  display:flex;
  flex-wrap:wrap;
  gap:16px;
  align-items:center;
  justify-content:space-between;
}

.footer .fine{
  color:var(--muted);
  font-size:14px;
  line-height:1.6;
  max-width:800px;
}

.sig{
  display:flex;
  gap:12px;
  align-items:flex-end;
  flex-wrap:wrap;
}

.sig .line{
  width:240px;
  border-bottom:1px solid rgba(17,24,39,.35);
  height:22px;
}

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

.btn{
  appearance:none;
  border:2px solid transparent;
  background:var(--bg-gradient);
  color:#ffffff;
  padding:12px 20px;
  border-radius:12px;
  font-weight:700;
  font-size:14px;
  cursor:pointer;
  transition:all 0.3s ease;
  box-shadow:0 4px 12px rgba(14, 165, 233, 0.3);
  letter-spacing:-.01em;
}

.btn:hover{
  transform:translateY(-2px);
  box-shadow:0 6px 20px rgba(14, 165, 233, 0.4);
}

.btn:active{
  transform:translateY(0);
}

.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible{
  outline:3px solid rgba(14, 165, 233, 0.4);
  outline-offset:2px;
}

.btn.secondary{
  background:#ffffff;
  color:var(--brand);
  border-color:rgba(14, 165, 233, 0.25);
  box-shadow:0 2px 8px rgba(14, 165, 233, 0.12);
}

.btn.secondary:hover{
  background:rgba(14, 165, 233, 0.05);
  border-color:rgba(14, 165, 233, 0.4);
  box-shadow:0 4px 16px rgba(14, 165, 233, 0.2);
}

.smallnote{
  font-size:13px;
  color:var(--muted);
  margin-top:12px;
  line-height:1.6;
  padding:12px 16px;
  background:rgba(14, 165, 233, 0.04);
  border-left:3px solid var(--brand-light);
  border-radius:8px;
}

@media (max-width: 920px){
  .grid{grid-template-columns:1fr}
  .row.two{grid-template-columns:1fr}
  .kv{grid-template-columns:1fr}
  .checkgrid{grid-template-columns:1fr}
  .clientblock{min-width:0}
}

@media (max-width: 560px){
  .page{margin:0 auto; padding:0 6px 18px}
  .sheet{
    border-radius:0;
    border-left:none;
    border-right:none;
    box-shadow:none;
  }

  .topbar{
    flex-direction:column;
    align-items:stretch;
    padding:14px 12px;
  }

  .issuer{
    align-items:flex-start;
    text-align:left;
  }

  .badges{justify-content:flex-start}
  .badge{font-size:11.5px; padding:6px 9px}

  .header{padding:12px 12px 6px}
  .header h2{font-size:20px}

  .grid{padding:10px 8px 12px}
  .section{padding:0 8px 12px}
  .card{padding:12px; border-radius:14px}

  /* Prevent mobile browsers from zooming into inputs */
  input[type="text"], input[type="email"], input[type="tel"], input[type="url"], input[type="date"], select, textarea{
    font-size:16px;
    padding:11px 11px;
    border-radius:14px;
  }

  .actions{
    display:grid;
    grid-template-columns:1fr;
    gap:10px;
  }
  .btn{width:100%; padding:12px 12px; font-size:14px; border-radius:14px}

  .table{border-radius:14px}
  .table tbody tr{
    grid-template-columns:1fr;
    grid-template-areas:
      "no"
      "pri"
      "question"
      "response";
    gap:8px;
    padding:12px 10px;
  }

  .table tbody td:nth-child(3){justify-self:start}
  .pill{font-size:11.5px; padding:4px 10px}
}

@media (prefers-reduced-motion: reduce){
  *{scroll-behavior:auto !important; transition:none !important; animation:none !important}
}

@media print{
  body{background:#fff}
  .page{margin:0; padding:0}
  .sheet{border:none; box-shadow:none; border-radius:0}
  .btn{display:none}
  .badge{border-color:#ddd}
  input, textarea, select{border-color:#ddd}
  a{color:inherit; text-decoration:none}
}
