/* Tools pages (/araclar/, /tools/). Builds on site.css and shop/checkout.css. */

/* Index: one grid of cards per group */
.tools-group .h3 { margin-block-end: 16px; }
.tool-cards { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .tool-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .tool-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tool-card a { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 14px; height: 100%; padding: 18px; background: var(--grey); border: 1px solid var(--line); }
.tool-card a:hover { border-color: var(--red); color: inherit; }
.tool-card__icon { grid-row: span 2; display: grid; place-items: center; width: 44px; height: 44px; background: var(--white); color: var(--red-text); }
.tool-card__name { font-weight: 800; color: var(--ink); }
.tool-card__text { font-size: 14px; }

/* A tool page */
.tool-form { flex-wrap: wrap; }
.tool-select { flex: 0 0 auto; width: auto; min-width: 110px; }
.tool-title { margin-block: 28px 12px; }
.tool-result { margin-block-start: 28px; }
.tool-big { margin-block-start: 8px; font-size: 22px; font-weight: 800; color: var(--ink); overflow-wrap: anywhere; }
.tool-flag { margin-block-start: 12px; padding: 12px 16px; background: var(--grey); border-inline-start: 4px solid #e0a100; color: var(--ink); font-weight: 700; }
.tool-flag--ok { border-color: #1e9e57; }
.tool-flag--bad { border-color: var(--red-text); }
.tool-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; overflow-wrap: anywhere; }
.tool-table-wrap { overflow-x: auto; margin-block-start: 16px; }
.tool-table { width: 100%; border-collapse: collapse; }
.tool-table th, .tool-table td { padding: 10px 12px; text-align: start; vertical-align: top; border-block-end: 1px solid var(--line); }
.tool-table th { font-size: 14px; color: var(--body); }
.tool-table td:first-child { font-weight: 800; color: var(--ink); white-space: nowrap; }
.tool-stats { display: grid; gap: 12px; margin: 20px 0 0; padding: 0; list-style: none; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.tool-stats li { display: grid; gap: 4px; padding: 16px; background: var(--grey); }
.tool-stats span { font-size: 14px; }
.tool-stats strong { font-size: 22px; color: var(--ink); overflow-wrap: anywhere; }
.tool-stats--wide { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.tool-tries { margin: 16px 0 0; padding-inline-start: 20px; }
.tool-mine { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-block-end: 24px; padding: 20px; background: var(--ink); color: var(--muted-dark); }
.tool-mine strong { font-size: 26px; color: var(--white); overflow-wrap: anywhere; }
.tool-mine .btn--outline { margin-inline-start: auto; color: var(--white); border-color: var(--line-dark); }
.tool-aside { margin-block-start: 40px; padding: 24px; background: var(--grey); }
.tool-aside p { margin-block: 6px 16px; }
.tool-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-block-start: 20px; }
.tool-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.tool-links a { display: block; padding: 8px 14px; background: var(--white); border: 1px solid var(--line); font-size: 14px; font-weight: 700; color: var(--ink); }
.tool-links a:hover { border-color: var(--red); }
.tool-legal { margin-block-start: 28px; font-size: 13px; }
[data-level="good"] { color: #1e7d46 !important; }
[data-level="average"] { color: #a86b00 !important; }
[data-level="poor"] { color: var(--red-text) !important; }

/* Choices (VAT rates, mobile / desktop) */
.tool-calc__fields { display: grid; gap: 16px; max-width: 640px; }
.tool-choices { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 0; padding: 0; border: 0; }
.tool-choices legend { width: 100%; margin-block-end: 6px; }
.tool-choices label, .tool-toggle label { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--ink); cursor: pointer; }
.tool-choices__custom { width: 90px; }
.tool-toggle { display: inline-flex; align-items: center; gap: 14px; padding-inline: 8px; }

/* Speed test */
.tool-wait { display: flex; align-items: center; gap: 12px; margin-block-start: 24px; font-weight: 700; color: var(--ink); }
.tool-spinner { width: 20px; height: 20px; border: 3px solid var(--line); border-block-start-color: var(--red); border-radius: 50%; animation: tool-spin 0.8s linear infinite; }
@keyframes tool-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .tool-spinner { animation-duration: 3s; } }
.tool-score { display: flex; align-items: center; gap: 16px; font-weight: 700; color: var(--ink); }
.tool-score__ring { display: grid; place-items: center; width: 84px; height: 84px; border: 6px solid currentColor; border-radius: 50%; font-size: 30px; font-weight: 800; }
.tool-opps { margin: 0; padding: 0; list-style: none; border-block-start: 1px solid var(--line); }
.tool-opps li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding-block: 12px; border-block-end: 1px solid var(--line); }
.tool-opps strong { color: var(--ink); }

/* Color */
.tool-color__pick { display: flex; flex-wrap: wrap; align-items: end; gap: 16px; }
.tool-color__swatch input { width: 96px; height: 96px; padding: 0; border: 1px solid var(--line); background: none; cursor: pointer; }
.tool-color__pick .field { flex: 1 1 220px; }
.tool-codes { margin: 24px 0 0; padding: 0; list-style: none; border-block-start: 1px solid var(--line); }
.tool-codes li { display: grid; grid-template-columns: 60px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding-block: 10px; border-block-end: 1px solid var(--line); }
.tool-codes span { font-weight: 800; color: var(--ink); }
.tool-codes code { font-size: 15px; color: var(--ink); overflow-wrap: anywhere; }
.tool-codes .btn, .tool-mine .btn { padding: 10px 14px; }
.tool-shades { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.tool-shades button { width: 100%; height: 64px; border: 0; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.tool-contrast { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tool-contrast li { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.tool-contrast__sample { display: grid; place-items: center; height: 44px; border: 1px solid var(--line); font-size: 20px; font-weight: 800; }
.tool-contrast strong { color: var(--ink); }

/* Business card and signature makers: the form, and the live preview beside it */
.tool-maker { display: grid; gap: 32px; }
@media (min-width: 1000px) { .tool-maker { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start; } .tool-maker__preview { position: sticky; top: 24px; } }
.tool-maker__form { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .tool-maker__form { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tool-maker__color { width: 64px; height: 44px; padding: 0; border: 1px solid var(--line); background: none; cursor: pointer; }
.tool-maker__preview .field__label { display: block; margin-block: 16px 8px; }
.tool-maker__preview .field__label:first-child { margin-block-start: 0; }
.tool-sig { padding: 24px; background: var(--white); border: 1px solid var(--line); overflow-x: auto; }
.tool-code { width: 100%; margin-block-start: 12px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.tool-howto { margin: 0; padding-inline-start: 20px; }
.tool-howto li { margin-block-end: 6px; }

/* The card itself: 85×55 mm, drawn at 3.4 px per mm on screen */
.bcard { --card: #ff4040; position: relative; display: grid; grid-template-rows: auto 1fr auto; width: 100%; max-width: 408px; aspect-ratio: 85 / 55; padding: 7% 7% 6%; background: #fff; color: #1d1d21; border: 1px solid var(--line); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08); overflow: hidden; font-size: clamp(9px, 2.6vw, 12px); line-height: 1.45; }
.bcard__bar { position: absolute; inset-block: 0; inset-inline-start: 0; width: 6px; background: var(--card); }
.bcard__main strong { display: block; font-size: 1.6em; line-height: 1.2; }
.bcard__main span { color: var(--card); font-weight: 700; }
.bcard__info { display: grid; align-self: end; color: #444; }
.bcard--back { grid-template-rows: auto 1fr auto; justify-items: center; align-items: center; text-align: center; background: var(--card); color: #fff; }
.bcard--back strong { font-size: 1.5em; }
.bcard--back img { width: 34%; height: auto; aspect-ratio: 1; background: #fff; }
.bcard__scan { font-size: 0.85em; opacity: 0.9; }
.bcard span:empty, .bcard strong:empty { display: none; }

/* Downloader */
.tool-media { display: grid; gap: 20px; }
@media (min-width: 760px) { .tool-media { grid-template-columns: 240px minmax(0, 1fr); align-items: start; } }
.tool-media__thumb { width: 100%; height: auto; background: var(--grey); }
.tool-files { margin: 16px 0 0; padding: 0; list-style: none; border-block-start: 1px solid var(--line); }
.tool-files li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding-block: 12px; border-block-end: 1px solid var(--line); font-weight: 700; color: var(--ink); }
.tool-files small { font-weight: 400; color: var(--body); }
.tool-files .btn { padding: 10px 18px; }

/* Printing the card: only the two sides, one per 85×55 mm page */
@media print {
  @page { size: 85mm 55mm; margin: 0; }
  body:has([data-card]) * { visibility: hidden; }
  body:has([data-card]) .hdr, body:has([data-card]) .ftr, body:has([data-card]) .band, body:has([data-card]) .consent { display: none; }
  body:has([data-card]) .bcard, body:has([data-card]) .bcard * { visibility: visible; }
  body:has([data-card]) .bcard { position: relative; width: 85mm; max-width: none; height: 55mm; margin: 0; border: 0; box-shadow: none; font-size: 8pt; break-after: page; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  body:has([data-card]) .tool-maker { display: block; }
  body:has([data-card]) .tool-maker__form, body:has([data-card]) .tool-maker__preview > :not(.bcard), body:has([data-card]) .sec--grey { display: none; }
  body:has([data-card]) .sec, body:has([data-card]) .wrap, body:has([data-card]) .buy .wrap { padding: 0; margin: 0; }
}
