/* =====================================================
   Evidence Capture Assistant. Smart incident log panel
   Track 2. AI UX Enhancements
   ===================================================== */

.ssh-evidence-assistant {
  margin: 1rem 0 0.6rem 0;
  padding: 0.9rem;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 0.9rem;
  background: rgba(0,0,0,0.015);

  /* Gentle divider above assistant */
  border-top: 1px solid rgba(0,0,0,0.05);
  padding-top: 0.9rem;
}

.ssh-evidence__head {
  margin-bottom: 0.85rem;
}

.ssh-evidence__title {
  display: block;
  font-weight: 750;
  font-size: 1.08rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.ssh-evidence__subtitle {
  margin: 0 0 0.75rem 0;
  opacity: 0.9;
}

.ssh-evidence__actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  align-items: center;
}

.ssh-evidence__print {
  padding: 0.55rem 0.9rem;
  border-radius: 0.75rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  background: var(--md-default-bg-color);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  transition: background 0.15s ease;
}

.ssh-evidence__print:hover {
  background: rgba(0,0,0,0.03);
}

.ssh-evidence__print:focus-visible {
  outline: 3px solid var(--md-accent-fg-color);
  outline-offset: 2px;
}

.ssh-evidence__link {
  text-decoration: underline;
  font-size: 0.92rem;
  opacity: 0.9;
}

.ssh-evidence__link:hover {
  opacity: 1;
}

.ssh-evidence__form {
  margin: 0;
}

/* =====================================================
   Section cards. FIX legend straddle by neutralising legend
   and moving padding to a dedicated body wrapper
   ===================================================== */

/* 1) Make the fieldset behave like a card. Remove padding from fieldset */
.ssh-evidence__section {
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 0.85rem;
  background: var(--md-default-bg-color);
  padding: 0;            /* critical */
  margin: 0 0 0.85rem 0;
  overflow: hidden;      /* keeps header band clipped inside card */
}

/* 2) Neutralise native legend behaviour so it stays inside the card */
.ssh-evidence__section legend {
  all: unset;            /* removes browser legend positioning behaviour */
  display: block;
  width: 100%;
}

/* 3) Reapply a controlled header band (clarity + containment) */
.ssh-evidence__section legend {
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: 0.2px;
  padding: 0.7rem 0.9rem;
  background: rgba(0,0,0,0.03);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

/* 4) Section content padding now lives here */
.ssh-evidence__section-body {
  padding: 0.9rem;
}

/* Spacing between sections */
.ssh-evidence__section + .ssh-evidence__section {
  margin-top: 0.85rem;
}

/* =====================================================
   Form layout
   ===================================================== */

.ssh-evidence__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 0.65rem;
}

.ssh-evidence__field {
  display: block;
}

.ssh-evidence__field--full {
  grid-column: 1 / -1;
}

.ssh-evidence__label {
  display: block;
  font-size: 0.9rem;
  font-weight: 650;
  margin-bottom: 0.25rem;
}

.ssh-evidence__input {
  width: 100%;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.65rem;
  padding: 0.5rem 0.6rem;
  background: var(--md-default-bg-color);
  font: inherit;
}

.ssh-evidence__input:focus-visible {
  outline: 3px solid var(--md-accent-fg-color);
  outline-offset: 2px;
}

.ssh-evidence__checks-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem 0.85rem;
  margin-top: 0.65rem;
}

.ssh-evidence__check {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  line-height: 1.35;
}

.ssh-evidence__note {
  margin-top: 0.25rem;
  padding: 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(0,0,0,0.06);
  background: rgba(0,0,0,0.02);
  line-height: 1.5;
}

.ssh-evidence__reassure {
  margin: 0.35rem 0 0.75rem 0;
  font-size: 0.9rem;
  opacity: 0.85;
}

@media (max-width: 800px) {
  .ssh-evidence__grid {
    grid-template-columns: 1fr;
  }

  .ssh-evidence__checks-grid {
    grid-template-columns: 1fr;
  }
}

/* =====================================================
   Print. Isolate only the assistant clone
   Activated by JS adding body.ssh-printing and a .ssh-print-region
   ===================================================== */

@media print {
  body.ssh-printing .md-header,
  body.ssh-printing .md-tabs,
  body.ssh-printing .md-sidebar,
  body.ssh-printing .md-footer,
  body.ssh-printing .md-search,
  body.ssh-printing .md-overlay,
  body.ssh-printing .md-consent,
  body.ssh-printing .md-top,
  body.ssh-printing nav,
  body.ssh-printing header,
  body.ssh-printing footer {
    display: none !important;
  }

  body.ssh-printing * {
    display: none !important;
  }

  body.ssh-printing html,
  body.ssh-printing body,
  body.ssh-printing .ssh-print-region,
  body.ssh-printing .ssh-print-region * {
    display: block !important;
  }

  body.ssh-printing html,
  body.ssh-printing body {
    color: #000 !important;
    background: #fff !important;
    height: auto !important;
  }

  body.ssh-printing .ssh-print-region {
    position: static !important;
    width: 100% !important;
    max-width: 780px !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.ssh-printing .ssh-evidence-assistant {
    border: 1px solid #000 !important;
    background: #fff !important;
    box-shadow: none !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body.ssh-printing .ssh-evidence__actions {
    display: none !important;
  }

  body.ssh-printing .ssh-evidence__section {
    border: 1px solid #ccc !important;
    background: #fff !important;
    box-shadow: none !important;
  }

  /* Print consistency. Legend can behave oddly. Force block layout */
  body.ssh-printing legend {
    display: block !important;
    margin: 0 !important;
  }

  body.ssh-printing .ssh-evidence__label {
    font-weight: 700 !important;
  }

  body.ssh-printing .ssh-evidence__input {
    border: 0 !important;
    padding: 0 !important;
  }

  @page {
    margin: 14mm;
  }
}


/* =====================================================
   Evidence Capture Assistant. Spacing refinement
   Fix: form content too tight to card edges
   ===================================================== */

/* Give the whole assistant a touch more inner room */
.ssh-evidence-assistant {
  padding: 1.1rem;
}

/* Increase left/right padding inside each section card */
.ssh-evidence__section {
  padding: 0.95rem 1.05rem; /* was 0.85rem */
}

/* Give input controls more internal breathing space */
.ssh-evidence__input {
  padding: 0.55rem 0.75rem; /* was 0.5rem 0.6rem */
}

/* Checkbox grid needs a little inset so text is not kissing edges */
.ssh-evidence__checks-grid {
  padding: 0.2rem 0.1rem; /* subtle. keeps layout stable */
}

/* Each checkbox row gets a tiny “row padding” feel */
.ssh-evidence__check {
  padding: 0.12rem 0.15rem;
}

/* Mobile. keep it comfortable */
@media (max-width: 800px) {
  .ssh-evidence__section {
    padding: 0.95rem 0.95rem;
  }
}


/* =====================================================
   Label alignment polish
   Fix: labels feel compressed because they align to the input border,
   not to the input text inset
   ===================================================== */

.ssh-evidence__label {
  padding: 0 0.75rem;        /* match .ssh-evidence__input left/right padding */
  margin-bottom: 0.35rem;    /* a touch more breathing room */
  line-height: 1.25;
}

/* Optional. If any helper text uses the same “label” look */
.ssh-evidence__field > small,
.ssh-evidence__hint {
  padding: 0 0.75rem;
}
