/* P7OS styles. Black-and-white P7 brand; Montserrat headings, Inter body. Design source: docs/design/mockup/. */

:root {
    --ink: #111111;
    --muted: #555555;
    --page: #F4F4F2;
    --card: #FFFFFF;
    --line: #E2E2DE;
    --black: #000000;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--page); color: var(--ink); font: 400 15px/1.5 Inter, system-ui, sans-serif; }
h1, h2 { font-family: Montserrat, sans-serif; }
h1:focus { outline: none; }
a { color: var(--ink); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.os-muted { color: var(--muted); }

/* ── Shell ─────────────────────────────────────────── */
.os-shell { min-height: 100vh; display: flex; flex-direction: column; }
.os-topbar { background: var(--black); color: #FFFFFF; }
.os-topbar-inner { max-width: 1280px; margin: 0 auto; padding: 14px 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.os-logo img { height: 38px; width: auto; display: block; filter: invert(1); }
.os-user { display: flex; align-items: center; gap: 12px; font-weight: 500; font-size: 14px; }
.os-avatar { width: 34px; height: 34px; border-radius: 8px; background: #FFFFFF; color: var(--black); display: flex; align-items: center; justify-content: center; font: 700 13px Montserrat, sans-serif; }
.os-user form { margin: 0; }
.os-signout { height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid #333333; background: transparent; color: #FFFFFF; font: 500 14px Inter, sans-serif; cursor: pointer; }
.os-signout:hover { background: #1C1C1C; }

.os-main { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 28px 24px 48px; display: flex; flex-direction: column; gap: 36px; }

.os-footer { border-top: 1px solid var(--line); background: var(--card); }
.os-footer-inner { max-width: 1280px; margin: 0 auto; padding: 22px 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; }
.os-footer-logo { height: 28px; width: auto; display: block; }
.os-footer p { margin: 0; font-size: 13px; color: var(--muted); }

/* ── Home ──────────────────────────────────────────── */
.os-hero { position: relative; border-radius: 18px; overflow: hidden; background: var(--black); }
.os-hero-img { display: block; width: 100%; height: 280px; object-fit: cover; }
.os-hero-text { position: absolute; inset: 0 auto 0 0; width: min(560px, 100%); padding: 32px 40px; display: flex; flex-direction: column; justify-content: center; gap: 10px; color: #FFFFFF;
    background: linear-gradient(90deg, rgba(0,0,0,.82) 0%, rgba(0,0,0,.55) 65%, rgba(0,0,0,0) 100%); }
.os-hero-text h1 { margin: 0; font-size: 40px; line-height: 1.1; font-weight: 700; }
.os-hero-text p { margin: 0; font-size: 16px; color: #E5E5E5; }
.os-hero-text .os-eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #D4D4D4; }

.os-section { display: flex; flex-direction: column; gap: 16px; }
.os-section h2 { margin: 0; font-size: 22px; font-weight: 700; }
.os-section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.os-search { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--muted); flex: 0 1 320px; }
.os-search input { flex: 1; border: 0; outline: none; background: transparent; font: 400 15px Inter, sans-serif; color: var(--ink); }

.os-app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 18px; }
.os-app-tile { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px; min-height: 210px; display: flex; flex-direction: column; gap: 18px; text-decoration: none; color: var(--ink);
    box-shadow: 0 1px 2px rgba(0,0,0,.04); transition: box-shadow .15s, transform .15s, border-color .15s; }
a.os-app-tile:hover { border-color: #C9C9C4; box-shadow: 0 6px 18px rgba(0,0,0,.08); transform: translateY(-2px); }
.os-app-tile.coming-soon { opacity: .7; }
.os-app-logo { height: 64px; display: flex; align-items: center; }
.os-app-logo img.wide { height: 44px; width: auto; max-width: 100%; object-fit: contain; }
.os-app-logo img.square { height: 60px; width: 60px; }
.os-app-body { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.os-app-name { font: 700 18px Montserrat, sans-serif; }
.os-app-desc { font-size: 14px; color: var(--muted); }
.os-app-open { display: flex; align-items: center; justify-content: space-between; font-weight: 600; font-size: 14px; }
.os-app-soon { font-weight: 600; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

.os-link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.os-link { height: 60px; padding: 0 16px; display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; font-weight: 600; }
.os-link:hover { border-color: #C9C9C4; }

/* ── Sign in / access denied ───────────────────────── */
.os-signin { min-height: 100vh; display: flex; flex-wrap: wrap; background: var(--black); color: #FFFFFF; }
.os-signin-photo { flex: 1 1 520px; position: relative; min-height: 280px; overflow: hidden; }
.os-signin-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 30% center; }
.os-signin-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,0) 40%, rgba(0,0,0,1) 100%); }
.os-signin-panel { flex: 1 1 420px; display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.os-signin-box { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 24px; }
.os-signin-logo { height: 64px; width: auto; align-self: flex-start; filter: invert(1); }
.os-signin h1 { margin: 0 0 10px; font-size: 32px; line-height: 1.15; }
.os-signin-lead { margin: 0; font-size: 16px; color: #C7C7C7; }
.os-signin-btn { display: flex; align-items: center; justify-content: center; gap: 12px; height: 52px; border-radius: 12px; background: #FFFFFF; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 16px; }
.os-signin-btn:hover { background: #E8E8E8; color: var(--ink); }
.os-signin-note { margin: 0; padding: 10px 14px; border-radius: 10px; background: #1C1C1C; font-size: 14px; }
.os-signin-preview { margin: 0; padding: 10px 14px; border-radius: 10px; border: 1px dashed #777777; font-size: 13px; color: #E5E5E5; }
.os-signin-help { margin: 0; font-size: 13px; color: #A3A3A3; }
.os-signin-ventures { height: 26px; width: auto; align-self: flex-start; filter: invert(1); margin-top: 8px; }

.empty-state { max-width: 560px; margin: 80px auto; text-align: center; padding: 0 24px; }

/* ── Blazor's own error bar ─────────────────────────── */
#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; width: 100%; z-index: 1000; padding: .6rem 1.25rem; background: #FFF4C2; box-shadow: 0 -1px 2px rgba(0,0,0,.2); }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }
.blazor-error-boundary { background: #B32121; padding: 1rem; color: #FFFFFF; }
.blazor-error-boundary::after { content: "Something went wrong."; }

/* ── Narrow windows: sign-in photo becomes a short strip above the panel ── */
@media (max-width: 960px) {
    .os-signin { flex-direction: column; }
    .os-signin-photo { flex: 0 0 200px; min-height: 0; }
    .os-signin-photo::after { background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,1) 100%); }
    .os-signin-panel { flex: 1 0 auto; align-items: flex-start; }
}

/* ── Phones and tablets: notch-safe edges (the page uses viewport-fit=cover) ── */
.os-topbar-inner, .os-footer-inner, .os-main { padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); }
.os-footer-inner { padding-bottom: max(22px, env(safe-area-inset-bottom)); }
@media (hover: none) { a.os-app-tile:hover { transform: none; } }

/* ── Tablets ────────────────────────────────────────── */
@media (max-width: 900px) {
    .os-hero-img { height: 240px; }
    .os-hero-text { padding: 28px 32px; }
    .os-hero-text h1 { font-size: 34px; }
    .os-app-grid { gap: 14px; }
    .os-link-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ── Phones ─────────────────────────────────────────── */
@media (max-width: 600px) {
    .os-topbar-inner { padding-top: 10px; padding-bottom: 10px; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
    .os-logo img { height: 32px; }
    .os-user-name { display: none; }
    .os-main { padding: 16px max(16px, env(safe-area-inset-right)) 32px max(16px, env(safe-area-inset-left)); gap: 28px; }
    .os-hero { border-radius: 14px; }
    .os-hero-text { position: relative; width: 100%; padding: 20px; background: var(--black); }
    .os-hero-img { height: 140px; }
    .os-hero-text h1 { font-size: 26px; }
    .os-hero-text p { font-size: 15px; }
    .os-section h2 { font-size: 20px; }
    .os-search { flex-basis: 100%; }
    .os-search input { font-size: 16px; } /* under 16px, iPhones zoom the page when the box is tapped */
    .os-app-tile { min-height: 0; padding: 18px; gap: 14px; border-radius: 14px; }
    .os-app-logo { height: 52px; }
    .os-app-logo img.wide { height: 38px; }
    .os-app-logo img.square { height: 50px; width: 50px; }
    .os-link-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .os-link { height: 54px; }
    .os-footer-inner { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); flex-direction: column; align-items: flex-start; }
    .os-signin-panel { padding: 32px 20px max(32px, env(safe-area-inset-bottom)); }
    .os-signin-photo { flex-basis: 160px; }
    .os-signin h1 { font-size: 28px; }
}
