/* BioRambam portal theme — public site (biorambam.biz). Shares the back-office palette
   (navy #052767 → plum #3a0647) so the two apps read as one product. */

:root {
    --br-navy: #052767;
    --br-plum: #3a0647;
    --br-grad: linear-gradient(135deg, #052767 0%, #3a0647 100%);
    --br-ink: #20233c;
    --br-muted: #6b7092;
    --br-surface: #f4f5fb;
    --br-border: #e7e8f2;
    --br-gold: #a9741f;

    --bs-primary: #1c2b6b;
    --bs-primary-rgb: 28, 43, 107;
    --bs-link-color: #23306e;
    --bs-link-hover-color: #3a0647;
}

/* ---- Request an account ---- */

.register-hero { text-align: start; }

.register-card {
    background: #fff;
    border: 1px solid var(--br-border);
    border-radius: 0.9rem;
    padding: 1.75rem;
    box-shadow: 0 1px 2px rgba(5, 39, 103, 0.05), 0 16px 32px -24px rgba(5, 39, 103, 0.35);
}

.register-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 1.1rem;
}
.register-wide { grid-column: 1 / -1; }

.register-field { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.register-field > span {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--br-muted);
}
/* The required marker has to survive a colour-blind reader, so it is a glyph, not just red. */
.register-field > span em { color: #b02a37; font-style: normal; }

.register-check { display: flex; align-items: center; gap: 0.6rem; font-size: 0.95rem; }

.register-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--br-border);
}
.register-note { font-size: 0.85rem; color: var(--br-muted); max-width: 34ch; }

.register-done h2 { font-size: 1.4rem; margin-bottom: 0.5rem; }
.register-done p { color: var(--br-muted); margin-bottom: 1.25rem; }

/* Honeypot: off-screen rather than display:none, because some bots skip hidden inputs and the
   whole point is that they fill this one in. */
.register-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Tints the shared clinical components (BioRambam.Ui) with the portal palette. Those components
   define every colour as var(--clinical-*, fallback), so this is the whole of the theming contract —
   the back office sets the same names to its own values. */
.clinical-scope {
    --clinical-accent: var(--br-navy);
    --clinical-ink: var(--br-ink);
    --clinical-muted: var(--br-muted);
    --clinical-border: var(--br-border);
    --clinical-surface: #fff;
    --clinical-hover: #eef0f9;
    --clinical-radius: 0.9rem;
}

html, body {
    background: var(--br-surface);
    color: var(--br-ink);
}

a { text-decoration: none; }

/* Buttons */
.btn-primary,
.btn-brand {
    background: var(--br-grad);
    border: 0;
    color: #fff;
}
.btn-primary:hover, .btn-primary:focus,
.btn-brand:hover, .btn-brand:focus {
    filter: brightness(1.1);
    background: var(--br-grad);
    color: #fff;
}
.btn-ghost {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: #fff;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

/* ---- Top header ------------------------------------------------------------------------------ */
.portal-header {
    background: var(--br-grad);
    color: #fff;
    box-shadow: 0 10px 30px -18px rgba(5, 39, 103, 0.7);
    position: sticky;
    top: 0;
    z-index: 20;
}
.portal-header-inner {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0.7rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.portal-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #fff;
}
.portal-brand img {
    height: 2.2rem;
    width: auto;
    background: #fff;
    padding: 0.2rem 0.5rem;
    border-radius: 0.4rem;
}
.portal-brand .suffix {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.82);
}
.portal-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}
.portal-nav a {
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.9rem;
    font-weight: 500;
}
.portal-nav a:hover { color: #fff; }

/* ---- Page frame ------------------------------------------------------------------------------ */
.portal-main { min-height: calc(100vh - 3.6rem); }
.portal-container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
}

/* ---- Hero ------------------------------------------------------------------------------------- */
.portal-hero {
    background: var(--br-grad);
    color: #fff;
    border-radius: 1.1rem;
    padding: 2.6rem 2.4rem;
    margin: 1.75rem 0 2rem;
    box-shadow: 0 24px 60px -30px rgba(5, 39, 103, 0.65);
    position: relative;
    overflow: hidden;
}
.portal-hero::after {
    content: "";
    position: absolute;
    right: -6rem; top: -6rem;
    width: 20rem; height: 20rem;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.12), transparent 70%);
}
.portal-hero .eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.74rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.75rem;
}
.portal-hero h1 {
    font-size: clamp(1.9rem, 4vw, 2.8rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0;
    max-width: 20ch;
}
.portal-hero p {
    margin: 0.9rem 0 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 1.05rem;
    max-width: 52ch;
    line-height: 1.55;
}
.portal-hero .hero-actions {
    margin-top: 1.6rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ---- Stat tiles ------------------------------------------------------------------------------- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 1rem;
    margin: -3.5rem 0 2.25rem;   /* pull up so tiles overlap the hero's lower edge */
    position: relative;
    z-index: 5;
}
.kpi {
    background: #fff;
    border: 1px solid var(--br-border);
    border-radius: 0.85rem;
    padding: 1.15rem 1.3rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(5, 39, 103, 0.05), 0 20px 40px -28px rgba(5, 39, 103, 0.4);
}
.kpi::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--br-grad);
}
.kpi .kpi-num { font-size: 2rem; font-weight: 800; color: var(--br-navy); line-height: 1; }
.kpi .kpi-lbl {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--br-muted);
    margin-top: 0.45rem;
}

/* ---- Sections --------------------------------------------------------------------------------- */
.portal-section { margin: 2.5rem 0; }
.portal-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.1rem;
}
.portal-section-head h2 {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0;
    color: var(--br-ink);
}
.portal-section-head .lead {
    color: var(--br-muted);
    font-size: 0.92rem;
    margin: 0.2rem 0 0;
}

/* Application cards */
.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: 1.1rem;
}
.app-card {
    background: #fff;
    border: 1px solid var(--br-border);
    border-radius: 0.85rem;
    padding: 1.3rem 1.35rem;
    box-shadow: 0 1px 2px rgba(5, 39, 103, 0.05), 0 18px 36px -30px rgba(5, 39, 103, 0.4);
    transition: transform 0.14s ease, box-shadow 0.14s ease;
}
.app-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 1px 2px rgba(5, 39, 103, 0.06), 0 26px 46px -26px rgba(5, 39, 103, 0.5);
}
.app-card .app-badge {
    width: 2.6rem; height: 2.6rem;
    border-radius: 0.7rem;
    background: var(--br-grad);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 1.1rem;
    margin-bottom: 0.9rem;
}
.app-card h3 {
    font-size: 1.08rem;
    font-weight: 700;
    margin: 0;
    color: var(--br-ink);
    word-break: break-word;
}
.app-card .app-meta {
    margin-top: 0.5rem;
    font-size: 0.82rem;
    color: var(--br-muted);
}

/* "What a test type is" — the doc-backed explainer above the catalogue */
.catalogue-note {
    background: #fff;
    border: 1px solid var(--br-border);
    border-inline-start: 4px solid var(--br-gold);
    border-radius: 0.8rem;
    padding: 1.2rem 1.35rem;
    margin-bottom: 1.25rem;
    max-width: 52rem;
}
.catalogue-note h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.45rem;
    color: var(--br-navy);
}
.catalogue-note p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.62;
    color: var(--br-muted);
}

/* Test types nested inside the application that owns them */
.app-tests {
    list-style: none;
    margin: 0.95rem 0 0;
    padding: 0.95rem 0 0;
    border-top: 1px solid var(--br-border);
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

/* Test-type chips */
.tt-wrap {
    background: #fff;
    border: 1px solid var(--br-border);
    border-radius: 0.85rem;
    padding: 1.3rem 1.4rem;
    box-shadow: 0 1px 2px rgba(5, 39, 103, 0.05), 0 18px 36px -30px rgba(5, 39, 103, 0.4);
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}
.tt-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: #eef1fb;
    border: 1px solid #d8dcf3;
    color: #2b356f;
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
}
.tt-chip .code {
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 0.72rem;
    background: #fff;
    border: 1px solid #d8dcf3;
    border-radius: 0.35rem;
    padding: 0 0.35rem;
    color: var(--br-plum);
}

.portal-empty {
    color: var(--br-muted);
    background: #fff;
    border: 1px dashed var(--br-border);
    border-radius: 0.8rem;
    padding: 1.4rem 1.5rem;
    text-align: center;
}

/* ---- Sign-in ---------------------------------------------------------------------------------- */
.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: var(--br-grad);
}
.login-card {
    width: 100%;
    max-width: 24rem;
    padding: 2rem 1.75rem;
    background: #fff;
    border-radius: 0.9rem;
    box-shadow: 0 24px 60px -24px rgba(5, 39, 103, 0.6);
}
.login-logo { height: 2.6rem; width: auto; }
.login-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--br-plum);
}

/* ---- Signed-in area --------------------------------------------------------------------------- */
.me-hero {
    background: var(--br-grad);
    color: #fff;
    border-radius: 1.1rem;
    padding: 1.9rem 2.1rem;
    margin: 1.75rem 0 2rem;
    box-shadow: 0 24px 60px -30px rgba(5, 39, 103, 0.65);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.me-hero .eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.72rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
}
.me-hero h1 { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.01em; margin: 0; }

/* Recent-tests table, styled to match the admin tables */
.tests-card {
    background: #fff;
    border: 1px solid var(--br-border);
    border-radius: 0.85rem;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(5, 39, 103, 0.05), 0 18px 36px -30px rgba(5, 39, 103, 0.4);
}
.tests-table { width: 100%; margin: 0; border-collapse: collapse; }
.tests-table thead th {
    color: var(--br-navy);
    border-bottom: 2px solid var(--br-border);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.72rem;
    font-weight: 700;
    text-align: left;
    padding: 0.9rem 1rem;
}
.tests-table tbody td { padding: 0.75rem 1rem; border-top: 1px solid #eef0f6; font-size: 0.92rem; }
.tests-table tbody tr:hover > td { background: #f4f6fc; }
.tests-table thead th:first-child, .tests-table tbody td:first-child { padding-left: 1.4rem; }
.tests-table thead th:last-child, .tests-table tbody td:last-child { padding-right: 1.4rem; }

.test-badge {
    display: inline-block;
    background: #eef1fb;
    border: 1px solid #d8dcf3;
    color: #2b356f;
    border-radius: 999px;
    padding: 0.15rem 0.6rem;
    font-size: 0.78rem;
    font-weight: 600;
}
.test-done  { background: #e6f4ec; color: #157347; border: 1px solid #bfe3cd; }
.test-open  { background: #f6ecd4; color: #a9741f; border: 1px solid #e7d3a1; }

/* ---- Footer ----------------------------------------------------------------------------------- */
.portal-footer {
    border-top: 1px solid var(--br-border);
    color: var(--br-muted);
    font-size: 0.85rem;
    background: #fff;
}
.portal-footer-inner {
    max-width: 1140px;
    margin: 0 auto;
    padding: 1.4rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
