/* Customer-facing kiosk: large touch targets, high contrast, calm palette. */

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: #f5f7fa;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #222;
    -webkit-text-size-adjust: 100%;
}

.kiosk-shell {
    max-width: 760px;
    margin: 0 auto;
    padding: 24px 20px 80px;
}

.kiosk-brand {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: #444;
    letter-spacing: 0.5px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e1e6ec;
}

.kiosk-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 28px 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 20px;
}

.kiosk-card h1 {
    margin: 0 0 16px;
    font-size: 26px;
    font-weight: 600;
    color: #1a3b6e;
}

.kiosk-card p {
    font-size: 18px;
    line-height: 1.5;
    margin: 0 0 16px;
}

.kiosk-card .muted {
    color: #666;
    font-size: 15px;
}

label {
    display: block;
    font-size: 16px;
    color: #555;
    margin-bottom: 8px;
}

/* Match every text-like input the kiosk uses, not just type=text. The
 * e-Invoice form deliberately uses type="tel" / type="email" on phone
 * and email so iOS / Android pop the right soft keyboard; without this
 * broader selector those inputs would fall through to the browser's
 * tiny default styling and look completely different from the State /
 * Postcode boxes right above them. Same goes for the standalone
 * send_email and send_whatsapp screens.
 */
select,
input[type=text],
input[type=email],
input[type=tel],
input[type=number],
input[type=search],
input[type=url],
input[type=password] {
    width: 100%;
    font-size: 22px;
    padding: 14px 16px;
    border: 2px solid #c7d0db;
    border-radius: 8px;
    background: #fff;
    outline: none;
}

select:focus,
input[type=text]:focus,
input[type=email]:focus,
input[type=tel]:focus,
input[type=number]:focus,
input[type=search]:focus,
input[type=url]:focus,
input[type=password]:focus {
    border-color: #2867c0;
    box-shadow: 0 0 0 3px rgba(40,103,192,0.15);
}

button, .kiosk-btn {
    display: inline-block;
    font-size: 20px;
    font-weight: 600;
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    background: #2867c0;
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}

button:hover, .kiosk-btn:hover { background: #1f4f96; }
button:disabled { background: #99a4b3; cursor: not-allowed; }

.kiosk-btn-block {
    display: block;
    width: 100%;
    padding: 22px;
    font-size: 22px;
    margin-bottom: 14px;
}

.kiosk-btn-secondary {
    background: #6b7785;
}
.kiosk-btn-secondary:hover { background: #525c68; }

.kiosk-btn-member {
    background: linear-gradient(135deg, #c89b2d 0%, #f0cf73 52%, #b07a12 100%);
    color: #2d1f00;
    border: 2px solid #9b6a08;
    box-shadow: 0 10px 22px rgba(176,122,18,0.22);
}
.kiosk-btn-member:hover {
    background: linear-gradient(135deg, #b78618 0%, #e6c35f 52%, #9a6708 100%);
    color: #241800;
}
.kiosk-btn-member .kiosk-btn-eyebrow,
.kiosk-btn-member .kiosk-btn-title,
.kiosk-btn-member .kiosk-btn-sub {
    display: block;
}
.kiosk-btn-member .kiosk-btn-eyebrow {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 6px;
    opacity: 0.9;
}
.kiosk-btn-member .kiosk-btn-title {
    font-size: 24px;
    line-height: 1.15;
}
.kiosk-btn-member .kiosk-btn-sub {
    font-size: 14px;
    line-height: 1.35;
    margin-top: 8px;
    color: rgba(45, 31, 0, 0.82);
    font-weight: 600;
}

.kiosk-btn-danger {
    background: #b03a3a;
}
.kiosk-btn-danger:hover { background: #8c2d2d; }

.kiosk-status {
    text-align: center;
    font-size: 18px;
    color: #666;
    padding: 30px 10px;
}

.kiosk-status .spinner {
    display: inline-block;
    width: 28px;
    height: 28px;
    border: 4px solid #c7d0db;
    border-top-color: #2867c0;
    border-radius: 50%;
    animation: kiosk-spin 1s linear infinite;
    vertical-align: middle;
    margin-right: 10px;
}

@keyframes kiosk-spin { to { transform: rotate(360deg); } }

.member-row {
    border-top: 1px solid #e1e6ec;
    padding: 18px 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}
.member-row:first-child { border-top: none; }

.member-info { flex: 1; min-width: 0; }
.member-name { font-size: 20px; font-weight: 600; color: #222; }
.member-company {
    font-size: 15px;
    font-style: italic;
    color: #2867c0;
    margin-top: 2px;
    padding-bottom: 6px;
    border-bottom: 1px dashed #d0d8e2;
    margin-bottom: 4px;
}
.member-sub  { font-size: 15px; color: #666; margin-top: 4px; }

.kiosk-results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    align-items: start;
}

.kiosk-results-panel {
    min-width: 0;
}

.kiosk-success {
    background: #e7f6ec;
    border: 2px solid #4caf50;
    color: #1d6f31;
}

.kiosk-error {
    background: #fdecea;
    border: 2px solid #c0392b;
    color: #8b1f15;
}

.kiosk-notice {
    background: #fff7e6;
    border: 2px solid #d4a017;
    color: #6b4c00;
}

.kiosk-back {
    display: inline-block;
    margin-top: 12px;
    color: #2867c0;
    text-decoration: none;
    font-size: 16px;
}
.kiosk-back:hover { text-decoration: underline; }

/* ----------------------------------------------------------------------
 * View-cart receipt: read-only "what am I buying?" table the customer can
 * inspect before paying. Mirrors the printable receipt's columns
 * (qty / name / warranty / price / subtotal) but trimmed for kiosk use.
 * --------------------------------------------------------------------*/
.kiosk-receipt-section {
    margin-bottom: 22px;
}

.kiosk-receipt-heading {
    font-size: 15px;
    font-weight: 700;
    color: #1a3b6e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 6px;
    margin-bottom: 8px;
    border-bottom: 2px solid #e1e6ec;
}

.kiosk-receipt {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.kiosk-receipt thead th {
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
    font-weight: 600;
    padding: 6px 8px;
    border-bottom: 1px solid #e1e6ec;
}

.kiosk-receipt tbody td {
    padding: 10px 8px;
    border-bottom: 1px dashed #e1e6ec;
    vertical-align: top;
}

.kiosk-receipt .col-qty      { width: 12%; text-align: center; font-weight: 600; }
.kiosk-receipt .col-warranty { width: 18%; text-align: center; color: #555; }
.kiosk-receipt .col-price    { width: 18%; text-align: right; }
.kiosk-receipt .col-sub      { width: 20%; text-align: right; font-weight: 600; }
.kiosk-receipt .col-name     { word-break: break-word; }

.kiosk-receipt .line-name {
    font-weight: 600;
    color: #222;
}

.kiosk-receipt .line-sub {
    font-size: 12px;
    color: #666;
    margin-top: 3px;
}

.kiosk-receipt .line-foc {
    color: #1d6f31;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.5px;
}

.kiosk-totals {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 2px solid #1a3b6e;
}

.kiosk-total-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 6px 0;
    font-size: 16px;
    color: #333;
}

.kiosk-total-row.kiosk-grand {
    margin-top: 6px;
    padding-top: 12px;
    border-top: 1px dashed #c7d0db;
    font-size: 22px;
    font-weight: 700;
    color: #1a3b6e;
}

/* ----------------------------------------------------------------------
 * Mobile / phone-portrait
 * Most kiosk users will scan a QR code on their own phone, so the layout
 * needs to feel native at ~375-428px wide.
 * --------------------------------------------------------------------*/
@media (max-width: 600px) {
    .kiosk-shell {
        padding: 14px 12px 60px;
    }

    .kiosk-brand {
        font-size: 18px;
        margin-bottom: 16px;
        padding-bottom: 12px;
    }

    .kiosk-card {
        padding: 20px 16px;
        border-radius: 10px;
        margin-bottom: 14px;
    }

    .kiosk-card h1 { font-size: 22px; margin-bottom: 12px; }
    .kiosk-card p  { font-size: 16px; }

    label { font-size: 15px; }

    select,
    input[type=text],
    input[type=email],
    input[type=tel],
    input[type=number],
    input[type=search],
    input[type=url],
    input[type=password] {
        font-size: 18px;        /* >=16px to suppress iOS zoom-on-focus */
        padding: 12px 14px;
    }

    button, .kiosk-btn {
        font-size: 18px;
        padding: 14px 20px;
    }

    .kiosk-btn-block {
        padding: 18px;
        font-size: 18px;
    }

    .kiosk-btn-member .kiosk-btn-title {
        font-size: 21px;
    }

    .kiosk-btn-member .kiosk-btn-sub {
        font-size: 13px;
    }

    .kiosk-results-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    /* Stack member rows: info on top, full-width button on the bottom.
     * Much easier to thumb-tap on a one-handed phone hold than a
     * narrow button squeezed to the right. */
    .member-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 14px 2px;
    }

    .member-name { font-size: 18px; }
    .member-company { font-size: 14px; }
    .member-sub { font-size: 14px; }

    .member-row .kiosk-btn {
        width: 100%;
        padding: 14px;
        font-size: 17px;
    }

    /* Receipt: collapse the multi-column table into stacked cards.
     * At ~375px wide a 5-column table becomes unreadable; instead we
     * render each line as a label-and-value card using the data-label
     * attributes emitted in PHP (Qty / Item / Warranty / Price / Subtotal). */
    .kiosk-receipt thead {
        display: none;
    }
    .kiosk-receipt, .kiosk-receipt tbody, .kiosk-receipt tr {
        display: block;
        width: 100%;
    }
    .kiosk-receipt tbody tr {
        border: 1px solid #e1e6ec;
        border-radius: 8px;
        padding: 10px 12px;
        margin-bottom: 10px;
        background: #fafbfc;
    }
    .kiosk-receipt tbody td {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 12px;
        padding: 4px 0;
        border: none;
        text-align: left;
        width: auto !important;
    }
    .kiosk-receipt tbody td::before {
        content: attr(data-label);
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: #666;
        font-weight: 600;
        flex-shrink: 0;
    }
    .kiosk-receipt tbody td.col-name {
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        padding-bottom: 8px;
        margin-bottom: 6px;
        border-bottom: 1px dashed #d0d8e2;
    }
    .kiosk-receipt tbody td.col-name::before {
        margin-bottom: 4px;
    }
    .kiosk-receipt .col-price,
    .kiosk-receipt .col-sub,
    .kiosk-receipt .col-warranty,
    .kiosk-receipt .col-qty {
        text-align: right;
    }

    .kiosk-total-row { font-size: 15px; }
    .kiosk-total-row.kiosk-grand { font-size: 20px; }
}

/* iOS safe-area: avoid bottom-bar overlap on notched phones */
@supports (padding: max(0px)) {
    .kiosk-shell {
        padding-bottom: max(60px, env(safe-area-inset-bottom));
    }
}
