:root {
    --brand: #3f37c9;
    --brand-dark: #2b2593;
    --brand-light: #eef0ff;
    --accent: #f5a524;
    --accent-dark: #d48806;
    --ink: #1f2337;
    --muted: #61667d;
    --surface: #f6f7fb;
    --border: #e3e5ef;
    --success: #1f9d55;
    --danger: #d64545;
    --radius: 12px;
}

html, body {
    font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    background: #fff;
}

a, .btn-link { color: var(--brand); }

.btn-primary {
    background-color: var(--brand);
    border-color: var(--brand);
}
.btn-primary:hover, .btn-primary:focus { background-color: var(--brand-dark); border-color: var(--brand-dark); }

.btn-accent {
    background-color: var(--accent);
    border-color: var(--accent);
    color: var(--ink);
    font-weight: 600;
}
.btn-accent:hover { background-color: var(--accent-dark); border-color: var(--accent-dark); color: var(--ink); }

.btn:focus-visible, .form-control:focus, .form-select:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(63, 55, 201, 0.3);
}

h1:focus { outline: none; }

.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid { outline: 1px solid var(--danger); }
.validation-message { color: var(--danger); }

.darker-border-checkbox.form-check-input { border-color: #929292; }

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}
.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder { text-align: start; }

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}
.blazor-error-boundary::after { content: "An error has occurred."; }

#blazor-error-ui {
    background: #fff4d6;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }

/* Brand mark */
.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: inherit;
    text-decoration: none;
}
.brand-mark .logo {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--accent);
    color: var(--ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

/* Marketing */
.site-header {
    background: var(--ink);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 50;
}
.site-header .nav-link { color: rgba(255, 255, 255, .85); }
.site-header .nav-link:hover { color: #fff; }
.site-header .brand-mark { color: #fff; }
#nav-toggle:checked ~ .navbar-collapse { display: block; }

.hero {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: #fff;
    padding: 5rem 0 4rem;
}
.hero h1 { font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 800; line-height: 1.15; }
.hero p.lead { color: rgba(255, 255, 255, .88); }
.hero-card {
    background: #fff;
    color: var(--ink);
    border-radius: var(--radius);
    box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
    padding: 1.25rem;
}
.phone-bubble {
    background: var(--brand-light);
    border-radius: 14px 14px 14px 4px;
    padding: .75rem 1rem;
    margin-bottom: .75rem;
    font-size: .95rem;
}
.phone-bubble small { color: var(--muted); display: block; }

.stat-strip { background: var(--surface); padding: 2rem 0; }
.stat-strip .number { font-size: 2rem; font-weight: 800; color: var(--brand); }

.section { padding: 4.5rem 0; }
.section-muted { background: var(--surface); }
.section h2 { font-weight: 800; }

.service-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    height: 100%;
    transition: transform .15s ease, box-shadow .15s ease;
    background: #fff;
}
.service-card:hover { transform: translateY(-3px); box-shadow: 0 10px 25px rgba(31, 35, 55, .08); }
.service-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--brand-light);
    color: var(--brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.testimonials {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(280px, 1fr);
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 1rem;
}
.testimonial {
    scroll-snap-align: start;
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 1.5rem;
}
.testimonial blockquote { font-size: 1.05rem; }
.testimonial cite { color: var(--muted); font-style: normal; font-weight: 600; }

.cta-band { background: var(--accent); padding: 3rem 0; }

.site-footer { background: var(--ink); color: rgba(255, 255, 255, .75); padding: 3rem 0 2rem; }
.site-footer a { color: rgba(255, 255, 255, .85); text-decoration: none; }
.site-footer a:hover { color: #fff; }
.site-footer h3 { color: #fff; font-size: 1rem; font-weight: 700; }

/* Portal (staff / admin) */
.portal {
    display: flex;
    min-height: 100vh;
    background: var(--surface);
}
.portal-sidebar {
    width: 250px;
    flex-shrink: 0;
    background: var(--ink);
    color: #fff;
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
}
.portal-sidebar .brand-mark { color: #fff; margin-bottom: 1.5rem; }
.portal-sidebar .nav-link {
    color: rgba(255, 255, 255, .78);
    border-radius: 8px;
    padding: .55rem .75rem;
    display: flex;
    gap: .6rem;
    align-items: center;
}
.portal-sidebar .nav-link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.portal-sidebar .nav-link.active { background: var(--brand); color: #fff; }
.portal-sidebar .nav-section {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255, 255, 255, .45);
    margin: 1rem .75rem .35rem;
}
.portal-main { flex: 1; min-width: 0; }
.portal-topbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: .75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.portal-content { padding: 1.5rem; }

.card { border: 1px solid var(--border); border-radius: var(--radius); }
.card-header { background: #fff; border-bottom: 1px solid var(--border); font-weight: 600; }

.stat-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; height: 100%; }
.stat-card .label { color: var(--muted); font-size: .85rem; }
.stat-card .value { font-size: 1.75rem; font-weight: 800; }

.page-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-header h1 { font-size: 1.5rem; font-weight: 700; margin: 0; }

.table > :not(caption) > * > * { padding: .6rem .75rem; }
.table thead th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }

.badge-soft { background: var(--brand-light); color: var(--brand); }

@media (max-width: 900px) {
    .portal { flex-direction: column; }
    .portal-sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; gap: .25rem; padding: .75rem; }
    .portal-sidebar .brand-mark { margin: 0 1rem 0 0; }
    .portal-sidebar .nav-section { display: none; }
}

/* Parent app */
.parent-app { background: var(--surface); min-height: 100vh; padding-bottom: 80px; }
.parent-header {
    background: var(--brand);
    color: #fff;
    padding: 1rem 1.25rem;
    position: sticky;
    top: 0;
    z-index: 20;
}
.parent-header .brand-mark { color: #fff; font-size: 1.1rem; }
.parent-content { max-width: 720px; margin: 0 auto; padding: 1.25rem 1rem; }
.parent-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: .4rem 0 calc(.4rem + env(safe-area-inset-bottom));
    z-index: 30;
}
.parent-nav a {
    color: var(--muted);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: .72rem;
    padding: .25rem .5rem;
}
.parent-nav a .icon { font-size: 1.3rem; line-height: 1.2; }
.parent-nav a.active { color: var(--brand); font-weight: 600; }

.tile {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    margin-bottom: .75rem;
    display: block;
    color: inherit;
    text-decoration: none;
}
a.tile:hover { border-color: var(--brand); }
.tile.unread { border-left: 4px solid var(--brand); }
.tile .meta { color: var(--muted); font-size: .82rem; }

.slot-grid { display: flex; flex-wrap: wrap; gap: .4rem; }
.slot-grid .btn { min-width: 76px; }

.install-banner {
    background: var(--accent);
    border-radius: var(--radius);
    padding: .9rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.timetable td, .timetable th { white-space: nowrap; }
.slot-booked { background: #e7f6ee; }
