:root {
    --bg: #f4f6f8;
    --surface: #ffffff;
    --border: #dde3e9;
    --text: #1c2733;
    --muted: #64748b;
    /* Greens sampled from the Property Wallet logo */
    --accent: #00a86f;
    --accent-dark: #008c59;
    --accent-soft: #dff5eb;
    --danger: #b3261e;
    font-size: 15px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
}

.page { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }

/* Brand bar */
.brandbar {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 0.6rem 1.2rem;
}
.brand { display: flex; align-items: center; gap: 0.8rem; text-decoration: none; color: inherit; }
.brand-crest { height: 38px; width: auto; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 800; font-size: 1rem; letter-spacing: -0.01em; }
.brand-sub { color: var(--muted); font-size: 0.72rem; font-weight: 600; }
.brand-divider { width: 1px; height: 28px; background: var(--border); }
.partner-logo { width: auto; display: block; opacity: 0.85; }
.partner-scigrow { height: 15px; }
.partner-ontec { height: 19px; }
.brand-user { color: var(--muted); font-size: 0.82rem; margin-right: 0.6rem; }
.logout-form { display: flex; align-items: center; margin: 0; }
.btn-ghost {
    background: none; border: 1px solid var(--border); color: var(--text);
    border-radius: 8px; padding: 0.3rem 0.8rem; cursor: pointer; font-size: 0.82rem;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-dark); }

.site-footer {
    text-align: center; color: var(--muted); font-size: 0.78rem;
    padding: 1.2rem 1rem 2rem;
}
.footer-logos { display: flex; align-items: center; justify-content: center; gap: 1.1rem; margin-bottom: 0.5rem; }
.footer-logos img { width: auto; opacity: 0.75; }
.footer-logos img[alt="Scigrow"] { height: 14px; }
.footer-logos img[alt="Ontec"] { height: 18px; }

/* Login */
.login-wrap { min-height: 70vh; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.login-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
    padding: 2rem 2.2rem; width: 100%; max-width: 380px;
    box-shadow: 0 8px 30px rgba(15, 40, 30, 0.06);
}
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; margin: 0.4rem 0 1rem; text-align: center; }
.login-crest { height: 96px; width: auto; margin-bottom: 0.6rem; }
.login-title { font-weight: 800; font-size: 1.3rem; letter-spacing: -0.01em; }
.login-subtitle { color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.login-partners {
    display: flex; flex-direction: column; align-items: center; gap: 0.8rem;
    margin-top: 1.4rem; padding-top: 1.1rem; border-top: 1px solid var(--border);
    color: var(--muted); font-size: 0.78rem;
}
.login-partner-logos { display: flex; align-items: center; justify-content: center; gap: 1.6rem; }
.login-partner-logos img { width: auto; }
.login-partner-logos img[alt="Scigrow"] { height: 26px; }
.login-partner-logos img[alt="Ontec"] { height: 34px; }
.login-blurb { color: var(--muted); font-size: 0.85rem; margin: 0 0 1.2rem; }
.login-error {
    background: #fdecea; color: var(--danger); border-radius: 8px;
    padding: 0.5rem 0.75rem; font-size: 0.85rem;
}
.login-card form { display: flex; flex-direction: column; gap: 0.9rem; }
.login-card label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.8rem; font-weight: 700; color: var(--muted); }
.login-card input {
    border: 1px solid var(--border); border-radius: 8px; padding: 0.55rem 0.7rem;
    font-size: 0.95rem; font-family: inherit; color: var(--text); background: var(--bg);
}
.login-card input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.btn-primary {
    background: var(--accent); color: #fff; border: none; border-radius: 8px;
    padding: 0.6rem 1rem; font-size: 0.95rem; font-weight: 700; cursor: pointer; margin-top: 0.3rem;
}
.btn-primary:hover { background: var(--accent-dark); }

.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.topbar h1 { margin: 0.2rem 0; font-size: 1.5rem; }
.back { color: var(--accent-dark); text-decoration: none; font-size: 0.9rem; }
.back:hover { text-decoration: underline; }

.muted { color: var(--muted); font-size: 0.85rem; }
.empty { text-align: center; padding: 3rem 0; }

/* Upload */
.upload-box { margin-bottom: 1.5rem; }
.upload-label {
    display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
    padding: 1.6rem 1rem; background: var(--surface);
    border: 2px dashed var(--border); border-radius: 12px; cursor: pointer;
    transition: border-color 0.15s;
}
.upload-label:hover { border-color: var(--accent); }
.upload-label input[type=file] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.upload-cta { font-weight: 600; color: var(--accent-dark); }
.messages { list-style: none; margin: 0.75rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.messages li { padding: 0.45rem 0.75rem; border-radius: 8px; font-size: 0.85rem; }
.msg-ok { background: var(--accent-soft); color: var(--accent-dark); }
.msg-err { background: #fdecea; color: var(--danger); }

/* Card grid (home) */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.card-link { text-decoration: none; color: inherit; flex: 1; }
.thumb { width: 100%; height: 160px; object-fit: cover; display: block; background: #e2e8f0; }
.card-body { padding: 0.75rem 0.9rem 0.5rem; }
.card-title { font-weight: 700; font-size: 0.95rem; word-break: break-all; }
.card-sub { color: var(--muted); font-size: 0.82rem; margin-top: 0.15rem; }
.card-actions { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0.9rem 0.75rem; }
.btn-danger {
    background: none; border: 1px solid var(--border); color: var(--danger);
    border-radius: 8px; padding: 0.25rem 0.7rem; cursor: pointer; font-size: 0.8rem;
}
.btn-danger:hover { background: #fdecea; border-color: var(--danger); }

/* Badges */
.badges { display: flex; gap: 0.4rem; margin-top: 0.5rem; flex-wrap: wrap; }
.badge { background: var(--accent-soft); color: var(--accent-dark); padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.badge-alt { background: #e8edf3; color: var(--muted); }
.badge-link { text-decoration: none; background: #e8edf3; color: var(--text); }
.badge-link:hover { background: var(--border); }

/* Tabs */
.tabs { display: flex; gap: 0.4rem; margin: 1rem 0; border-bottom: 1px solid var(--border); }
.tab {
    background: none; border: none; border-bottom: 2px solid transparent;
    padding: 0.5rem 0.9rem; font-size: 0.9rem; cursor: pointer; color: var(--muted);
}
.tab.active { color: var(--accent-dark); border-bottom-color: var(--accent); font-weight: 600; }

/* Sections */
.sections { display: flex; flex-direction: column; gap: 1rem; }
.section { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.2rem; }
.section h2 { margin: 0 0 0.75rem; font-size: 0.85rem; letter-spacing: 0.06em; color: var(--accent-dark); }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.7rem 1.2rem; margin: 0; }
.field dt { font-size: 0.7rem; letter-spacing: 0.05em; color: var(--muted); font-weight: 700; }
.field dd { margin: 0.1rem 0 0; font-size: 0.92rem; word-break: break-word; }

/* Q&A table */
.qa { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.qa th { text-align: left; color: var(--muted); font-size: 0.75rem; letter-spacing: 0.05em; padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--border); }
.qa td { padding: 0.45rem 0.5rem; border-bottom: 1px solid var(--border); }
.qa tr:last-child td { border-bottom: none; }
.ans-yes { color: var(--accent-dark); font-weight: 700; }
.ans-no { font-weight: 700; }
.note { background: var(--bg); border-radius: 8px; padding: 0.5rem 0.75rem; font-size: 0.88rem; margin: 0.5rem 0 0; }

/* Photo gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.9rem; }
.inline-gallery { margin-top: 1rem; }
.shot { margin: 0; cursor: zoom-in; }
.shot img {
    width: 100%; aspect-ratio: 9 / 14; object-fit: cover;
    border-radius: 10px; border: 1px solid var(--border); display: block; background: #e2e8f0;
}
.shot figcaption { font-size: 0.78rem; color: var(--muted); margin-top: 0.3rem; text-align: center; }

/* Lightbox */
.lightbox {
    position: fixed; inset: 0; background: rgba(10, 15, 20, 0.85);
    display: flex; align-items: center; justify-content: center; z-index: 50; cursor: zoom-out;
}
.lightbox figure { margin: 0; max-width: 92vw; max-height: 92vh; text-align: center; }
.lightbox img { max-width: 92vw; max-height: 85vh; border-radius: 8px; }
.lightbox figcaption { color: #e2e8f0; margin-top: 0.5rem; font-size: 0.9rem; }
.lightbox figcaption a { color: #6fe0b4; margin-left: 0.5rem; }

#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: #fff3cd; padding: 0.6rem 1rem; z-index: 100; }
