/* AI Procurement Scotland Gatekeeper v3
   Changes:
   - More prominent gate titles (bigger, bold, coloured)
   - Larger Yes/No chips
   - Adds helper line styling under outcome badge
   - Keeps colourful but elegant gradients
*/

.apsg-wrap{
  display:grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap:14px;
  align-items:start;
}

/* Header */
.apsg-title{
  font-size:20px;
  font-weight:850;
  letter-spacing:0.2px;
}

.apsg-sub{
  margin-top:4px;
  opacity:0.75;
}

/* Buyer type segmented radios */
.apsg-seg .form-radios{
  display:inline-flex;
  gap:10px;
  padding:5px;
  border-radius:999px;
  border:1px solid rgba(0,0,0,0.10);
  background: rgba(255,255,255,0.70);
  margin-top:8px;
}

.apsg-seg .form-item{ margin:0; }

.apsg-seg input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}

.apsg-seg label{
  display:block;
  padding:9px 13px;
  border-radius:999px;
  border:1px solid rgba(0,0,0,0.08);
  cursor:pointer;
  user-select:none;
  background: rgba(255,255,255,0.86);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.apsg-seg input:checked + label{
  border-color: rgba(0,0,0,0.20);
  box-shadow: 0 10px 20px rgba(0,0,0,0.08);
  background: linear-gradient(135deg, rgba(90,135,255,0.14), rgba(102,204,153,0.12));
}

/* Value band tiles */
.apsg-tiles .form-radios{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:10px;
  margin-top:12px;
}

.apsg-tiles .form-item{ margin:0; }

.apsg-tiles input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}

.apsg-tiles label{
  display:block;
  padding:12px 12px;
  border-radius:16px;
  border:1px solid rgba(0,0,0,0.10);
  cursor:pointer;
  user-select:none;
  background: linear-gradient(135deg, rgba(255,255,255,0.92), rgba(255,255,255,0.78));
  box-shadow: 0 8px 18px rgba(0,0,0,0.06);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background 140ms ease;
}

.apsg-tiles label:hover{
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(0,0,0,0.09);
}

.apsg-tiles input:checked + label{
  border-color: rgba(0,0,0,0.22);
  background: linear-gradient(135deg, rgba(90,135,255,0.16), rgba(255,153,102,0.12));
}

/* Gates card */
.apsg-card{
  margin-top:12px;
  border-radius:16px;
  padding:12px;
  border:1px solid rgba(0,0,0,0.10);
  background: linear-gradient(135deg, rgba(255,255,255,0.92), rgba(255,255,255,0.78));
  box-shadow: 0 10px 24px rgba(0,0,0,0.07);
}

/* Each gate panel */
.apsg-gate{
  margin-top:10px;
  padding:12px;
  border-radius:16px;
  border:1px solid rgba(0,0,0,0.08);
  background: linear-gradient(135deg, rgba(90,135,255,0.08), rgba(255,153,102,0.06));
}

/* Gate title more prominent */
.apsg-gate legend,
.apsg-gate .form-item > label{
  font-weight:900;
  font-size:16px;
}

/* Webform radios: the title label is usually ".form-item > label" inside wrapper.
   Make sure we only target the gate title, not the Yes/No labels.
*/
.apsg-gate > label,
.apsg-gate .form-item > label{
  display:block;
  margin-bottom:8px;
  font-weight:900;
  font-size:16px;
  line-height:1.1;
  color: rgba(20, 30, 70, 0.95);
  letter-spacing:0.1px;
}

/* Yes/No chips bigger */
.apsg-gate .form-radios{
  display:inline-flex;
  gap:12px;
  margin-top:2px;
}

.apsg-gate .form-item{ margin:0; }

.apsg-gate input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}

.apsg-gate .form-radios label{
  display:block;
  padding:10px 16px;
  border-radius:999px;
  border:1px solid rgba(0,0,0,0.12);
  cursor:pointer;
  user-select:none;
  background: rgba(255,255,255,0.90);
  font-weight:800;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background 140ms ease;
}

.apsg-gate .form-radios label:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}

.apsg-gate input:checked + label{
  border-color: rgba(0,0,0,0.22);
  box-shadow: 0 12px 22px rgba(0,0,0,0.09);
  background: linear-gradient(135deg, rgba(102,204,153,0.18), rgba(90,135,255,0.12));
}

/* Right panel */
.apsg-results{
  position:sticky;
  top:12px;
  border-radius:18px;
  padding:14px;
  border:1px solid rgba(0,0,0,0.10);
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0.78));
  box-shadow: 0 12px 28px rgba(0,0,0,0.09);
}

.apsg-meter{
  display:grid;
  gap:8px;
}

.apsg-light{
  font-weight:950;
  font-size:18px;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(0,0,0,0.10);
  background: rgba(255,255,255,0.88);
}

.apsg-helper{
  font-size:13px;
  opacity:0.80;
  padding:0 2px;
}

.apsg-bar{
  height:10px;
  border-radius:999px;
  overflow:hidden;
  border:1px solid rgba(0,0,0,0.10);
  background: rgba(255,255,255,0.70);
}

.apsg-barfill{
  height:100%;
  width:0%;
  transition: width 200ms ease;
  background: linear-gradient(90deg, rgba(255,102,102,0.92), rgba(255,204,102,0.92), rgba(102,204,153,0.92));
}

/* Meta rows */
.apsg-meta{
  margin-top:12px;
  border-radius:16px;
  padding:10px;
  border:1px solid rgba(0,0,0,0.10);
  background: rgba(255,255,255,0.78);
}

.apsg-meta-row{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:6px 6px;
  border-radius:12px;
}

.apsg-meta-row + .apsg-meta-row{
  border-top:1px solid rgba(0,0,0,0.06);
  margin-top:4px;
  padding-top:10px;
}

.apsg-meta-k{
  font-weight:850;
  opacity:0.85;
}

.apsg-meta-v{
  text-align:right;
  opacity:0.92;
}

/* Outputs */
.apsg-out{
  margin-top:12px;
  border-radius:16px;
  padding:10px;
  border:1px solid rgba(0,0,0,0.10);
  background: rgba(255,255,255,0.78);
}

.apsg-outhead{
  font-weight:900;
  margin-bottom:8px;
}

.apsg-box{
  white-space:pre-wrap;
  word-break:break-word;
  font-size:13px;
  line-height:1.25;
  padding:10px;
  border-radius:14px;
  border:1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.90);
  min-height:74px;
}

/* Mobile */
@media (max-width: 900px){
  .apsg-wrap{ grid-template-columns: 1fr; }
  .apsg-results{ position:relative; top:auto; }
  .apsg-tiles .form-radios{ grid-template-columns: 1fr; }
}
