* { box-sizing: border-box; }

:root {
    --primary: #d98e33;
    --on-primary: #1f1a14;   /* text on a primary fill (set per tenant by branding) */
    --primary-text: #9d631d; /* primary shade safe as text on light pages */
    --accent: #4a7a82;
    --secondary: #333333;
    --bg: #fdf8f0;
    --text: #2b2b2b;
    --font-heading: Georgia, 'Times New Roman', serif;
    --font-body: system-ui, -apple-system, sans-serif;
}

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
}

h1, h2, h3 { font-family: var(--font-heading); }
h1 { color: var(--primary-text); }
h2 { color: var(--secondary); }

a { color: var(--secondary); }

.btn, button.btn {
    display: inline-block;
    background: var(--primary);
    color: var(--on-primary, #fff);
    padding: 0.8rem 1.6rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-family: var(--font-body);
    text-decoration: none;
    cursor: pointer;
    transition: filter 0.15s ease;
}
.btn:hover, button.btn:hover { filter: brightness(0.88); }

.btn-secondary { background: var(--secondary); color: #fff; }

.card {
    background: #fff;
    border-radius: 8px;
    padding: 1.6rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

label { display: block; margin-top: 1rem; font-size: 0.9rem; color: var(--text); }
input, select, textarea {
    width: 100%;
    padding: 0.6rem;
    margin-top: 0.25rem;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 1rem;
}
textarea { resize: vertical; }

table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; }
th, td { text-align: left; padding: 0.7rem 1rem; border-bottom: 1px solid #eee; }
th { background: var(--bg); font-size: 0.85rem; text-transform: uppercase; color: #595959; }

nav.app-nav {
    background: #fff;
    border-bottom: 1px solid #eee;
    padding: 0.8rem 1.5rem;
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;
    align-items: center;
}
nav.app-nav a {
    color: var(--secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
}
nav.app-nav a:hover { background: var(--bg); }
nav.app-nav a.active { background: var(--secondary); color: #fff; }
nav.app-nav form { margin: 0; margin-left: auto; }
nav.app-nav button {
    background: none; border: none; color: var(--secondary);
    font-size: 0.95rem; font-weight: 500; cursor: pointer; padding: 0.4rem 0.6rem;
}

.status { color: var(--secondary); background: var(--bg); padding: 0.8rem 1rem; border-radius: 4px; margin-bottom: 1rem; }
.error { color: #b91c1c; font-size: 0.9rem; margin-top: 0.5rem; }

.brand-header { text-align: center; padding: 1.5rem; }
.brand-header img { max-height: 90px; }
.brand-header .tagline { color: var(--secondary); font-style: italic; margin-top: 0.3rem; }

.auth-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, #fbfbfb 0%, #f0f0f0 100%);
}

.auth-page .wrap { width: 380px; max-width: 100%; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.auth-page .card { background: #fff; border-radius: 8px; padding: 2.5rem; box-shadow: 0 1px 4px rgba(0,0,0,0.08); text-align: center; }
.auth-page .card img { max-height: 140px; max-width: 100%; width: auto; height: auto; object-fit: contain; margin-bottom: 0.5rem; }
.auth-page .card h1, .auth-page .card h2 { margin-top: 0.5rem; color: var(--primary-text); font-family: var(--font-heading); font-size: 1.5em; }
.auth-page .card form { text-align: left; }

.auth-page .card input, .auth-page .card select {
    background: #e7eefb;
    border-color: #a9c1e8;
    border-radius: 10px;
    padding: 0.9rem 1rem;
}
.auth-page .btn {
    border-radius: 10px;
    font-weight: bold;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    font-size: 0.9rem;
}
.auth-page .card input, .auth-page .card select { margin-top: 0.8rem; }


.auth-page .btn { width: 100%; margin-top: 1.5rem; }

.auth-links { margin-top: 1rem; font-size: 0.9rem; text-align: center; }
.auth-links a { color: var(--secondary); text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }

.site-footer { text-align: center; padding: 1.5rem; font-size: 0.8rem; color: #6b6b6b; }
.site-footer a { color: #6b6b6b; }

.content-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #fbfbfb 0%, #f0f0f0 100%);
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.content-page .wrap { max-width: 700px; width: 100%; flex: 1; }
.content-page .card { background: #fff; border-radius: 8px; padding: 2.5rem; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.content-page .card > img { max-height: 140px; max-width: 100%; width: auto; height: auto; object-fit: contain; display: block; margin: 0 auto 1rem; }
.content-page h1 { text-align: center; }

/* Accessibility (WCAG 2.2 AA) ---------------------------------------------- */
.sr-only {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
    position: absolute; left: 0.5rem; top: -4rem; z-index: 1000;
    padding: 0.7rem 1.1rem; background: #fff; color: #1f1a14; font-weight: 700;
    border: 2px solid #1f1a14; border-radius: 6px; text-decoration: none;
}
.skip-link:focus { top: 0.5rem; }

/* Visible keyboard focus everywhere (a fixed dark ring plus a white halo, so it shows on light and dark fills) */
:focus-visible { outline: 3px solid #1d3f45; outline-offset: 2px; box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.9); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 0; }
main:focus { outline: none; box-shadow: none; }

::placeholder { color: #595959; opacity: 1; }

.form-hint { font-size: 0.85rem; color: #595959; margin-top: 0.3rem; text-align: left; }
.auth-page label { margin-top: 0.8rem; font-size: 0.9rem; font-weight: 600; text-align: left; }
.auth-page .card input, .auth-page .card select { margin-top: 0.25rem; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important; animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important; scroll-behavior: auto !important;
    }
    a.service-tile:hover, a.service-tile:focus-visible, .product:hover, .post-card:hover { transform: none !important; }
}
