/* Kampus RC2.9.1 — cumulative security and premium UX layer */
:root {
    --kampus-navy: #0a2472;
    --kampus-navy-strong: #06194f;
    --kampus-gold: #ffba08;
    --kampus-surface: #ffffff;
    --kampus-border: #dbe3f1;
    --kampus-muted: #65718a;
}

/* Consistent publisher signature */
.powered,
.auth-powered,
.app-footer {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
}
.powered img,
.auth-powered img,
.app-footer img { object-fit: contain; width: auto; }
.auth-powered { justify-content: center; color: var(--kampus-muted); font-size: .78rem; }
.app-footer { justify-content: center; min-height: 58px; padding: .9rem 1.25rem calc(.9rem + env(safe-area-inset-bottom)); background: var(--kampus-navy-strong); color: rgba(255,255,255,.74); font-size: .78rem; }
.tenant-logo-placeholder { width: 44px; height: 44px; border-radius: 14px; object-fit: cover; }

/* Global upload component */
.file-upload { display: grid; gap: .65rem; min-width: 0; }
.file-upload-label { color: #17213b; font-size: .9rem; font-weight: 750; }
.file-upload-label b { color: #b42318; }
.file-dropzone {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .9rem;
    min-height: 112px;
    padding: 1rem;
    overflow: hidden;
    border: 1.5px dashed #9aabd0;
    border-radius: 18px;
    background: linear-gradient(145deg, #fbfcff, #f2f6ff);
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
}
.file-dropzone:hover,
.file-dropzone:focus-within,
.file-dropzone.is-dragging { border-color: var(--kampus-navy); background: #edf3ff; box-shadow: 0 12px 32px rgba(10,36,114,.1); }
.file-dropzone.is-dragging { transform: translateY(-2px); }
.file-upload-input { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; clip-path: inset(50%) !important; white-space: nowrap !important; }
.file-upload-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; background: var(--kampus-navy); color: var(--kampus-gold); }
.file-upload-placeholder { width: 62px; height: 50px; border-radius: 12px; object-fit: cover; border: 1px solid var(--kampus-border); background: #fff; }
.file-upload-copy { min-width: 0; display: grid; gap: .2rem; }
.file-upload-copy strong { color: #17213b; font-size: .95rem; }
.file-upload-copy small { color: var(--kampus-muted); line-height: 1.45; }
.file-preview { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: .8rem; padding: .8rem; border: 1px solid var(--kampus-border); border-radius: 16px; background: #fff; }
.file-preview[hidden] { display: none !important; }
.file-preview img { width: 64px; height: 52px; border-radius: 10px; object-fit: cover; background: #eef2f8; }
.file-preview > div:not(.file-preview-actions) { min-width: 0; display: grid; gap: .18rem; }
.file-preview strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #17213b; }
.file-preview small { color: var(--kampus-muted); overflow-wrap: anywhere; }
.file-preview-actions { display: flex; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }

/* Space selection and platform members */
.space-choice-grid { display: grid; gap: .85rem; }
.space-choice { width: 100%; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: .9rem; padding: 1rem; border: 1px solid var(--kampus-border); border-radius: 18px; background: #fff; color: inherit; text-align: left; cursor: pointer; transition: .18s ease; }
.space-choice:hover, .space-choice:focus-visible { border-color: var(--kampus-navy); box-shadow: 0 12px 34px rgba(10,36,114,.12); transform: translateY(-1px); }
.space-choice .space-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--kampus-navy); color: var(--kampus-gold); }
.space-choice span { display: grid; gap: .15rem; }
.space-choice small { color: var(--kampus-muted); }
.platform-permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .7rem; }
.platform-permission { display: flex; gap: .65rem; align-items: flex-start; padding: .8rem; border: 1px solid var(--kampus-border); border-radius: 14px; background: #fafcff; }
.platform-permission input { margin-top: .2rem; }
.action-menu { position: relative; }
.action-menu > summary { list-style: none; cursor: pointer; }
.action-menu > summary::-webkit-details-marker { display: none; }
.action-menu-panel { position: absolute; z-index: 40; right: 0; top: calc(100% + .45rem); width: min(280px, 80vw); padding: .4rem; border: 1px solid var(--kampus-border); border-radius: 14px; background: #fff; box-shadow: 0 18px 50px rgba(13,29,72,.18); }
.action-menu-panel form { margin: 0; }
.action-menu-panel button { width: 100%; padding: .7rem .75rem; border: 0; border-radius: 10px; background: transparent; color: #1c2743; text-align: left; cursor: pointer; }
.action-menu-panel button:hover, .action-menu-panel button:focus-visible { background: #edf3ff; color: var(--kampus-navy); }
.member-access-actions { overflow: visible; }

/* Stable localization selector: dropdown on desktop, bottom sheet on mobile */
.localization-sheet-head { display: none; }
.localization-sheet-open { overflow: hidden; }
@media (max-width: 680px) {
    [data-localization-select].is-open [data-localization-options] {
        position: fixed !important;
        z-index: 10000 !important;
        inset: auto 0 0 !important;
        width: 100% !important;
        max-height: min(74dvh, 640px) !important;
        padding: 0 1rem calc(1rem + env(safe-area-inset-bottom)) !important;
        border: 0 !important;
        border-radius: 24px 24px 0 0 !important;
        background: #fff !important;
        box-shadow: 0 -18px 60px rgba(2,15,50,.25) !important;
        overflow-y: auto !important;
        overscroll-behavior: contain;
    }
    [data-localization-select].is-open::before { content: ''; position: fixed; z-index: 9999; inset: 0; background: rgba(3,14,46,.54); backdrop-filter: blur(2px); }
    .localization-sheet-head { position: sticky; z-index: 1; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 0 .8rem; background: #fff; }
    .localization-sheet-head strong { color: #17213b; }
}

/* Tenant premium identity and public discovery */
.tenant-public-identity { display: inline-flex; align-items: center; gap: .75rem; margin-bottom: 1rem; padding: .55rem .75rem; border: 1px solid rgba(255,255,255,.22); border-radius: 18px; background: rgba(7,24,70,.52); color: #fff; backdrop-filter: blur(12px); }
.tenant-public-identity img { width: 48px; height: 48px; border-radius: 13px; object-fit: cover; background: #fff; }
.tenant-public-identity span { font-size: .83rem; font-weight: 750; }
.tenant-hero { min-height: clamp(520px, 72vh, 720px); display: grid; align-items: end; position: relative; overflow: hidden; }
.tenant-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(4,20,62,.93) 0%, rgba(4,20,62,.76) 48%, rgba(4,20,62,.28) 100%), linear-gradient(0deg, rgba(4,20,62,.55), transparent 50%); }
.tenant-hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tenant-hero-content { position: relative; z-index: 1; padding-block: clamp(4rem, 8vw, 7.5rem); }
.tenant-hero-copy { max-width: 720px; }
.tenant-cover > img, .home-course-media > img { width: 100%; height: 100%; object-fit: cover; }
.tenant-identity > img, .call-brand > img { width: 48px; height: 48px; border-radius: 14px; object-fit: cover; background: #fff; }
.course-hero-image { min-height: 300px; object-fit: cover; }
.application-privacy-note { max-width: 640px; font-size: .88rem; opacity: .78; }
.application-heading { margin-bottom: 1rem; }
.page-hero { position: relative; overflow: hidden; background: radial-gradient(circle at 85% 20%, rgba(255,186,8,.24), transparent 30%), linear-gradient(135deg, #071d5f, #0a2472 58%, #123b9d); color: #fff; }
.page-hero::after { content: ''; position: absolute; right: -5%; bottom: -45%; width: 380px; aspect-ratio: 1; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; box-shadow: 0 0 0 44px rgba(255,255,255,.035), 0 0 0 92px rgba(255,255,255,.025); }
.page-hero > .container { position: relative; z-index: 1; }

/* Actions stay in document flow and never cover page titles */
.topbar { align-items: flex-start; }
.topbar-actions { position: relative; flex: 0 0 auto; }
@media (max-width: 780px) {
    .topbar { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: .65rem; }
    .topbar-actions { grid-column: 2 / -1; width: 100%; display: flex; flex-wrap: wrap; justify-content: flex-end; }
    .topbar-actions > .btn { min-height: 44px; }
    .page-heading { min-width: 0; }
}

/* PWA installation states */
.pwa-install-state { display: grid; gap: .8rem; place-items: center; text-align: center; padding: 1rem; border: 1px solid #cdd9f2; border-radius: 18px; background: #f4f7ff; }
.pwa-install-state img { width: 72px; height: 72px; border-radius: 18px; }

@media (max-width: 720px) {
    .file-dropzone { grid-template-columns: auto minmax(0,1fr); min-height: 104px; }
    .file-dropzone > .btn { grid-column: 1 / -1; justify-self: stretch; }
    .file-preview { grid-template-columns: auto minmax(0,1fr); }
    .file-preview-actions { grid-column: 1 / -1; justify-content: stretch; }
    .file-preview-actions .btn { flex: 1; min-height: 44px; }
    .platform-permission-grid { grid-template-columns: 1fr; }
    .member-access-row { align-items: flex-start; }
    .member-access-actions { width: 100%; justify-content: space-between; }
    .action-menu-panel { position: fixed; inset: auto .75rem calc(.75rem + env(safe-area-inset-bottom)); width: auto; }
    .tenant-hero { min-height: 600px; }
    .tenant-hero::after { background: linear-gradient(0deg, rgba(4,20,62,.96) 0%, rgba(4,20,62,.72) 70%, rgba(4,20,62,.35) 100%); }
    .course-hero-image { min-height: 220px; }
}

@media (prefers-reduced-motion: reduce) {
    .file-dropzone, .space-choice { transition: none; }
}
.call-detail-brand { display: inline-flex; align-items: center; gap: .65rem; margin-bottom: 1rem; color: rgba(255,255,255,.86); font-weight: 750; }
.call-detail-brand img { width: 44px; height: 44px; border-radius: 13px; object-fit: cover; background: #fff; }
.call-detail-content { display: grid; gap: 1.1rem; }
.call-theme-card { border-color: rgba(255,186,8,.45); background: linear-gradient(135deg, #fffaf0, #fff); }
.call-apply-panel { position: sticky; top: 1rem; align-self: start; }
@media (max-width: 900px) { .call-apply-panel { position: static; } }

/* Splash RC2.9.1: the approved artwork is rendered intact on every ratio. */
.app-splash {
    display: grid;
    place-items: center;
    padding: 0;
    overflow: hidden;
    background: #0a2472;
}
.app-splash img {
    width: 100%;
    height: 100%;
    max-width: 853px;
    object-fit: contain;
    background: #0a2472;
    filter: none;
}
