/* ============================================================
   Utilities Bunker — Formats Converter (v2.1)
   File: /assets/css/modules/convert/formats-converter.v2.1.css
   Purpose:
   - Tool-only layout + converter UI visuals
   - No changes to ub-toolkit.v2.1.css
   - Mobile-first, responsive, 44x44 touch targets
   ============================================================ */

/* Local tool tokens */
:root{
  --fc-radius: 16px;
  --fc-gap: 14px;
  --fc-soft: rgba(0,0,0,.06);
  --fc-accent-soft: rgba(249,58,19,.10);
  --fc-accent-mid: rgba(249,58,19,.18);
  --fc-grid-min: 180px;
}

/* Header card helpers */
.fc-pagehead{
  display:flex;
  gap:10px;
  justify-content:space-between;
  align-items:flex-start;
  flex-wrap:wrap;
}

.fc-title{
  margin:0;
  font-size:var(--ub-fs-5);
}

.fc-subtitle{
  margin:6px 0 0;
  max-width:78ch;
}

/* How-to */
.fc-howto{
  margin:0;
  padding-left:18px;
}

.fc-howto li + li{
  margin-top:8px;
}

/* Main hero layout */
.fc-hero{
  display:grid;
  grid-template-columns:1.15fr 0.85fr;
  gap:var(--fc-gap);
}

@media (max-width:980px){
  .fc-hero{
    grid-template-columns:1fr;
  }
}

/* Conversion overview panel */
.fc-lab{
  background:var(--ub-surface-2);
  border:1px solid var(--ub-border);
  border-radius:var(--fc-radius);
  padding:12px;
}

.fc-lab-top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom:10px;
}

.fc-lab-title{
  font-size:clamp(13px, 1.2vw, 14px);
  font-weight:950;
  letter-spacing:.01em;
}

.fc-lab-sub{
  font-size:12px;
  color:var(--ub-muted);
  margin-top:2px;
  max-width:62ch;
}

/* KPI tiles */
.fc-kpis{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  justify-content:flex-end;
}

.fc-kpi{
  min-width:112px;
  padding:8px 10px;
  border-radius:14px;
  border:1px solid var(--ub-border);
  background:var(--ub-card-bg);
}

.fc-kpi .k{
  font-size:11px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.04em;
  color:var(--ub-muted);
}

.fc-kpi .v{
  font-family:var(--ub-mono);
  font-weight:950;
  font-size:14px;
  margin-top:2px;
  overflow-wrap:anywhere;
}

/* Family chips row */
.fc-mode-row{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:10px;
}

.fc-mode-row .ub-chip{
  min-height:44px;
  padding:10px 12px;
}

/* Flow card */
.fc-visual-card{
  margin-top:12px;
  border:1px solid var(--ub-border);
  border-radius:14px;
  background:
    linear-gradient(180deg, var(--ub-card-bg), var(--ub-surface-2));
  padding:14px;
}

.fc-flow{
  display:grid;
  grid-template-columns:1fr auto 1fr auto 1fr;
  gap:10px;
  align-items:center;
}

.fc-flow-step{
  min-height:94px;
  padding:12px;
  border:1px solid var(--ub-border);
  border-radius:14px;
  background:var(--ub-card-bg);
  box-shadow:inset 0 0 0 1px transparent;
}

.fc-flow-label{
  font-size:11px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.06em;
  color:var(--ub-muted);
}

.fc-flow-value{
  margin-top:8px;
  font-family:var(--ub-mono);
  font-size:clamp(13px, 1rem + .2vw, 16px);
  font-weight:950;
  line-height:1.35;
  overflow-wrap:anywhere;
}

.fc-flow-arrow{
  font-size:20px;
  font-weight:950;
  color:var(--ub-muted);
  align-self:center;
}

.fc-flow-note{
  margin:12px 0 0;
  color:var(--ub-muted);
  font-size:12px;
}

/* Presets */
.fc-preset-row{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:12px;
}

.fc-preset-row .ub-chip{
  min-height:44px;
  padding:10px 12px;
}

/* Form card */
.fc-form{
  margin-bottom:0;
}

.fc-rule{
  border:none;
  border-top:1px solid var(--ub-border);
  margin:14px 0;
}

.fc-option-row{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
}

.fc-chip-check{
  display:flex;
  gap:8px;
  align-items:center;
}

.fc-actions{
  margin-top:12px;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

/* All results grid */
.fc-results-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(var(--fc-grid-min), 1fr));
  gap:12px;
}

.fc-result-tile{
  min-height:96px;
  padding:12px;
  border:1px solid var(--ub-border);
  border-radius:14px;
  background:var(--ub-card-bg);
  box-shadow:var(--ub-shadow);
}

.fc-result-unit{
  font-size:11px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.06em;
  color:var(--ub-muted);
}

.fc-result-value{
  margin-top:8px;
  font-family:var(--ub-mono);
  font-size:clamp(14px, 1rem + .25vw, 17px);
  font-weight:950;
  line-height:1.35;
  overflow-wrap:anywhere;
}

/* Work area */
.fc-work{
  font-family:var(--ub-mono);
  font-size:13px;
  line-height:1.6;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
}

.fc-work-note{
  margin-top:10px;
  color:var(--ub-muted);
  font-size:12px;
}

/* Reference / FAQ */
.fc-ref-list{
  margin:0;
  padding-left:18px;
}

.fc-ref-list li + li{
  margin-top:6px;
}

.fc-faq-q{
  margin:12px 0 6px;
  font-size:var(--ub-fs-2);
}

.fc-faq-a{
  margin:0 0 10px;
}

/* Button helper */
.ub-btn--block{
  width:100%;
}

/* Enhanced focus for tool cards */
.fc-result-tile:focus-within,
.fc-flow-step:focus-within{
  box-shadow:0 0 0 4px var(--ub-focus);
}

/* Hover polish where supported */
@media (hover:hover){
  .fc-result-tile{
    transition:transform .15s ease, border-color .15s ease, background .15s ease;
  }

  .fc-result-tile:hover{
    transform:translateY(-1px);
    border-color:rgba(249,58,19,.30);
    background:linear-gradient(180deg, var(--ub-card-bg), var(--ub-surface-2));
  }

  .fc-flow-step{
    transition:border-color .15s ease, box-shadow .15s ease;
  }

  .fc-flow-step:hover{
    border-color:rgba(249,58,19,.30);
    box-shadow:inset 0 0 0 1px var(--fc-accent-mid);
  }
}

/* Tablet and down */
@media (max-width:760px){
  .fc-flow{
    grid-template-columns:1fr;
  }

  .fc-flow-arrow{
    transform:rotate(90deg);
    justify-self:center;
  }

  .fc-kpis{
    justify-content:flex-start;
  }
}

/* Small screens */
@media (max-width:520px){
  .fc-kpi{
    min-width:98px;
  }

  .fc-actions{
    flex-direction:column;
  }

  .fc-actions .ub-btn{
    width:100%;
  }

  .fc-option-row{
    flex-direction:column;
    align-items:stretch;
  }

  .fc-option-row .ub-chip{
    width:100%;
    justify-content:flex-start;
  }
}

/* Dark mode polish */
html.ub-theme-dark .fc-visual-card{
  background:linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.04));
}

html.ub-theme-dark .fc-result-tile,
html.ub-theme-dark .fc-flow-step{
  box-shadow:none;
}

html.ub-theme-dark .fc-result-tile:hover{
  background:linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.06));
}