/*
 * buy.wiosoft.com theme: the RentalTrax look of www.rentaltrax.com (website/src/styles/site.css) over the legacy
 * layout.css (loaded after it, master_head.php), so the order page reads as the next page of the site: the off-white
 * page, the RentalTrax logo and the heading on it, each step a white card with a hairline and large corners, the green
 * accent for what is chosen, the main action filled in ink, one column on a phone. The tokens in :root are a copy of
 * rentalsystem/css/theme.css's (one palette for the site, the system and the Backoffice; a colour is added there
 * first). Figtree is self-hosted in media/fonts (SIL Open Font License). The payment page
 * (backoffice/payment/public/media/css/theme.css) has the same look.
 */
@font-face {
    font-family: 'Figtree';
    font-style: normal;
    font-display: swap;
    font-weight: 300 900;
    src: url(../fonts/figtree-latin-ext-wght-normal.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
        U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Figtree';
    font-style: normal;
    font-display: swap;
    font-weight: 300 900;
    src: url(../fonts/figtree-latin-wght-normal.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
        U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --font: Figtree, system-ui, -apple-system, 'Segoe UI', sans-serif;
    --ink: #26332F;
    --ink-2: #3A4744;
    --muted: #5E6B67;
    --line: #DCE3E0;
    --divider: #EDF1EF;
    --page: #F1F3F2;
    --surface: #FFFFFF;
    --zebra: #F8FAF9;
    --accent: #2F7A5B;
    --accent-soft: #2F7A5B1A;
    --accent-ring: #2F7A5B24;
    --accent-strong: #24614A;
    --ok: #2E7D4F;
    --ok-bg: #E6F2EB;
    --error-line: #C4473F;
    --error-text: #A63A32;
    --radius-card: 18px;
    --radius-button: 10px;
}

body, * , input, select, textarea, button { font-family: var(--font); }
html { background: var(--page); }
body {
    background: var(--page);
    color: var(--ink);
    font-size: 14px;
    line-height: 1.55;
    font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
a:hover { color: var(--accent-strong); }

/* ---------- Header, hero, footer ---------- */
/* the header and the heading sit on the page, as the site's: no bar, no coloured band */
#header { background: transparent; border: 0; padding: 22px 0 0; }
#logo { width: auto; padding: 0; text-align: center; }
#logo { display: block; }
#logo img { display: inline-block; height: 40px; width: auto; vertical-align: top; }
div.powered-by { color: var(--muted); font-weight: 600; letter-spacing: .06em; }
#header-title {
    background: transparent;
    box-shadow: none;
    margin: 0;
    padding: 34px 16px 36px;
}
#header-title h1 {
    color: var(--ink);
    font-size: clamp(28px, 4.4vw, 44px);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -.04em;
    text-shadow: none;
    text-wrap: balance;
    margin: 0;
}
div#footer {
    background: transparent;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
    margin-top: 40px;
    padding: 24px 16px;
}

/* ---------- Page ---------- */
div#container { width: auto; max-width: 1080px; padding: 0 16px; box-sizing: border-box; }
#content { margin-top: 0; }
#checkout-wrapper { padding: 0; }
.checkout-loading { background-color: var(--page); border-radius: var(--radius-card); margin-left: 0; }

/* each step is a card */
.block {
    background: var(--surface);
    border: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    border-radius: var(--radius-card);
    box-shadow: none;
    padding: 22px 24px 24px;
    margin: 0 0 20px;
    overflow: visible;
}
.block h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -.03em;
    margin: 0 0 18px;
}
.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--ink);
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 700;
}

/* ---------- Product cards (versions, modules, support, services, payment) ---------- */
.block ul {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}
.block ul li { float: none; }
.block ul li.product-holder, .block ul li.payment-holder {
    width: auto;
    min-height: 0;
    margin: 0;
    padding: 18px 16px 16px;
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: 14px;
    text-align: left;
    position: relative;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.block ul li.product-holder:hover, .block ul li.payment-holder:hover {
    border-color: var(--muted);
    transform: translateY(-1px);
}
.block ul li.product-holder:has(input:checked), .block ul li.payment-holder:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 0 0 3px var(--accent-ring);
}
.block ul li.product-holder.purchased { background: var(--ok-bg); border-color: var(--line); }
.product-holder h3, .payment-holder { color: var(--ink); font-size: 16px; font-weight: 700; margin: 0 0 8px; padding-right: 26px; }
.product-price-setup, .product-price-recurring { font-size: 13px; color: var(--muted); }
.product-price-recurring { display: block; color: var(--ink); font-size: 15px; font-weight: 600; }
.product-description { display: block; color: var(--muted); font-size: 12px; line-height: 1.45; }
.product-description br:first-child { display: none; }
.product-holder input, .payment-holder input {
    position: absolute;
    top: 16px;
    right: 14px;
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--accent);
    cursor: pointer;
}
.product-holder br { line-height: 0; }

/* ---------- Customer form ---------- */
.two-col-table { border-collapse: separate; border-spacing: 0; }
.two-col-table td.col-spacer { width: 20px; }
form label { color: var(--muted); font-size: 13px; font-weight: 600; }
form input, form textarea, form select {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-button);
    padding: 10px 12px;
    font-size: 14px;
    color: var(--ink);
    transition: border-color .15s, box-shadow .15s;
}
form input:focus, form textarea:focus, form select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-ring);
}
form input.radio, form input.checkbox { background: transparent; border: 0; box-shadow: none; }
input.error, select.error, textarea.error { border-color: var(--error-line); }

/* ---------- Summary ---------- */
#totals { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: none; padding: 22px 24px; }
.totals-wrapper { background: var(--zebra); box-shadow: inset 0 0 0 1px var(--divider); border-radius: 12px; padding: 12px 14px; }
#totals .period { color: var(--muted); font-size: 13px; }
#totals td { border-bottom: 1px solid var(--line); padding: 8px 6px; }
#totals td.subtotal, #totals td.total { border-top: 1px solid var(--line); }
#totals td.total { border-bottom: 0; color: var(--ink); }
#totals .amount-due { color: var(--ink); font-size: 30px; font-weight: 700; letter-spacing: -.03em; padding: 16px 0 4px; }
#totals .fee, #totals .tax { color: var(--muted); }
.discount-code { display: flex; gap: 10px; align-items: center; }
.discount-code input { flex: 1; width: auto; float: none; margin: 0; }
.discount-code button.btn { float: none; height: auto; }
.discount-code button.btn span { min-height: 0; padding: 0; }

/* ---------- Buttons and the final step ---------- */
.btn span, .btn span span { background-image: none !important; float: none; min-height: 0; padding: 0; }
.btn { float: none; height: auto; }
/* the site's .cta: filled in ink */
.btn-red, .btn-green, .btn-dark {
    background: var(--ink);
    border: 1px solid var(--ink);
    border-radius: var(--radius-button);
    box-shadow: none;
    color: #FFFFFF;
    cursor: pointer;
    padding: 13px 26px;
    transition: background-color .15s, transform .15s;
}
.btn-red:hover, .btn-green:hover, .btn-dark:hover { background: var(--ink-2); border-color: var(--ink-2); transform: translateY(-1px); }
.btn span span { color: #FFFFFF; font-size: 15px; font-weight: 600; text-transform: none; letter-spacing: 0; }
.btn:hover span span { color: #ffffff; }
#complete {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 24px;
    height: auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    box-shadow: none;
    padding: 18px 24px;
    margin: 20px 0 0;
}
#complete .recurring { order: 3; flex: 1 1 100%; padding: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
#complete .terms-and-conditions { order: 1; flex: 1 1 auto; float: none; margin: 0; display: flex; align-items: center; gap: 8px; }
#complete .terms-and-conditions input { width: 18px; height: 18px; accent-color: var(--accent); }
#complete button.btn { order: 2; float: none; margin: 0 0 0 auto; }
#processing { color: var(--muted); }

/* ---------- Phone ---------- */
@media (max-width: 760px) {
    .two-col-table, .two-col-table tbody, .two-col-table tr, .two-col-table td { display: block; width: 100% !important; }
    .two-col-table td.col-spacer { display: none; }
    .block { padding: 18px 16px; }
    #complete button.btn { margin: 0; width: 100%; }
}

/* ---------- Details ---------- */
form input, form textarea, form select { box-sizing: border-box; max-width: 100%; }
#totals h2 { display: flex; align-items: center; gap: 12px; color: var(--ink); font-size: 20px; font-weight: 700; margin: 0 0 18px; }
.totals-wrapper { color: var(--ink); }
.totals-wrapper th, .totals-wrapper td { color: var(--ink); }
.totals-wrapper .period { color: var(--muted); }
/* the site's .btn: white with a hairline */
.discount-code button.btn, .discount-code button.btn-red {
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: none;
    padding: 10px 16px;
    transform: none;
}
.discount-code button.btn:hover { background: var(--zebra); border-color: var(--muted); }
.discount-code button.btn span, .discount-code button.btn span span { color: var(--ink); font-size: 13px; font-weight: 600; }

/* headings as the site's: tight, never the legacy layout's wide tracking */
h1, h2, h3 { letter-spacing: -.02em; }
.product-holder h3, .payment-holder { letter-spacing: -.01em; }
