:root {
    /* Lasyard House brand: charcoal ink + warm amber accent + slate blue-grey */
    --brand: #cf760e;          /* deep, warm amber (the "house" in the logo) */
    --brand-dark: #a95c07;
    --brand-soft: #fbead2;     /* pale amber wash */
    --ink: #2b2f36;            /* charcoal — headings, top bar, logo text */
    --slate: #5c6b7a;          /* slate blue-grey — subheadings */
    --bg: #f4f6f9;             /* page background */
    --card: #ffffff;
    --text: #333b44;           /* body text */
    --muted: #7a8794;
    --border: #e4e9ef;
    --ok: #2e7d32;
    --error: #c0392b;
    --radius: 14px;
    --shadow-sm: 0 1px 2px rgba(20,30,45,.06);
    --shadow: 0 1px 3px rgba(20,30,45,.06), 0 8px 24px rgba(20,30,45,.06);
    --shadow-lg: 0 12px 34px rgba(20,30,45,.14);
    --ring: 0 0 0 3px rgba(207,118,14,.22);
    --font: 'Inter', -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-head: 'Poppins', var(--font);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3 { font-family: var(--font-head); color: var(--ink); letter-spacing: -.01em; }
a { color: var(--brand-dark); }

.page { min-height: 100vh; }
.muted { color: var(--muted); }

/* ---------- Kiosk ---------- */
body.kiosk {
    background: radial-gradient(1200px 620px at 50% -8%, #ffffff 0%, #eef2f6 55%, #e4eaf0 100%);
}
body.kiosk .page {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3vh 4vw;
}

.kiosk-header {
    text-align: center;
    margin-bottom: 2vh;
}
.kiosk-header.branded .site-logo {
    max-width: min(420px, 70vw);
    height: auto;
    margin-bottom: 1.25rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.08));
}
.kiosk-header h1 {
    font-size: clamp(1.8rem, 3.2vw, 2.8rem);
    margin: 0 0 .35rem;
    color: var(--ink);
    font-weight: 700;
}
.kiosk-header .lead { font-size: clamp(1.1rem, 2vw, 1.7rem); color: var(--slate); margin: 0; }

.company-filter {
    margin-top: 1vh;
    margin-bottom: 4vh;
    width: min(520px, 82vw);
    padding: 1rem 1.4rem;
    font-size: 1.4rem;
    border: 2px solid var(--border);
    border-radius: 999px;
    background: #fff;
    box-shadow: var(--shadow-sm);
    outline: none;
}
.company-filter:focus { border-color: var(--brand); box-shadow: var(--ring); }

.company-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    width: 100%;
    max-width: 1400px;
}

.company-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 1.5rem 1rem;
    text-decoration: none;
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    min-height: 200px;
    justify-content: center;
    transition: transform .12s ease, box-shadow .12s ease;
    box-shadow: var(--shadow-sm);
}
.company-card:active { transform: scale(.97); }
.company-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

.company-logo { width: 100%; max-height: 120px; object-fit: contain; }
.company-logo.placeholder {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 120px; background: var(--bg);
    border-radius: 8px; font-weight: 600; text-align: center; padding: .5rem;
}
.company-name { font-size: 1.3rem; font-weight: 600; text-align: center; color: var(--ink); }

/* ---------- Company carousel (Swiper coverflow, vertical for portrait kiosk) ---------- */
.company-swiper {
    width: 100%; max-width: 560px;
    height: 70vh; min-height: 420px;
    margin: 0 auto; padding: 0; overflow: hidden;
}
.company-swiper .swiper-slide {
    width: 400px; height: 330px;
    display: flex; align-items: stretch;
    opacity: .45;
    filter: saturate(.75);
    transition: opacity .45s ease, filter .45s ease;
}
.company-swiper .swiper-slide-active { opacity: 1; filter: none; }
.company-swiper .swiper-slide-prev,
.company-swiper .swiper-slide-next { opacity: .8; }

.company-swiper .company-card {
    width: 100%;
    border: none;
    border-radius: 22px;
    box-shadow: var(--shadow-lg);
    gap: 1.25rem;
}
.company-swiper .swiper-slide-active .company-card {
    box-shadow: 0 18px 48px rgba(207,118,14,.24);
    outline: 3px solid var(--brand);
}
.company-swiper .company-logo { max-height: 180px; }
.company-swiper .company-name { font-size: 1.5rem; }

/* Pagination + navigation arrows */
.company-swiper .swiper-pagination-bullet { background: #c3cdd8; opacity: .7; }
.company-swiper .swiper-pagination-bullet-active { background: var(--brand); opacity: 1; }
.company-swiper .swiper-button-prev,
.company-swiper .swiper-button-next {
    color: var(--brand);
    background: #fff;
    width: 64px; height: 64px;
    border-radius: 50%;
    box-shadow: 0 4px 14px rgba(0,0,0,.15);
    left: 50%; right: auto;
}
.company-swiper .swiper-button-prev { top: 8px; bottom: auto; transform: translateX(-50%) rotate(90deg); }
.company-swiper .swiper-button-next { top: auto; bottom: 8px; transform: translateX(-50%) rotate(90deg); }
.company-swiper .swiper-button-prev:after,
.company-swiper .swiper-button-next:after { font-size: 24px; font-weight: 700; }

/* ---------- On-screen keyboard ---------- */
.osk {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 9000;
    background: var(--ink); padding: 12px clamp(8px, 2vw, 40px) 18px;
    display: flex; flex-direction: column; gap: 10px;
    box-shadow: 0 -6px 24px rgba(0,0,0,.35);
}
.osk.hidden { display: none; }
.osk-row { display: flex; gap: 10px; justify-content: center; }
.osk-key {
    flex: 1 1 0; max-width: 120px; min-height: 74px;
    font-size: clamp(1.3rem, 2.4vw, 2rem); font-weight: 700;
    border: none; border-radius: 12px;
    background: #ffffff; color: var(--ink); cursor: pointer;
    box-shadow: 0 3px 0 rgba(0,0,0,.28); user-select: none;
}
.osk-key:active { transform: translateY(3px); box-shadow: none; background: #dfe6ee; }
.osk-key.osk-special { background: #55677a; color: #fff; }
.osk-key.osk-wide { max-width: 190px; }
.osk-key.osk-special.active { background: var(--brand); }
.osk-key.osk-space { flex: 6 1 0; max-width: none; }
.osk-key.osk-done { flex: 2 1 0; max-width: none; background: var(--brand); color: #fff; }

body.osk-open .page { padding-bottom: 46vh; }

/* ---------- Screensaver ---------- */
.screensaver {
    position: fixed; inset: 0; z-index: 9999;
    background: #000; display: flex; align-items: center; justify-content: center;
    opacity: 1; transition: opacity .4s ease;
}
.screensaver.hidden { opacity: 0; pointer-events: none; }
.ss-stage { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.ss-media { max-width: 100%; max-height: 100%; object-fit: contain; animation: ssFade .8s ease; }
@keyframes ssFade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Forms (kiosk) ---------- */
.checkin-form {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    width: min(640px, 92vw);
    display: flex;
    flex-direction: column;
    gap: .75rem;
    box-shadow: var(--shadow);
}
.checkin-form label { font-size: 1.3rem; font-weight: 600; margin-top: 1rem; color: var(--ink); }
.text-input {
    padding: .7rem .9rem;
    font-size: 1rem;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: var(--text);
    font-family: inherit;
    transition: border-color .12s ease, box-shadow .12s ease;
}
.text-input:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.checkin-form .text-input { padding: 1rem 1.25rem; font-size: 1.4rem; border-width: 2px; border-radius: 12px; }
.form-actions { display: flex; gap: 1rem; margin-top: 2rem; justify-content: space-between; }
.form-actions.center { justify-content: center; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .62rem 1.15rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    line-height: 1.2;
    transition: transform .1s ease, box-shadow .12s ease, background .12s ease, border-color .12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 2px 8px rgba(207,118,14,.28); }
.btn-primary:hover { background: var(--brand-dark); box-shadow: 0 4px 14px rgba(207,118,14,.34); }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--border); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { border-color: #cdd6df; background: #fbfcfd; }
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover { background: #a93226; }
.btn-sm { padding: .34rem .7rem; font-size: .85rem; border-radius: 8px; }

/* kiosk buttons are large */
body.kiosk .btn { padding: 1rem 2rem; font-size: 1.3rem; border-radius: 12px; }

.field-error, .validation-summary { color: var(--error); font-size: .95rem; }
body.kiosk .field-error, body.kiosk .validation-summary { font-size: 1.1rem; }

/* ---------- Directions ---------- */
.directions-box {
    width: min(900px, 94vw);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}
.directions-frame { width: 100%; height: 40vh; border: 0; }
.directions-text {
    font-size: clamp(1.5rem, 4.5vw, 2.4rem);
    line-height: 1.5;
    font-weight: 500;
    white-space: pre-wrap;
    word-break: break-word;
    text-align: center;
    color: var(--text);
    padding: 1.6rem 1.8rem;
}

.empty-state { text-align: center; margin-top: 6vh; }

/* ---------- Admin / management app ---------- */
body.admin .page { padding: 1.6rem; }
.admin-container { max-width: 1060px; margin: 0 auto; }
.admin-header {
    display: flex; justify-content: space-between; align-items: center;
    gap: 1rem; flex-wrap: wrap;
    margin-bottom: 1.1rem; padding-bottom: .9rem;
    border-bottom: 2px solid var(--border);
}
.admin-header h1 { margin: 0; font-size: 1.6rem; position: relative; }
.admin-header h1::after {
    content: ""; position: absolute; left: 0; bottom: -.92rem; height: 2px; width: 46px;
    background: var(--brand); border-radius: 2px;
}
.admin-nav { display: flex; gap: .5rem; flex-wrap: wrap; }

.admin-table {
    width: 100%; border-collapse: separate; border-spacing: 0; margin-top: 1rem;
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow-sm);
}
.admin-table th {
    text-align: left; padding: .7rem 1rem; background: #f7f9fb; color: var(--slate);
    font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; font-weight: 600;
    border-bottom: 1px solid var(--border);
}
.admin-table td { text-align: left; padding: .75rem 1rem; border-bottom: 1px solid var(--border); }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover td { background: #fbfcfe; }
.admin-table code { background: var(--brand-soft); color: var(--brand-dark); padding: .1rem .4rem; border-radius: 5px; font-weight: 600; }

.admin-form {
    display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; max-width: 720px;
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.4rem 1.5rem; box-shadow: var(--shadow-sm);
}
.form-row { display: flex; flex-direction: column; gap: .35rem; }
.form-row > label { font-weight: 600; color: var(--ink); font-size: .92rem; }
.checkbox-label { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
textarea.text-input { font-family: inherit; line-height: 1.5; }
.code-input { font-family: Consolas, monospace; font-size: .95rem; padding: .75rem; border: 1px solid var(--border); border-radius: 8px; }
select.text-input { background: #fff; }

.alert { padding: .8rem 1.1rem; border-radius: 10px; margin: 1rem 0; border: 1px solid transparent; font-weight: 500; }
.alert-success { background: var(--brand-soft); color: #8a5a06; border-color: #f2ddb5; }

.inline-form { display: flex; gap: .5rem; align-items: center; margin: 1rem 0; }

/* ---------- Car picker (check-in) ---------- */
.car-picker { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: .25rem; }
.car-chip {
    display: flex; flex-direction: column; align-items: center; gap: .25rem;
    padding: .4rem; border: 2px solid var(--border); border-radius: 10px;
    background: var(--card); cursor: pointer;
}
.car-chip img { width: 120px; height: 80px; object-fit: cover; border-radius: 6px; }
.car-chip span { font-weight: 600; font-size: 1rem; }
.car-chip.selected { border-color: var(--brand); box-shadow: var(--ring); }

/* ---------- Quick check-in ---------- */
.quick-checkin {
    display: flex; align-items: center; gap: 1.5rem;
    width: min(1000px, 92vw); margin: 0 auto 2rem;
    padding: 1.5rem 2rem; border-radius: var(--radius); text-decoration: none;
    background: linear-gradient(135deg, var(--brand) 0%, #e08a24 100%); color: #fff;
    box-shadow: 0 8px 22px rgba(207,118,14,.28);
}
.quick-checkin:active { transform: scale(.99); }
.quick-checkin img { max-height: 90px; max-width: 200px; object-fit: contain; background:#fff; border-radius: 10px; padding: .5rem; }
.quick-checkin span { font-size: clamp(1.3rem, 2.5vw, 2rem); font-weight: 700; }

/* ---------- Terms & conditions ---------- */
.terms-box {
    width: min(900px, 94vw); margin: 0 auto 2rem;
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 2rem; max-height: 50vh; overflow-y: auto; font-size: 1.15rem; line-height: 1.5;
    box-shadow: var(--shadow);
}

/* ---------- Admin extras ---------- */
.row-actions { display: flex; gap: .5rem; align-items: center; }
.row-actions form { margin: 0; }
.logo-preview { max-height: 80px; max-width: 200px; object-fit: contain; border: 1px solid var(--border); border-radius: 8px; padding: .25rem; background: #fff; }

/* Reusable content cards / tiles used across the app */
.tile {
    display: block; text-decoration: none; background: var(--card);
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.2rem 1.3rem; color: var(--text); box-shadow: var(--shadow-sm);
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
    border-top: 3px solid transparent;
}
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-top-color: var(--brand); }
.tile .ic { font-size: 1.7rem; }
.tile h2 { margin: .4rem 0 .25rem; font-size: 1.12rem; }
.tile p { margin: 0; color: var(--muted); font-size: .88rem; }

.panel {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.1rem 1.3rem; box-shadow: var(--shadow-sm);
}
