/* ==========================================================================
   Tools directory (tools/list.blade.php)
   Uses the --ms-* colours from landing.css, so light/dark mode follow the site.
   ========================================================================== */
.tl {
    --tl-red: #f06669; --tl-red-bg: #fadcd9;
    --tl-blue: #2f5d8a; --tl-blue-bg: #dfe4e8;
    --tl-amber: #f59e0b; --tl-amber-bg: #fff6e5;
    --tl-purple: #3a4a5e; --tl-purple-bg: #e3e3e0;
    color: var(--ms-text);
    background: #e6e1d5;
}
html.dark .tl {
    --tl-red-bg: rgba(240, 102, 105, .14); --tl-blue-bg: rgba(205, 196, 172, .15);
    --tl-amber-bg: rgba(245, 158, 11, .14); --tl-purple-bg: rgba(58, 74, 94, .16);
    background: #0d2237;
}
.tl h1, .tl h2, .tl h3 { color: var(--ms-ink); letter-spacing: -.02em; }
.tl [hidden] { display: none !important; }
.tl-red { --tone: var(--tl-red); --tone-bg: var(--tl-red-bg); }
.tl-blue { --tone: var(--tl-blue); --tone-bg: var(--tl-blue-bg); }
.tl-amber { --tone: var(--tl-amber); --tone-bg: var(--tl-amber-bg); }
.tl-purple { --tone: var(--tl-purple); --tone-bg: var(--tl-purple-bg); }

.tl-pill {
    display: inline-block; padding: .28rem .95rem; border: 1px solid #f4b3b1; border-radius: 999px;
    background: var(--ms-red-soft); color: var(--ms-red); font-size: var(--text-md); font-weight: 600; line-height: 1.4;
}
html.dark .tl-pill { border-color: rgba(240, 102, 105, .4); }

/* ---------- Hero ---------- */
.tl-hero { position: relative; overflow: hidden; padding: 2.2rem 0 2.6rem; background: var(--ms-card); border-bottom: 1px solid var(--ms-line); }
.tl-hero::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background:
        radial-gradient(380px 300px at 12% 20%, rgba(205, 196, 172, .13), transparent 70%),
        radial-gradient(420px 320px at 88% 30%, rgba(205, 196, 172, .16), transparent 70%),
        radial-gradient(360px 220px at 60% 110%, rgba(205, 196, 172, .1), transparent 70%);
}
.tl-hero .container { position: relative; }
.tl-crumbs { margin-bottom: .5rem; }
.tl-hero-inner { max-width: 760px; margin: 0 auto; text-align: center; padding-top: 1.2rem; }
.tl-title { margin: 1rem 0 .8rem; font-size: var(--text-8xl); font-weight: 700; line-height: 1.1; }
.tl-lead { max-width: 620px; margin: 0 auto 1.8rem; font-size: var(--text-2xl); line-height: 1.6; color: var(--ms-text); }

.tl-search { display: flex; align-items: center; gap: .5rem; max-width: 640px; margin: 0 auto; padding: .4rem .4rem .4rem 1.1rem; border-radius: 6px; background: var(--ms-card); border: 1px solid var(--ms-line); box-shadow: 0 12px 30px rgba(13, 34, 55, .08); }
.tl-search:focus-within { border-color: var(--ms-red); box-shadow: 0 0 0 4px rgba(240, 102, 105, .12), 0 12px 30px rgba(13, 34, 55, .08); }
.tl-search-icon svg { display: block; width: 18px; height: 18px; color: var(--ms-muted); }
.tl-search-input { flex: 1; min-width: 0; height: 46px; border: 0; outline: 0; background: transparent; color: var(--ms-ink); font-size: var(--text-xl); }
.tl-search-input::placeholder { color: var(--ms-muted); }
.tl-search-input::-webkit-search-cancel-button { cursor: pointer; }
.tl-search-btn { height: 46px; padding: 0 1.6rem; border: 0; border-radius: 6px; background: var(--ms-red); color: #fff; font-weight: 600; box-shadow: 0 8px 20px rgba(240, 102, 105, .28); transition: background-color .2s; }
.tl-search-btn:hover { background: var(--ms-red-dark); }

.tl-facts { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.8rem; margin: 1.5rem 0 0; padding: 0; list-style: none; font-size: var(--text-lg); }
.tl-facts b { color: var(--ms-ink); font-weight: 700; }

/* ---------- Tabs ---------- */
.tl-tabs-wrap { position: sticky; top: 74px; z-index: 5; padding: .65rem 0 .45rem; background: rgba(236, 232, 223, .88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--ms-line); }
html.dark .tl-tabs-wrap { background: rgba(18, 22, 36, .88); }
.tl-tabs { display: flex; flex-wrap: nowrap; justify-content: flex-start; gap: .6rem; min-width: 0; padding: .15rem .25rem .35rem; overflow-x: auto; overflow-y: hidden; scroll-behavior: smooth; scrollbar-width: none; -ms-overflow-style: none; }
.tl-tabs::-webkit-scrollbar { display: none; }
.tl-tab { --tone: var(--ms-red); --tone-bg: var(--ms-red-soft); flex-shrink: 0; display: inline-flex; align-items: center; gap: .55rem; padding: .55rem 1.2rem; border-radius: 999px; border: 1px solid var(--ms-line); background: var(--ms-card); color: var(--ms-ink); font-weight: 600; font-size: var(--text-lg); white-space: nowrap; cursor: pointer; transition: border-color .2s, background-color .2s, color .2s; }
.tl-tab i { min-width: 24px; padding: 0 .45rem; border-radius: 99px; background: var(--tone-bg); color: var(--tone); font-size: var(--text-md); font-style: normal; text-align: center; }
.tl-tab:hover { border-color: var(--tone); }
.tl-tab.is-active { background: var(--tone-bg); border-color: var(--tone); color: var(--tone); }
.tl-tab.is-active i { background: var(--tone); color: #fff; }
.tl-tab:focus-visible { outline: 2px solid var(--tone); outline-offset: 2px; }

/* ---------- Tool groups ---------- */
#tl-tools { padding-top: 1.6rem; padding-bottom: 1rem; scroll-margin-top: 80px; }
.tl-group { margin-bottom: 2.2rem; scroll-margin-top: 90px; }
.tl-group-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; padding-left: .9rem; border-left: 4px solid var(--tone); }
.tl-group-head h2 { margin: 0; font-size: var(--text-4xl); font-weight: 700; }
.tl-group-head p { margin: .2rem 0 0; font-size: var(--text-lg); color: var(--ms-muted); }
.tl-count { flex-shrink: 0; padding: .2rem .75rem; border-radius: 99px; background: var(--tone-bg); color: var(--tone); font-size: var(--text-md); font-weight: 600; }

.tl-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.tl-card { display: flex; align-items: center; gap: .95rem; padding: 1rem 1rem 1rem 1.1rem; border-radius: 6px; background: var(--ms-card); border: 1px solid var(--ms-line); box-shadow: 0 1px 2px rgba(13, 34, 55, .04); text-decoration: none !important; transition: transform .2s, border-color .2s, box-shadow .2s; }
.tl-card:hover { transform: translateY(-2px); border-color: var(--tone); box-shadow: 0 12px 28px rgba(13, 34, 55, .09); }
.tl-card:focus-visible { outline: 2px solid var(--tone); outline-offset: 2px; }
.tl-icon { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 48px; height: 48px; border-radius: 50%; background: var(--tone-bg); color: var(--tone); }
.tl-icon svg { width: 22px; height: 22px; }
.tl-card-text { flex: 1; min-width: 0; }
.tl-card-text b { display: block; color: var(--ms-ink); font-size: var(--text-xl); font-weight: 650; }
.tl-card-text small { display: -webkit-box; margin-top: .15rem; color: var(--ms-text); font-size: var(--text-base); line-height: 1.45; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tl-go { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; background: #e6e1d5; color: var(--ms-muted); transition: background-color .2s, color .2s, transform .2s; }
html.dark .tl-go { background: rgba(255, 255, 255, .06); }
.tl-go svg { width: 12px; height: 12px; }
.tl-card:hover .tl-go { background: var(--tone); color: #fff; transform: translateX(2px); }
[dir="rtl"] .tl-go svg { transform: scaleX(-1); }

.tl-empty { padding: 3rem 1rem; text-align: center; border-radius: 6px; background: var(--ms-card); border: 1px dashed var(--ms-line); margin-bottom: 2rem; }
.tl-empty-icon { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 50%; background: var(--ms-red-soft); color: var(--ms-red); }
.tl-empty-icon svg { width: 22px; height: 22px; }
.tl-empty b { display: block; margin: .9rem 0 .2rem; color: var(--ms-ink); font-size: var(--text-3xl); }
.tl-empty p { margin: 0 0 1.2rem; }

/* ---------- Buttons ---------- */
.tl-btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; height: 46px; padding: 0 1.4rem; border-radius: 6px; font-weight: 600; text-decoration: none !important; white-space: nowrap; cursor: pointer; transition: background-color .2s, transform .2s; }
.tl-btn svg { width: 12px; height: 12px; }
.tl-btn-outline { border: 1.5px solid var(--ms-red); background: transparent; color: var(--ms-red); }
.tl-btn-outline:hover { background: var(--ms-red-soft); }
.tl-btn-light { border: 0; background: #fff; color: var(--ms-red) !important; }
.tl-btn-light:hover { transform: translateY(-1px); }

/* ---------- Full report CTA ---------- */
.tl-cta { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; margin: 1rem 0 3rem; padding: 2rem 2.2rem; border-radius: 6px; color: #fff; background: linear-gradient(120deg, #0d2237, #16233a); box-shadow: 0 20px 40px rgba(240, 102, 105, .25); }
.tl .tl-cta h2 { margin: 0 0 .35rem; color: #fff; font-size: var(--text-5xl); font-weight: 700; }
.tl-cta p { margin: 0; max-width: 620px; color: rgba(255, 255, 255, .92); }

/* ---------- Content sections ---------- */
.tl-section { padding: 3.5rem 0; }
.tl-alt { background: var(--ms-card); border-top: 1px solid var(--ms-line); border-bottom: 1px solid var(--ms-line); }
.tl-head { max-width: 680px; margin: 0 auto 2.2rem; text-align: center; }
.tl-head h2 { margin: .8rem 0 .5rem; font-size: var(--text-6xl); font-weight: 700; line-height: 1.2; }
.tl-head p { margin: 0; font-size: var(--text-2xl); }

.tl-why { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.tl-why-item { padding: 1.5rem; border-radius: 6px; background: var(--ms-card); border: 1px solid var(--ms-line); }
.tl-why-item .tl-icon { width: 46px; height: 46px; border-radius: 6px; margin-bottom: 1rem; }
.tl-why-item h3 { margin: 0 0 .35rem; font-size: var(--text-2xl); font-weight: 650; }
.tl-why-item p { margin: 0; font-size: var(--text-lg); line-height: 1.55; }

.tl-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; }
.tl-step { display: flex; gap: 1rem; padding: 1.3rem 1.5rem; border-radius: 6px; background: var(--ms-card); border: 1px solid var(--ms-line); }
.tl-step > span { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; background: var(--ms-red); color: #fff; font-weight: 700; }
.tl-step h3 { margin: 0 0 .2rem; font-size: var(--text-xl); font-weight: 650; }
.tl-step p { margin: 0; font-size: var(--text-lg); line-height: 1.5; }

.tl-guide { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.2rem; }
.tl-guide-item { padding: 1.6rem; border-radius: 6px; background: #e6e1d5; border: 1px solid var(--ms-line); border-top: 4px solid var(--tone); }
html.dark .tl-guide-item { background: #0d2237; }
.tl-guide-item h3 { margin: 0 0 .6rem; font-size: var(--text-3xl); font-weight: 700; }
.tl-guide-item p { margin: 0 0 1rem; font-size: var(--text-lg); line-height: 1.6; }
.tl-guide-item ul { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.tl-guide-item a { display: inline-block; padding: .25rem .7rem; border-radius: 99px; background: var(--tone-bg); color: var(--tone); font-size: var(--text-base); font-weight: 600; text-decoration: none !important; }
.tl-guide-item a:hover { background: var(--tone); color: #fff; }

.tl-faq { display: grid; gap: .75rem; max-width: 820px; margin: 0 auto; }
.tl-faq details { border-radius: 6px; background: var(--ms-card); border: 1px solid var(--ms-line); transition: border-color .2s; }
.tl-faq details[open] { border-color: rgba(240, 102, 105, .45); }
.tl-faq summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.05rem 1.3rem; color: var(--ms-ink); font-weight: 600; cursor: pointer; list-style: none; }
.tl-faq summary::-webkit-details-marker { display: none; }
.tl-faq summary span { position: relative; flex-shrink: 0; width: 14px; height: 14px; }
.tl-faq summary span::before, .tl-faq summary span::after { content: ""; position: absolute; top: 6px; left: 0; width: 14px; height: 2px; border-radius: 2px; background: var(--ms-red); transition: transform .2s; }
.tl-faq summary span::after { transform: rotate(90deg); }
.tl-faq details[open] summary span::after { transform: rotate(0); }
.tl-faq details p { margin: 0; padding: 0 1.3rem 1.15rem; line-height: 1.6; }

/* ---------- Responsive ---------- */
@media (max-width: 1199.98px) {
    .tl-why { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 991.98px) {
    .tl-grid, .tl-guide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tl-steps { grid-template-columns: 1fr; }
    .tl-cta { flex-direction: column; align-items: flex-start; }
    .tl-tabs-wrap { top: 60px; }
}
@media (max-width: 575.98px) {
    .tl-title { font-size: var(--text-6xl); }
    .tl-lead { font-size: var(--text-xl); }
    .tl-search { padding-left: .9rem; }
    .tl-search-btn { padding: 0 1rem; }
    .tl-grid, .tl-guide, .tl-why { grid-template-columns: 1fr; }
    .tl-group-head { align-items: flex-start; flex-direction: column; gap: .5rem; }
    .tl-cta { padding: 1.6rem 1.3rem; }
    .tl-cta .tl-btn { width: 100%; }
    .tl-head h2 { font-size: var(--text-5xl); }
}
@media (prefers-reduced-motion: reduce) {
    .tl-card, .tl-go, .tl-tab, .tl-btn { transition: none; }
}
