/* Water Filtration Ireland — Apps
 * Design language: Wix palette (blue #154bff + coral #e55e75, white cards) with
 * the card/nav/button structure of the internal DPD tool. */

:root {
    --blue: #154bff;
    --blue-bright: #116dff;
    --blue-deep: #0b35d6;
    --coral: #e55e75;
    --orange: #ff8044;
    --ink: #18243a;
    --muted: #5f6b81;
    --faint: #8d97ab;
    --bg: #f6f8ff;
    --card: #ffffff;
    --border: #dfe5f2;
    --ok: #1a9d5b;
    --err: #b4232f;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 12px 28px rgba(24, 36, 58, 0.10), 0 2px 6px rgba(24, 36, 58, 0.06);
    --font-head: 'Oswald', 'Helvetica Neue', Arial, sans-serif;
    --font-body: 'Helvetica Neue', 'Segoe UI', Arial, Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3 { font-family: var(--font-head); letter-spacing: 0.01em; }

/* ── Accessible focus ──────────────────────────────────────────────── */
:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 2px;
    border-radius: 4px;
}
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--blue);
    color: #fff;
    padding: 10px 16px;
    border-radius: 6px;
    z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ── Navigation (DPD-style bar, WFI blue) ──────────────────────────── */
#topnav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: linear-gradient(135deg, var(--blue) 0%, var(--blue-bright) 100%);
    color: #fff;
    box-shadow: 0 8px 20px rgba(21, 75, 255, 0.25);
}
.nav-inner {
    max-width: 1024px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
}
.brand-icon { width: 26px; height: 26px; flex: none; }
.brand-name strong { font-weight: 700; }
.brand-pill {
    display: inline-block;
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 999px;
    text-transform: uppercase;
    margin-left: 4px;
}
.nav-tabs { display: none; }
.nav-tab {
    appearance: none;
    border: none;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.nav-tab:hover { background: rgba(255, 255, 255, 0.28); }
.nav-tab.is-active { background: #fff; color: var(--blue); font-weight: 700; }
.nav-tab.is-disabled {
    opacity: 0.75;
    cursor: default;
    background: rgba(255, 255, 255, 0.10);
}
.nav-cta { color: #fff; font-size: 13.5px; font-weight: 600; text-decoration: none; display: none; }
.nav-cta:hover { text-decoration: underline; }

@media (min-width: 720px) {
    .nav-inner { gap: 20px; }
    .nav-tabs { display: flex; gap: 6px; flex: 1; }
/* ── Layout / cards ────────────────────────────────────────────────── */
main { max-width: 1024px; margin: 0 auto; padding: 8px 16px 40px; flex: 1; }
.page { display: block; margin-top: 8px; }
.page[hidden] { display: none; }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 26px 28px;
    margin-bottom: 22px;
}
.card h2 { margin: 0 0 12px; font-size: 20px; font-weight: 600; }

/* ── Inputs ────────────────────────────────────────────────────────── */
.field { margin-bottom: 20px; }
.field label {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 6px;
}
.input-wrap {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input-wrap:focus-within {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(21, 75, 255, 0.18);
}
.input-prefix, .input-suffix {
    padding: 0 12px;
    color: var(--muted);
    font-size: 17px;
    font-weight: 600;
    font-family: var(--font-body);
}
.input-wrap input {
    appearance: none;
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    min-width: 0;
    font-size: 19px;
    font-family: var(--font-body);
    padding: 11px 12px;
    color: var(--ink);
}
.input-wrap input::placeholder { color: var(--faint); }
.hint { margin: 5px 0 0; font-size: 12.5px; color: var(--faint); }

/* ── Rate chips ────────────────────────────────────────────────────── */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip {
    appearance: none;
    border: 1.5px solid var(--border);
    background: #fff;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    padding: 5px 13px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.chip:hover { border-color: var(--blue); color: var(--blue); }
.chip.is-active {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
    font-weight: 700;
}
    .nav-cta { display: inline; margin-left: auto; }
}

/* ── Hero ──────────────────────────────────────────────────────────── */
.hero {
    background: linear-gradient(180deg, var(--blue) 0%, var(--blue-deep) 100%);
    color: #fff;
    padding: 40px 16px 48px;
}
.hero-inner { max-width: 1024px; margin: 0 auto; }
.eyebrow {
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.85;
    margin: 0 0 6px;
}
.hero h1 { margin: 0 0 10px; font-size: clamp(30px, 5vw, 44px); font-weight: 600; }
/* ── Buttons ───────────────────────────────────────────────────────── */
.btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    border: 1.5px solid transparent;
    border-radius: var(--radius-sm);
    padding: 10px 18px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease,
                transform 0.1s ease, box-shadow 0.15s ease;
}
.btn:hover { box-shadow: 0 4px 12px rgba(24, 36, 58, 0.14); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
    background: var(--blue);
    color: #fff;
    font-weight: 700;
}
.btn-primary:hover { background: var(--blue-deep); }

.btn-coral {
    background: rgba(229, 94, 117, 0.12);
    color: var(--coral);
    border-color: rgba(229, 94, 117, 0.45);
    font-weight: 700;
}
.btn-coral:hover { background: var(--coral); color: #fff; border-color: var(--coral); }

.btn-ghost { background: transparent; color: var(--muted); border-color: var(--border); }
.btn-ghost:hover { color: var(--ink); border-color: var(--muted); }

.btn-lg { width: 100%; }
.btn-sm { font-size: 12.5px; padding: 6px 12px; }

.actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 6px 0 0;
}

/* ── Result ────────────────────────────────────────────────────────── */
.result {
    margin-top: 26px;
    border-top: 1.5px solid var(--border);
    padding-top: 20px;
    animation: resultIn 0.28s ease-out;
}
.result[hidden] { display: none; }
@keyframes resultIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}
.result-head { display: flex; align-items: center; gap: 10px; }
.result-chip {
    display: inline-block;
    background: rgba(21, 75, 255, 0.1);
    color: var(--blue);
    font-size: 12.5px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    letter-spacing: 0.02em;
}
.result-chip.is-remove {
    background: rgba(229, 94, 117, 0.12);
    color: var(--coral);
}
.result-big { display: block; margin: 14px 0 4px; }
.result-value {
    display: block;
    font-family: var(--font-head);
    font-size: clamp(30px, 6vw, 40px);
    font-weight: 600;
    color: var(--blue);
}
.result-value.is-coral { color: var(--coral); }
.result-caption { display: block; color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.result-detail { margin: 14px 0 0; display: grid; grid-template-columns: auto auto; gap: 6px 18px; }
.result-row { display: flex; gap: 8px; }
.result-row dt { color: var(--faint); font-size: 12.5px; min-width: 92px; }
.result-row dd { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--ink); }

/* ── History ───────────────────────────────────────────────────────── */
.history-card { padding-top: 20px; }
.history-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
/* ── Toasts ─────────────────────────────────────────────────────────── */
#toast-container {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 90;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(360px, calc(100vw - 32px));
}
.toast {
    background: var(--ink);
    color: #fff;
    border-radius: var(--radius-sm);
    padding: 11px 15px;
    font-size: 13.5px;
    box-shadow: var(--shadow);
    display: flex;
    gap: 8px;
    align-items: center;
    animation: toastIn 0.25s ease-out;
}
.toast.is-success { background: #14532d; }
.toast.is-error { background: #7f1d1d; }
.toast.is-info { background: var(--blue-deep); }
.toast.is-warning { background: #713f12; }
.toast button {
    appearance: none;
    border: none;
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 700;
    padding: 3px 9px;
    cursor: pointer;
    align-self: flex-start;
}
@keyframes toastIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

/* ── Footer ────────────────────────────────────────────────────────── */
footer {
    background: #111;
    color: #cdd4e0;
    padding: 26px 16px 30px;
}
.footer-inner { max-width: 1024px; margin: 0 auto; }
.footer-inner .brand-icon { width: 20px; height: 20px; }
.footer-brand { font-size: 14px; font-weight: 700; color: #fff; }
.footer-tag {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #cdd4e0;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    margin-left: 6px;
}
.footer-note { margin: 10px 0 6px; font-size: 12.5px; color: #9aa4b5; }
.footer-mail { font-size: 13.5px; color: var(--blue-bright); text-decoration: none; }
.footer-mail:hover { text-decoration: underline; }

/* ── Placeholder page ──────────────────────────────────────────────── */
.placeholder-text { margin: 10px 0 0; color: var(--muted); }

/* ── Small screens / motion preferences ────────────────────────────── */
@media (max-width: 560px) {
    .actions { grid-template-columns: 1fr; }
    .card { padding: 20px 18px; }
    .history-list { max-height: 280px; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
.history-head h2 { margin: 0; font-size: 18px; font-weight: 600; }
.history-empty { margin: 12px 0 0; font-size: 13.5px; color: var(--faint); }
.history-list {
    list-style: none;
    margin: 14px 0 0;
    padding: 0;
    counter-reset: hitem;
    max-height: 340px;
    overflow-y: auto;
}
.history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    background: #fff;
    counter-increment: hitem;
}
.history-num {
    flex: none;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: rgba(21, 75, 255, 0.1);
    color: var(--blue);
    font-size: 11.5px;
    font-weight: 700;
    display: grid;
    place-items: center;
}
.history-main { flex: 1; min-width: 0; }
.history-main strong { color: var(--ink); font-size: 14px; display: block; }
.history-sub { color: var(--faint); font-size: 12px; margin-top: 2px; }
.history-copy { font-size: 12px; padding: 5px 10px; }
.history-copy:hover { box-shadow: none; transform: none; }
.lede { margin: 0; font-size: 16.5px; opacity: 0.92; max-width: 640px; }