/* Small, self-contained stylesheet - this app is one page (plus a landing/error
   page), so it deliberately doesn't vendor Bootstrap the way OpsisDocumentation.Web
   does; that's a lot of dead weight for a single public-facing card. */

:root {
    color-scheme: light dark;
    --bg: #f4f5f7;
    --card-bg: #ffffff;
    --text: #1b1f24;
    --text-muted: #6a7178;
    --border: #e1e4e8;
    --accent: #0d6efd;
    --accent-contrast: #ffffff;
    --danger: #b02a37;
    --danger-bg: rgba(220, 53, 69, 0.1);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #14161a;
        --card-bg: #1d2025;
        --text: #e8eaed;
        --text-muted: #9aa1a9;
        --border: #2c3036;
        --accent: #5a9eff;
        --accent-contrast: #0b1220;
        --danger: #ff8f98;
        --danger-bg: rgba(255, 100, 110, 0.14);
    }
}

* {
    box-sizing: border-box;
}

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

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-header {
    padding: 1.25rem 1.5rem;
}

.brand {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--text);
    text-decoration: none;
}

.brand-accent {
    color: var(--accent);
    font-weight: 400;
}

.page-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.page-footer {
    padding: 1rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.card {
    width: 100%;
    max-width: 30rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* Widened variant, split into a thumbnail on the left and the usual title/
   description/meta/form content on the right - used only when the shared file
   actually has a thumbnail (Share.cshtml). A real 4/8 grid split (same ratio as
   Bootstrap's col-4/col-8), not a flex row - flex was letting the image's own
   intrinsic size (a generated thumbnail can be up to 640px) win out over the
   width/height below in some browsers instead of being constrained by them. */
.card.has-thumb {
    max-width: 42rem;
    display: grid;
    grid-template-columns: 4fr 8fr;
    gap: 1.5rem;
    align-items: start;
}

.card.has-thumb .card-content {
    min-width: 0; /* lets file-meta's dd/description text-wrap instead of overflowing its grid column */
}

.file-thumb-img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    background: var(--bg);
}

@media (max-width: 32rem) {
    .card.has-thumb {
        grid-template-columns: 1fr;
    }

    .file-thumb-img {
        max-width: 9rem;
        margin: 0 auto;
    }
}

.card h1 {
    margin: 0 0 0.5rem;
    font-size: 1.4rem;
}

.file-description {
    color: var(--text-muted);
    margin: 0 0 1.25rem;
}

.file-meta {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.25rem 0.75rem;
    margin: 0 0 1.5rem;
    font-size: 0.9rem;
}

.file-meta dt {
    color: var(--text-muted);
}

.file-meta dd {
    margin: 0;
    word-break: break-word;
}

.field {
    margin-bottom: 1rem;
}

.field label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
}

.field input[type="password"] {
    width: 100%;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 0.4rem;
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
}

.error {
    color: var(--danger);
    background: var(--danger-bg);
    border-radius: 0.4rem;
    padding: 0.5rem 0.65rem;
    font-size: 0.9rem;
    margin: -0.5rem 0 1rem;
}

.btn-primary {
    width: 100%;
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 0.4rem;
    background: var(--accent);
    color: var(--accent-contrast);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-primary:hover {
    filter: brightness(1.05);
}
