/* /outils/assets/calcul-credit/calcul-credit.css
   Style premium "CMS-like" + responsive
   (aucun impact sur le CSS global, tout est scopé via classes de la page)
*/

:root{
  --cc-accent: var(--accent, #0e9f9a);
  --cc-text: rgba(15, 20, 28, .92);
  --cc-muted: rgba(15, 20, 28, .68);
  --cc-border: rgba(15, 20, 28, .10);
  --cc-soft: rgba(15, 20, 28, .06);
  --cc-card: rgba(255,255,255,.88);
  --cc-glass: rgba(255,255,255,.78);
  --cc-shadow: 0 10px 30px rgba(0,0,0,.08);
}

/* -------- Helpers -------- */
.tool-head, .tool-grid, .tool-main, .card, .ad { color: var(--cc-text); }
.muted{opacity:.72}
.small{font-size:.92rem}
.opt{opacity:.6;font-weight:700}
.accent{color: var(--cc-accent)}
.divider{height:1px;background:rgba(0,0,0,.08);margin:18px 0}

/* -------- Page Head -------- */
.tool-head{margin: 8px 0 14px}
.tool-badge{
  display:inline-flex; align-items:center; gap:8px;
  padding:6px 10px; border-radius:999px;
  background: color-mix(in srgb, var(--cc-accent) 14%, transparent);
  border:1px solid color-mix(in srgb, var(--cc-accent) 22%, transparent);
  font-weight:900; font-size:.85rem;
}
.tool-head h1{
  margin:10px 0 6px;
  font-size: clamp(1.6rem, 2.2vw, 2.2rem);
  letter-spacing: -.02em;
}
.tool-head p{margin:0; color: var(--cc-muted)}

/* -------- Ads (placeholders) -------- */
.ad{
  border:1px dashed rgba(0,0,0,.16);
  border-radius:16px;
  background: rgba(255,255,255,.65);
}
.ad-inner{
  display:flex; flex-direction:column;
  align-items:center; justify-content:center;
  padding:14px; height:100%;
}
.ad-title{
  font-size:.72rem;
  letter-spacing:.12em;
  font-weight:1000;
  opacity:.65;
}
.ad-size{font-size:1.05rem;font-weight:1000;margin-top:6px}
.ad-sub{font-size:.86rem;opacity:.55;margin-top:3px}
.ad-top{height:100px;margin: 14px 0 18px}

/* Sticky left ad on desktop */
.ad-left{
  width:180px;
  min-height: 600px;
  position: sticky;
  top: 16px;
}

/* -------- Layout grid -------- */
.tool-grid{
  display:grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 16px;
  align-items:start;
}
.tool-main{min-width:0}

/* -------- Cards -------- */
.card{
  background: var(--cc-card);
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 18px;
  box-shadow: var(--cc-shadow);
  padding: 16px;
}
.glass{
  background: var(--cc-glass);
  backdrop-filter: blur(10px);
}
.card h2{margin:0;font-size:1.2rem}
.card h3{margin:0 0 10px;font-size:1.05rem}
.card p{margin:4px 0 0;color: var(--cc-muted)}
.card-head{
  display:flex; gap:12px; align-items:flex-start;
  margin-bottom: 14px;
}
.card-icon{
  width:44px;height:44px;border-radius:14px;
  display:grid;place-items:center;
  background: color-mix(in srgb, var(--cc-accent) 16%, transparent);
  border:1px solid color-mix(in srgb, var(--cc-accent) 22%, transparent);
  font-size: 1.25rem;
  flex:0 0 auto;
}

/* -------- Form -------- */
.form-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}
.field{min-width:0}
.field-wide{grid-column: 1 / -1}

label{
  display:block;
  font-weight:1000;
  font-size:.82rem;
  letter-spacing:.02em;
  margin-bottom:6px;
  text-transform:uppercase;
  opacity:.86;
}

input[type="text"],
input[type="number"],
input[type="search"],
select{
  width:100%;
  border:1px solid rgba(0,0,0,.12);
  border-radius:12px;
  padding: 11px 12px;
  background: rgba(255,255,255,.92);
  outline:none;
  color: var(--cc-text);
  transition: box-shadow .15s ease, border-color .15s ease, transform .15s ease;
}

input::placeholder{color: rgba(15,20,28,.45)}
input:focus, select:focus{
  border-color: color-mix(in srgb, var(--cc-accent) 55%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--cc-accent) 16%, transparent);
}

.hint{margin-top:6px;font-size:.85rem;color: var(--cc-muted)}

.range{
  width:100%;
  accent-color: var(--cc-accent);
}

/* Borrow box */
.borrow-box{
  border-radius:14px;
  border:1px solid color-mix(in srgb, var(--cc-accent) 22%, transparent);
  background: color-mix(in srgb, var(--cc-accent) 10%, transparent);
  padding: 12px;
}
.borrow-top{display:flex;align-items:baseline;justify-content:space-between;gap:12px}
.borrow-label{
  font-weight:1000;
  font-size:.82rem;
  text-transform:uppercase;
  letter-spacing:.03em;
  opacity:.86;
}
.borrow-value{font-weight:1100;font-size:1.35rem}
.borrow-sub{color: var(--cc-muted)}

/* Duration + rate rows */
.duration-row{display:flex; gap:10px; margin-bottom:10px}
.duration-pill{
  flex:1;
  border:1px solid rgba(0,0,0,.10);
  background: rgba(255,255,255,.78);
  border-radius:14px;
  padding: 8px 10px;
}
.duration-pill span{display:block; margin-bottom:2px}
.duration-pill input{
  border:none; padding:0; background:transparent;
  box-shadow:none; border-radius:0;
}
.duration-pill input:focus{box-shadow:none}

.rate-row{display:flex; gap:10px; align-items:center}
.rate-pill{width: 110px}
.rate-pill input{padding: 11px 10px}

/* -------- Buttons -------- */
.actions{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}
.actions-right{
  margin-left:auto;
  display:flex;
  align-items:center;
}
.pdf-inline{display:inline-flex}

.btn-primary, .btn-ghost, .btn-outline{
  border-radius: 14px;
  padding: 11px 14px;
  font-weight:1000;
  border:1px solid transparent;
  cursor:pointer;
  user-select:none;
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}

.btn-primary{
  background: var(--cc-accent);
  color:#fff;
  min-width: 160px;
  box-shadow: 0 10px 20px color-mix(in srgb, var(--cc-accent) 30%, transparent);
}
.btn-primary:hover{transform: translateY(-1px)}
.btn-primary:active{transform: translateY(0)}

.btn-ghost{
  background: rgba(0,0,0,.04);
  border-color: rgba(0,0,0,.08);
}
.btn-ghost:hover{transform: translateY(-1px)}
.btn-outline{
  background: rgba(255,255,255,.80);
  border-color: rgba(0,0,0,.12);
}
.btn-outline:hover{transform: translateY(-1px)}

.btn-primary:disabled, .btn-outline:disabled, .btn-ghost:disabled{
  opacity:.55;
  cursor:not-allowed;
  transform:none;
  box-shadow:none;
}

/* -------- Results -------- */
.card-sub{padding-top: 0}
.results-grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.kpi{
  border:1px solid rgba(0,0,0,.08);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255,255,255,.74);
}
.kpi-label{color: var(--cc-muted)}
.kpi-value{
  font-size:1.15rem;
  font-weight:1100;
  margin-top:2px;
}
.note{
  margin-top: 12px;
  border:1px solid rgba(0,0,0,.08);
  background: rgba(0,0,0,.03);
  border-radius: 14px;
  padding: 10px 12px;
  color: var(--cc-muted);
}

/* -------- Amort table -------- */
.amort-card{margin-top: 16px}
.amort-head{
  display:flex;
  gap:12px;
  align-items:flex-start;
  justify-content:space-between;
  flex-wrap:wrap;
}
.amort-tools{display:flex; gap:10px; align-items:center; flex-wrap:wrap}
.amort-tools input[type="search"]{width: 240px}

.table-wrap{
  margin-top:12px;
  overflow:auto;
  border-radius: 14px;
  border:1px solid rgba(0,0,0,.08);
}
.amort-table{
  width:100%;
  border-collapse:collapse;
  min-width: 680px;
  background: rgba(255,255,255,.88);
}
.amort-table th, .amort-table td{
  padding: 10px 12px;
  border-bottom:1px solid rgba(0,0,0,.06);
  text-align:right;
  white-space:nowrap;
}
.amort-table th:first-child, .amort-table td:first-child{text-align:left}
.amort-table thead th{
  position: sticky;
  top: 0;
  background: rgba(255,255,255,.96);
  z-index:1;
  font-weight:1100;
  font-size:.85rem;
  text-transform:uppercase;
  letter-spacing:.03em;
  opacity:.86;
}
.amort-table tbody tr:hover{
  background: color-mix(in srgb, var(--cc-accent) 7%, transparent);
}
.empty{
  text-align:center !important;
  padding:18px;
  color: var(--cc-muted);
}

.pager{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-top: 12px;
}
.pager-info{color: var(--cc-muted)}

/* -------- Tips -------- */
.tips{
  margin-top: 12px;
  display:grid;
  gap:6px;
  color: var(--cc-muted);
}
.tip{
  border:1px solid rgba(0,0,0,.06);
  background: rgba(255,255,255,.70);
  border-radius: 14px;
  padding: 10px 12px;
}

/* -------- Responsive -------- */
@media (max-width: 980px){
  .tool-grid{grid-template-columns: 1fr}
  .ad-left{
    position: static;
    width: 100%;
    min-height: 120px;
  }
}

@media (max-width: 720px){
  .form-grid{grid-template-columns: 1fr}
  .results-grid{grid-template-columns: 1fr 1fr}
  .actions-right{margin-left:0;width:100%}
  .pdf-inline{width:100%}
  #btnPdf{width:100%}
  .btn-primary, .btn-ghost, .btn-outline{width:100%}
  .amort-tools input[type="search"]{width: 100%}
  .rate-row{flex-direction:column; align-items:stretch}
  .rate-pill{width:100%}
}
/* ===== Fix contraste titre sur fond sombre (CMS dark) ===== */
.tool-head{
  color: rgba(255,255,255,.92);
}

.tool-head h1{
  color: rgba(255,255,255,.96);
  text-shadow:
    0 2px 10px rgba(0,0,0,.45),
    0 0 18px rgba(14,159,154,.22);
}

.tool-head p{
  color: rgba(255,255,255,.72);
}

.tool-badge{
  color: rgba(255,255,255,.88);
  background: rgba(14,159,154,.16);
  border-color: rgba(14,159,154,.28);
  box-shadow: 0 10px 22px rgba(0,0,0,.18);
}

/* Petit trait de style sous le titre (clean + lisible) */
.tool-head h1::after{
  content:"";
  display:block;
  width: 110px;
  height: 4px;
  margin-top: 10px;
  border-radius: 999px;
  background: rgba(14,159,154,.9);
  box-shadow: 0 8px 18px rgba(14,159,154,.20);
  opacity: .95;
}

