@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@500&display=swap');

:root {
    --bg-top: #1b1235;
    --bg-bottom: #341f52;
    --card: #241a3d;
    --card-border: rgba(232, 184, 109, 0.22);
    --gold: #e8b86d;
    --gold-dim: #a98653;
    --teal: #7fe7c4;
    --ink: #f5f0ff;
    --ink-dim: #b8a9d9;
    --page: #F4F5F3;
    --border: #E8E1D0;
    --border-strong: #D8CDAE;
    --gold-soft: #F3E7CE;
    --nav-color: #1b1235;
    --nav-ink: #f5f0ff;
    --nav-ink-dim: #b8a9d9;
    --nav-gold: #e8b86d;
    --nav-gold-rgb: 232, 184, 109;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--page);
    font-family: 'Inter', sans-serif;
    touch-action: manipulation;
    /*disable double tap zoom on mobile devices*/
}

.page {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

a,
.btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    font-family: math;
}

h1:focus {
    outline: none;
}

.rotate-overlay {
    display: none;
}

@media (orientation: landscape) and (max-width: 900px) {
    .rotate-overlay {
        display: flex;
        position: fixed;
        inset: 0;
        z-index: 9999;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 1rem;
        padding: 2rem;
        text-align: center;
        background: var(--page);
        color: var(--nav-color);
    }

    .rotate-overlay-icon {
        animation: rotate-hint 1.6s ease-in-out infinite;
    }

    .rotate-overlay ~ * {
        display: none !important;
    }
}

@keyframes rotate-hint {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(90deg); }
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e51180;
}

.valid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kuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

.form-floating>.form-control-plaintext::placeholder,
.form-floating>.form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating>.form-control-plaintext:focus::placeholder,
.form-floating>.form-control:focus::placeholder {
    text-align: start;
}

/* Custom styles added to template app.css */
.highlighter {
    z-index: 1;
    position: absolute;
    border-radius: 10px;
    background: transparent;
    box-sizing: border-box;

    /* the "lift" */
    transform: scale(1.03);
    transform-origin: center;

    /* layered shadow: soft ambient + a tighter contact shadow,
       both offset down-right as if lit from top-left */
    box-shadow:
        0 1px 8px rgba(0, 0, 0, 1),
        0 3px 10px rgba(0, 0, 0, 1),
        inset 0 1px 0 rgba(255, 255, 255, 1);

    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.scan-card {
    background: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease-in-out;
    border-top: 5px solid #2563eb;
}

.scan-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.3);
    background-color: #f8fafc;
}

.scan-card .icon {
    font-size: 2.8rem;
    color: #2563eb;
    margin-bottom: 0.75rem;
}

.scan-card h5 {
    font-weight: 600;
    color: #0f172a;
}

.scan-card p {
    color: #475569;
    font-size: 0.95rem;
}

.scan-icon {
    font-size: 2.2rem;
    color: #0d6efd;
    margin-bottom: 0.5rem;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #475569;
    margin: 2rem 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #cbd5e1;
}

.divider:not(:empty)::before {
    margin-right: 0.75em;
}

.divider:not(:empty)::after {
    margin-left: 0.75em;
}

/* Navbar */
.navbar {
    background-color: var(--nav-color);
    ;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.navbar-brand {
    font-weight: 700;
    color: var(--nav-ink) !important;
    font-size: 1.3rem;
    letter-spacing: 0.5px;
}

/* Main content */
.content-wrapper {
    padding: 2.5rem 1.5rem;
    max-width: 900px;
    margin: 0 auto;
}

h3 {
    font-weight: 700;
    color: #1e3a8a;
}

.text-muted-small {
    color: #475569;
    font-size: 0.9rem;
}

.section-label {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0 0 8px;
    color: #C9852B;
}

.detection-badge {
    background: rgba(13, 110, 253, 0.85);
    color: white;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 12px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.2);
    white-space: nowrap;
}

.detection-badge:active {
    background: #0b5ed7;
}

/* Blazor Server circuit reconnect UI — shown when the SignalR connection
   drops, e.g. when the PWA is backgrounded/suspended by the OS. Without
   this, a dropped circuit leaves the page looking frozen (buttons that
   don't respond, lists that never load). */
#components-reconnect-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
}

#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    display: flex;
}

.components-reconnect-dialog {
    background: #fff;
    border-radius: 0.75rem;
    padding: 1.5rem 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    text-align: center;
    max-width: 320px;
}

.components-reconnect-dialog p {
    margin: 0;
    color: #1e293b;
}

.components-reconnect-show-text,
.components-reconnect-failed-text,
.components-reconnect-rejected-text {
    display: none;
}

#components-reconnect-modal.components-reconnect-show .components-reconnect-show-text,
#components-reconnect-modal.components-reconnect-failed .components-reconnect-failed-text,
#components-reconnect-modal.components-reconnect-rejected .components-reconnect-rejected-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.components-reconnect-dialog button {
    margin-left: 0.5rem;
    padding: 0.35rem 1rem;
    border-radius: 0.4rem;
    border: none;
    background: #1b6ec2;
    color: #fff;
    cursor: pointer;
}

.components-reconnect-spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(27, 110, 194, 0.25);
    border-top-color: #1b6ec2;
    border-radius: 50%;
    display: inline-block;
    animation: components-reconnect-spin 0.8s linear infinite;
}

@keyframes components-reconnect-spin {
    to {
        transform: rotate(360deg);
    }
}