/* ==========================================================================
   app.css - GLOBAL styles only: things shared by several components.
   Component-specific styles live next to the component in <Name>.razor.css
   ========================================================================== */

/* ============ Tokens ============ */
:root {
    --brand: #2563eb;
    --brand-dark: #1e40af;
    --brand-bright: #0066ff;
    --brand-deep: #003d99;
    --accent: #0ea5e9;
    --text: #1e293b;
    --muted: #475569;
    --line: #e2e8f0;
    --bg-soft: #f8fafc;
    --bg-tint: #e0f2fe;
    --ok-bg: #ecfdf5;
    --ok-line: #a7f3d0;
    --ok-text: #065f46;
    --warn-bg: #fffbeb;
    --warn-line: #fde68a;
    --warn-text: #92400e;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 2px 12px rgba(0, 0, 0, .06);
    --font: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
    /* make Radzen components pick up the brand */
    --rz-primary: var(--brand);
    --rz-text-font-family: var(--font);
}

/* ============ Base ============ */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
}

body {
    min-height: 100vh;
    font-family: var(--font);
    line-height: 1.5;
    color: var(--text);
    background: linear-gradient(135deg, var(--bg-soft) 0%, var(--bg-tint) 100%) fixed;
}

a {
    color: var(--brand);
}

    a:hover {
        color: var(--brand-dark);
    }

:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .45);
    outline-offset: 2px;
}

/* Blazor focuses the h1 after navigation; no ring needed for that */
h1:focus {
    outline: none;
}

/* ============ Page layout ============ */
.tp-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
}

/* the content block that overlaps the bottom of the hero banner */
.page-main {
    margin-top: -72px;
    padding-bottom: 64px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.tp-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.tp-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

/* ============ Building blocks ============ */
.tp-pill {
    padding: 6px 16px;
    border-radius: 30px;
    background: #fff;
    color: var(--brand);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
}

/* white card; the modifiers below tint it */
.tp-panel {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid rgba(37, 99, 235, .1);
    box-shadow: var(--shadow);
    padding: 28px;
}

.tp-panel--ok {
    background: var(--ok-bg);
    border-color: var(--ok-line);
    color: var(--ok-text);
}

.tp-panel--warn {
    background: var(--warn-bg);
    border-color: var(--warn-line);
    color: var(--warn-text);
}

.tp-panel--error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

    .tp-panel--error ul {
        margin: 8px 0 0;
        padding-left: 20px;
    }

/* gradient square that holds an icon */
.tp-tile {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--brand), var(--accent));
}

.section-title h2 {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 600;
}

.section-title p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--muted);
}

/* ============ Buttons ============ */
.tp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 48px;
    padding: 0 28px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}

    .tp-btn:disabled {
        opacity: .5;
        cursor: not-allowed;
    }

.tp-btn-primary {
    background: var(--brand);
    color: #fff;
}

    .tp-btn-primary:hover {
        background: var(--brand-dark);
        color: #fff;
    }

.tp-btn-outline {
    background: #fff;
    color: var(--brand);
    border-color: var(--brand);
}

    .tp-btn-outline:hover {
        background: #eff6ff;
        color: var(--brand-dark);
    }

.tp-btn-sm {
    height: 38px;
    padding: 0 16px;
    font-size: 14px;
}

.tp-btn-block {
    width: 100%;
}

/* ============ Validation (Blazor adds these classes) ============ */
.validation-message {
    color: #e50000;
}

/* ============ Forms ============ */
.tp-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tp-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

    .tp-field label {
        font-size: 14px;
        font-weight: 500;
    }

.tp-input {
    height: 48px;
    padding: 0 14px;
    border: 1px solid #7b8ba1;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 15px;
    color: var(--text);
    background: #fff;
}

    .tp-input:focus {
        outline: none;
        border-color: var(--brand);
        box-shadow: 0 0 0 3px rgba(37, 99, 235, .2);
    }

    /* `invalid` is added by Blazor's validation when a field fails */
    .tp-input.invalid {
        border-color: #dc2626;
    }

.tp-field-error {
    font-size: 13px;
    color: #b91c1c;
}

.tp-check {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

    .tp-check input {
        width: 18px;
        height: 18px;
        accent-color: var(--brand);
    }

/* inline message box, e.g. "Invalid login attempt" */
.tp-alert {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.tp-alert--error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

/* ============ Blazor built-in UI ============ */
/* the yellow bar shown on an unhandled exception (used by MainLayout and AuthLayout) */
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, .2);
    display: none;
    left: 0;
    padding: .6rem 1.25rem .7rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: .75rem;
        top: .5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBp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Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

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

/* ============ Mobile (global rules only; component rules live in their .razor.css) ============ */
@media (max-width: 860px) {
    .tp-grid-2, .tp-grid-3 {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 720px) {
    .tp-container {
        padding: 0 20px;
    }

    .page-main {
        margin-top: -64px;
        padding-bottom: 40px;
    }

    .tp-panel {
        padding: 20px;
    }
}
