/*
08.10.2026 V1.0
PROJET FACTIZY
CSS mini: 3
FACTIZY/FACTIZY/css/calculatrice.css
styles de la calculatrice flottante (js/calculatrice.js) ; couleurs issues du theme via les variables --ft-* definies dans index.php

Liste des modifications faites :
08.10.2026 Creation : fenetre flottante deplacable, touches, historique, convertisseur HT/TVA/TTC
*/
.ft-calc {
  --ft-c2: #E0A000; --ft-c4: #FFBD24; --ft-c5: #8A5A00; --ft-c6: #1F1A10; --ft-c7: #7A4A00;
  --ft-sur-c4: #000; --ft-sur-c7: #fff; --ft-sur-c2: #000;
  position: fixed; z-index: 1100; width: 300px; max-width: calc(100vw - 16px);
  background: #fff; color: #222; border: 2px solid var(--ft-c5); border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,.28); font-size: 14px; line-height: 1.3;
}
.ft-calc[hidden] { display: none; }
.ft-calc * { box-sizing: border-box; }
.ft-calc.glisse { opacity: .92; user-select: none; }
.ft-calc.glisse .ft-calc-t { cursor: grabbing; }

.ft-calc-t { display: flex; align-items: center; gap: 4px; padding: 6px 8px; background: var(--ft-c4); color: var(--ft-sur-c4); border-radius: 8px 8px 0 0; cursor: grab; touch-action: none; }
.ft-calc-titre { flex: 1; font-weight: 700; }
.ft-calc-ic { border: 0; background: transparent; color: inherit; width: 28px; height: 28px; border-radius: 6px; cursor: pointer; }
.ft-calc-ic:hover, .ft-calc-ic:focus-visible { background: rgba(0,0,0,.15); }
.ft-calc.replie .ft-calc-c { display: none; }
.ft-calc.replie .ft-calc-t { border-radius: 8px; }

.ft-calc-c { padding: 8px; }
.ft-calc-onglets { display: flex; gap: 4px; margin-bottom: 8px; }
.ft-calc-onglets button { flex: 1; padding: 5px 4px; border: 1px solid var(--ft-c5); background: #fff; color: var(--ft-c6); border-radius: 6px; cursor: pointer; font-size: 13px; }
.ft-calc-onglets button.actif { background: var(--ft-c7); color: var(--ft-sur-c7); border-color: var(--ft-c7); font-weight: 700; }

.ft-calc-expr, .ft-calc input[type=text] { width: 100%; padding: 6px 8px; border: 1px solid #999; border-radius: 6px; background: #fff; color: #111; font-size: 16px; }
.ft-calc-expr { font-size: 20px; text-align: right; font-variant-numeric: tabular-nums; }
.ft-calc input[type=text]:focus, .ft-calc button:focus-visible { outline: 3px solid var(--ft-c7); outline-offset: 1px; }
.ft-calc-res { min-height: 24px; padding: 2px 4px; text-align: right; font-size: 18px; font-weight: 700; color: var(--ft-c6); font-variant-numeric: tabular-nums; word-break: break-all; }
.ft-calc-mem { font-size: 12px; color: var(--ft-c7); text-align: left; margin-top: -22px; height: 18px; pointer-events: none; font-weight: 700; }
.ft-calc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.ft-calc-grille { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin: 8px 0; }
.ft-calc-b { padding: 9px 0; border: 1px solid #aaa; border-radius: 6px; background: #f4f4f4; color: #111; font-size: 16px; cursor: pointer; }
.ft-calc-b:hover { background: #e6e6e6; }
.ft-calc-b:active { transform: translateY(1px); }
.ft-b-op { background: var(--ft-c4); color: var(--ft-sur-c4); border-color: var(--ft-c5); font-weight: 700; }
.ft-b-op:hover { background: var(--ft-c2); color: var(--ft-sur-c2); }
.ft-b-egal { grid-column: span 3; background: var(--ft-c7); color: var(--ft-sur-c7); border-color: var(--ft-c7); font-weight: 700; }
.ft-b-egal:hover { filter: brightness(1.12); background: var(--ft-c7); }
.ft-b-mem { font-size: 13px; padding: 6px 0; background: #fff; color: var(--ft-c6); }
.ft-b-fn { background: #eaeaea; }

.ft-calc-ins, .ft-calc-b2 { width: 100%; padding: 8px; border: 1px solid var(--ft-c7); border-radius: 6px; background: #fff; color: var(--ft-c7); cursor: pointer; font-weight: 700; }
.ft-calc-ins:hover:not(:disabled), .ft-calc-b2:hover:not(:disabled) { background: var(--ft-c7); color: var(--ft-sur-c7); }
.ft-calc-ins:disabled, .ft-calc-b2:disabled { opacity: .5; cursor: not-allowed; border-color: #999; color: #555; }

.ft-calc-histo { margin-top: 8px; border-top: 1px solid #ddd; padding-top: 6px; }
.ft-calc-histo-t { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; color: #444; }
.ft-calc-lien { border: 0; background: transparent; color: var(--ft-c7); text-decoration: underline; cursor: pointer; font-size: 12px; padding: 0; }
.ft-calc-liste { list-style: none; margin: 4px 0 0; padding: 0; max-height: 110px; overflow-y: auto; }
.ft-calc-h { display: flex; justify-content: space-between; gap: 8px; width: 100%; border: 0; background: transparent; padding: 3px 4px; text-align: left; cursor: pointer; border-radius: 4px; color: #222; font-size: 13px; }
.ft-calc-h:hover { background: #f1f1f1; }
.ft-calc-h-e { color: #555; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ft-calc-h-r { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ft-calc-vide { color: #666; font-size: 12px; padding: 2px 4px; }

.ft-calc-pan label { display: block; margin: 8px 0 2px; font-weight: 700; font-size: 13px; }
.ft-calc-taux label { margin-top: 0; }
.ft-calc-puces { display: flex; gap: 4px; margin: 4px 0 2px; flex-wrap: wrap; }
.ft-calc-puce { border: 1px solid var(--ft-c5); background: #fff; color: var(--ft-c6); border-radius: 12px; padding: 2px 10px; cursor: pointer; font-size: 13px; }
.ft-calc-puce:hover { background: var(--ft-c4); color: var(--ft-sur-c4); }
.ft-calc-tvam { margin: 8px 0 0; text-align: right; font-size: 15px; }
.ft-calc-act { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 10px; }
.ft-calc-b2 { font-size: 13px; padding: 6px 4px; }

@media (max-width: 480px) { .ft-calc { width: calc(100vw - 16px); } }
@media (prefers-reduced-motion: no-preference) { .ft-calc-b { transition: background .12s; } }
