/* tools.css — scoped styles for /tools hub + calculators. Loaded only on the Tools controller.
   Layered over redesign.css; reuses shared classes (rp-eyebrow, rp-h2). Prefix: tool- */

.tool-hero {
    background: linear-gradient(135deg, #141c4d 0%, #1e2a6b 100%);
    color: #fff;
    padding: 3.5rem 0 2.5rem;
    text-align: center;
}
.tool-hero .rp-eyebrow { background: rgba(255,255,255,.14); color: #dbe4ff; }
.tool-hero h1 { color: #fff; font-weight: 800; margin: .6rem 0 .5rem; }
.tool-hero__lead { color: #c7d0f0; max-width: 720px; margin: 0 auto; font-size: 1.05rem; }

.tool-section { padding: 3rem 0; }

/* Calculator card */
.tool-app {
    max-width: 920px;
    margin: -2.5rem auto 0;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 18px 50px rgba(20,28,77,.14);
    padding: 1.75rem;
    position: relative;
    z-index: 3;
}
@media (min-width: 768px) { .tool-app { padding: 2.25rem; } }

.tool-app__grid { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 768px) { .tool-app__grid { grid-template-columns: 1fr 1fr; } }

.tool-field { margin-bottom: 1.1rem; }
.tool-field label { display: block; font-weight: 600; color: #141c4d; margin-bottom: .35rem; font-size: .92rem; }
.tool-input-wrap { position: relative; display: flex; align-items: center; }
.tool-input-wrap .tool-cur {
    position: absolute; left: 14px; color: #64748b; font-weight: 600; pointer-events: none;
}
.tool-app input[type="number"] {
    width: 100%; padding: .75rem .9rem .75rem 2.1rem;
    border: 1.5px solid #e2e8f0; border-radius: 12px; font-size: 1.05rem; color: #141c4d;
    transition: border-color .15s, box-shadow .15s;
}
.tool-app input[type="number"]:focus {
    outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.tool-app select {
    width: 100%; padding: .7rem .9rem; border: 1.5px solid #e2e8f0; border-radius: 12px;
    font-size: 1rem; color: #141c4d; background: #fff;
}

/* Results panel */
.tool-results {
    background: #f5f7fb; border-radius: 16px; padding: 1.25rem; display: grid; gap: .85rem;
    align-content: start;
}
.tool-result {
    display: flex; justify-content: space-between; align-items: baseline;
    padding: .65rem .9rem; background: #fff; border-radius: 12px; border: 1px solid #eef1f8;
}
.tool-result__label { color: #475569; font-weight: 600; font-size: .9rem; }
.tool-result__value { color: #141c4d; font-weight: 800; font-size: 1.35rem; }
.tool-result--accent { background: linear-gradient(135deg, #2563eb, #3b82f6); border: none; }
.tool-result--accent .tool-result__label,
.tool-result--accent .tool-result__value { color: #fff; }

.tool-hint { font-size: .82rem; color: #64748b; margin-top: .25rem; }

/* Content + FAQ */
.tool-prose { max-width: 820px; margin: 0 auto; }
.tool-prose h2 { color: #141c4d; font-weight: 800; margin-top: 2rem; }
.tool-prose p, .tool-prose li { color: #334155; line-height: 1.75; }
.tool-formula {
    background: #f5f7fb; border-left: 4px solid #2563eb; border-radius: 8px;
    padding: .85rem 1.1rem; margin: 1rem 0; font-family: ui-monospace, "Cascadia Code", monospace; color: #141c4d;
}

/* Tools hub grid */
.tool-hub-grid { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 576px) { .tool-hub-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .tool-hub-grid { grid-template-columns: repeat(3, 1fr); } }
.tool-hub-card {
    display: flex; flex-direction: column; background: #fff; border: 1px solid #eef1f8;
    border-radius: 18px; padding: 1.5rem; box-shadow: 0 8px 24px rgba(20,28,77,.06);
    transition: transform .18s, box-shadow .18s; text-decoration: none;
}
.tool-hub-card:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(20,28,77,.12); }
.tool-hub-card__icon {
    width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
    background: linear-gradient(135deg, #2563eb, #3b82f6); color: #fff; font-size: 1.35rem; margin-bottom: 1rem;
}
.tool-hub-card__title { color: #141c4d; font-weight: 700; font-size: 1.1rem; margin-bottom: .4rem; }
.tool-hub-card__text { color: #475569; font-size: .92rem; flex: 1; }
.tool-hub-card__cta { color: #2563eb; font-weight: 700; font-size: .9rem; margin-top: .9rem; }
.tool-hub-card--soon { opacity: .72; cursor: default; }
.tool-hub-card--soon:hover { transform: none; box-shadow: 0 8px 24px rgba(20,28,77,.06); }
.tool-badge-soon { font-size: .7rem; font-weight: 700; color: #64748b; background: #eef1f8; padding: .15rem .5rem; border-radius: 999px; }

/* ===== Invoice generator ===== */
.tool-invoice { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 992px) { .tool-invoice { grid-template-columns: minmax(0,1fr) minmax(0,1.05fr); align-items: start; } }

.tool-invoice__editor {
    background: #fff; border-radius: 18px; box-shadow: 0 10px 30px rgba(20,28,77,.08);
    padding: 1.5rem; border: 1px solid #eef1f8;
}
.tool-subhead { color: #141c4d; font-weight: 700; font-size: .95rem; margin: 1.4rem 0 .6rem; padding-top: 1rem; border-top: 1px dashed #e2e8f0; }
.tool-invoice__editor input[type="text"],
.tool-invoice__editor input[type="number"],
.tool-invoice__editor input[type="date"] {
    width: 100%; padding: .6rem .75rem; border: 1.5px solid #e2e8f0; border-radius: 10px; font-size: .95rem; color: #141c4d;
}
.tool-invoice__editor input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.15); }

.inv-item-row { display: grid; grid-template-columns: 1fr 64px 92px 32px; gap: .5rem; margin-bottom: .5rem; align-items: center; }
.inv-del { border: none; background: #fee2e2; color: #b91c1c; width: 32px; height: 38px; border-radius: 8px; font-size: 1.1rem; line-height: 1; cursor: pointer; }
.inv-del:hover { background: #fecaca; }
.tool-invoice__actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid #eef1f8; }

/* The printable paper */
.tool-invoice__preview { position: static; }
@media (min-width: 992px) { .tool-invoice__preview { position: sticky; top: 1rem; } }
.inv-paper {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 1.6rem;
    color: #141c4d; font-size: .9rem; box-shadow: 0 10px 30px rgba(20,28,77,.08); min-height: 420px;
}
.inv-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.25rem; }
.inv-biz { font-size: 1.15rem; font-weight: 800; color: #141c4d; }
.inv-title { font-size: 1.1rem; font-weight: 800; color: #2563eb; letter-spacing: .04em; white-space: nowrap; }
.inv-muted { color: #64748b; font-size: .82rem; margin-top: .1rem; }
.inv-meta { display: flex; justify-content: space-between; gap: 1rem; padding: .9rem 0; border-top: 1px solid #eef1f8; border-bottom: 1px solid #eef1f8; margin-bottom: 1rem; }
.inv-meta-right { text-align: right; }
.inv-label { color: #94a3b8; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.inv-strong { font-weight: 700; color: #141c4d; }
.inv-table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.inv-table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: #94a3b8; border-bottom: 2px solid #eef1f8; padding: .4rem .5rem; }
.inv-table td { padding: .45rem .5rem; border-bottom: 1px solid #f1f5f9; }
.inv-table .num, .inv-totals .num { text-align: right; white-space: nowrap; }
.inv-empty { color: #94a3b8; text-align: center; font-style: italic; }
.inv-totals { display: flex; justify-content: flex-end; }
.inv-totals table { width: 260px; max-width: 100%; }
.inv-totals td { padding: .3rem .5rem; }
.inv-grand td { border-top: 2px solid #141c4d; font-weight: 800; font-size: 1.05rem; padding-top: .5rem; }
.inv-foot { margin-top: 1.5rem; text-align: center; color: #94a3b8; font-size: .78rem; }

/* Print: show ONLY the invoice paper (tools.css loads on Tools controller only) */
@media print {
    body * { visibility: hidden !important; }
    #inv-paper, #inv-paper * { visibility: visible !important; }
    #inv-paper { position: absolute; left: 0; top: 0; width: 100%; border: none; box-shadow: none; padding: 0; }
}
