/* ============================================================
   Utilities Bunker — Rent Calculator (v2.1)
   File: /assets/css/modules/calculators/financialcalculators/rent-calculator.v2.1.css
   Purpose:
   - Tool-only layout + housing summary visuals + work formatting
   - No changes to ub-toolkit.v2.1.css
   - Mobile-first, touch-friendly, UB-CERT aligned
   ============================================================ */

/* Local tool tokens */
:root{
  --rent-radius: 16px;
  --rent-gap: 14px;
  --rent-soft: rgba(0,0,0,.06);
  --rent-accent-soft: rgba(249,58,19,.12);
  --rent-bar-bg: rgba(0,0,0,.08);
}

html.ub-theme-dark:root{
  --rent-soft: rgba(255,255,255,.06);
  --rent-bar-bg: rgba(255,255,255,.12);
}

/* Header card helpers */
.rent-head{
  display:flex;
  gap:10px;
  justify-content:space-between;
  align-items:center;
  flex-wrap:wrap;
}

.rent-title{
  margin:0;
  font-size:var(--ub-fs-5);
}

.rent-subtitle{
  margin:6px 0 0;
}

/* How to use */
.rent-howto{
  margin:0;
  padding-left:18px;
}

.rent-howto li + li{
  margin-top:6px;
}

/* Main hero layout */
.rent-hero{
  display:grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: var(--rent-gap);
}

@media (max-width: 980px){
  .rent-hero{
    grid-template-columns: 1fr;
  }
}

/* Dashboard panel */
.rent-dashboard{
  background: var(--ub-surface-2);
  border: 1px solid var(--ub-border);
  border-radius: var(--rent-radius);
  padding: 12px;
}

.rent-dashboard-top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom:10px;
}

.rent-panel-title{
  font-size: clamp(13px, 1.2vw, 14px);
  font-weight: 950;
  letter-spacing: .01em;
}

.rent-panel-sub{
  font-size: 12px;
  color: var(--ub-muted);
  margin-top: 2px;
}

/* Mode chips */
.rent-mode{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.rent-mode .ub-chip{
  min-height:44px;
  padding:10px 12px;
}

.rent-mode .ub-chip[aria-pressed="true"]{
  border-color: rgba(249,58,19,.55);
  box-shadow: 0 0 0 4px rgba(249,58,19,.12);
}

/* KPI tiles */
.rent-kpis{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap:10px;
  margin-top:10px;
}

@media (max-width: 520px){
  .rent-kpis{
    grid-template-columns: 1fr;
  }
}

.rent-kpi{
  min-width: 0;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--ub-border);
  background: var(--ub-card-bg);
}

.rent-kpi .k{
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ub-muted);
}

.rent-kpi .v{
  font-family: var(--ub-mono);
  font-weight: 950;
  font-size: 15px;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

/* Status + presets */
.rent-status-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  margin-top:12px;
}

.rent-status{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid var(--ub-border);
  background: var(--ub-card-bg);
  font-size:12px;
  font-weight:950;
  min-height:44px;
}

.rent-status-dot{
  width:10px;
  height:10px;
  border-radius:50%;
  background: var(--ub-muted);
  flex:0 0 auto;
}

.rent-status-dot--success{
  background: var(--ub-success);
  box-shadow: 0 0 0 4px rgba(34,197,94,.14);
}

.rent-status-dot--warning{
  background: var(--ub-warning);
  box-shadow: 0 0 0 4px rgba(245,158,11,.16);
}

.rent-status-dot--danger{
  background: var(--ub-danger);
  box-shadow: 0 0 0 4px rgba(239,68,68,.16);
}

.rent-presets{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.rent-presets .ub-chip{
  min-height:44px;
  padding:10px 12px;
}

/* Ratio bar */
.rent-visual{
  margin-top:12px;
  padding:12px;
  border-radius:14px;
  border:1px solid var(--ub-border);
  background: var(--ub-card-bg);
}

.rent-visual-bar{
  position:relative;
  width:100%;
  height:16px;
  border-radius:999px;
  overflow:hidden;
  background: var(--rent-bar-bg);
  border: 1px solid var(--ub-border);
}

.rent-visual-fill{
  width:0%;
  height:100%;
  border-radius:999px;
  background: linear-gradient(92deg, var(--ub-btn-grad-a), var(--ub-btn-grad-b));
  box-shadow: 0 0 18px var(--ub-btn-glow);
  transition: width 160ms ease;
}

.rent-visual-scale{
  display:grid;
  grid-template-columns: repeat(5, minmax(0,1fr));
  gap:8px;
  margin-top:8px;
  font-size:11px;
  color: var(--ub-muted);
  font-weight:900;
}

.rent-visual-scale span:nth-child(1){ text-align:left; }
.rent-visual-scale span:not(:first-child):not(:last-child){ text-align:center; }
.rent-visual-scale span:last-child{ text-align:right; }

@media (prefers-reduced-motion: reduce){
  .rent-visual-fill{
    transition:none;
  }
}

/* Summary cards */
.rent-summary-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap:10px;
  margin-top:12px;
}

@media (max-width: 760px){
  .rent-summary-grid{
    grid-template-columns: 1fr;
  }
}

.rent-summary-card{
  padding:10px 12px;
  border-radius:14px;
  border:1px solid var(--ub-border);
  background: var(--ub-card-bg);
}

.rent-summary-card .label{
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ub-muted);
}

.rent-summary-card .value{
  font-family: var(--ub-mono);
  font-size: 15px;
  font-weight: 950;
  margin-top: 4px;
  overflow-wrap:anywhere;
}

/* Form */
.rent-form{
  margin-bottom:0;
}

.rent-divider{
  border:none;
  border-top:1px solid var(--ub-border);
  margin:14px 0;
}

.rent-checkline{
  display:flex;
  gap:10px;
  align-items:flex-start;
  min-height:44px;
}

.rent-checkline input[type="checkbox"]{
  width:18px;
  height:18px;
  margin-top:2px;
  accent-color: var(--ub-btn-grad-b);
  flex:0 0 auto;
}

/* Quick sliders */
.rent-quick-row{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  margin-top:12px;
}

.rent-quick-label{
  min-width:180px;
  font-weight:950;
}

.rent-quick-key{
  font-weight:900;
  min-width:70px;
}

.rent-slider-out{
  font-family: var(--ub-mono);
  font-weight: 950;
  min-width: 92px;
}

.rent-actions{
  margin-top:12px;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
}

/* Work area */
.rent-work-wrap{
  margin-top:14px;
}

.rent-work{
  font-family: var(--ub-mono);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap:anywhere;
}

.rent-footnote{
  margin-top:10px;
  color: var(--ub-muted);
  font-size:12px;
}

/* Formula note */
.rent-formula-note{
  margin-top:10px;
  color: var(--ub-muted);
  font-size:12px;
}

/* FAQ */
.rent-faq-q{
  margin:12px 0 6px;
}

.rent-faq-a{
  margin:0 0 10px;
}

.rent-faq-a:last-child{
  margin-bottom:0;
}

/* Rail button block helper */
.ub-btn--block{
  width:100%;
}

/* Focus polish */
.rent-mode .ub-chip:focus,
.rent-presets .ub-chip:focus,
.rent-status:focus,
.rent-visual:focus{
  outline:none;
  box-shadow: 0 0 0 4px var(--ub-focus);
}

/* Small-screen tuning */
@media (max-width: 640px){
  .rent-dashboard,
  .rent-form{
    padding:12px;
  }

  .rent-quick-label{
    min-width:100%;
  }

  .rent-quick-key{
    min-width:56px;
  }

  .rent-slider-out{
    min-width:auto;
  }
}

/* Very small screens */
@media (max-width: 420px){
  .rent-status-row{
    align-items:stretch;
  }

  .rent-status,
  .rent-presets{
    width:100%;
  }

  .rent-presets .ub-chip{
    flex:1 1 calc(50% - 10px);
  }
}