/* ============================================================
   Base
   ============================================================ */
html, body {
    margin: 0;
    scroll-behavior: smooth;
}

h1:focus {
    outline: none;
}

code, pre {
    font-family: 'Roboto Mono', 'Cascadia Code', Consolas, 'Courier New', monospace;
}

.validation-message {
    color: #b3261e;
    font-size: 0.8rem;
}

#blazor-error-ui {
    color-scheme: light dark;
    background: #b3261e;
    color: #ffffff;
    bottom: 0;
    box-shadow: 0 -1px 6px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.8rem 1.4rem;
    position: fixed;
    width: 100%;
    z-index: 1500;
}

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

.blazor-error-boundary {
    background: #b3261e;
    padding: 1rem;
    color: #ffffff;
    border-radius: 8px;
}

    .blazor-error-boundary::after {
        content: "Ocorreu um erro.";
    }

/* ============================================================
   Side navigation
   (global, not component-scoped, so it can target the
   classes we put on MudBlazor components)
   ============================================================ */
.docs-nav-section {
    padding: 16px 16px 4px 16px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
    opacity: 0.85;
}

.docs-nav .mud-nav-link {
    border-radius: 8px;
    margin: 2px 8px;
}

.docs-nav .mud-nav-link.active {
    background-color: var(--mud-palette-primary-hover);
    font-weight: 600;
}

/* ============================================================
   Home / landing
   ============================================================ */
.docs-hero {
    border-radius: 16px;
    color: #ffffff;
    background: linear-gradient(135deg, #43a047 0%, #2e7d32 60%, #1b5e20 100%);
    box-shadow: 0 12px 36px rgba(27, 94, 32, 0.28);
}

.docs-hero-eyebrow {
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    opacity: 0.85;
    margin-bottom: 6px;
}

.docs-hero-title {
    font-weight: 700;
    margin-bottom: 12px;
}

.docs-hero-subtitle {
    max-width: 720px;
    opacity: 0.92;
    line-height: 1.6;
}

.docs-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

/* Keep the buttons readable on the green hero. */
.docs-hero-actions .mud-button-root.mud-button-outlined {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.08);
}

.docs-hero-actions .mud-button-root.mud-button-filled {
    background-color: #ffffff;
    color: #1b5e20;
}

.docs-card {
    height: 100%;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}

.docs-card:hover {
    transform: translateY(-3px);
    border-color: var(--mud-palette-primary);
    box-shadow: 0 10px 28px rgba(46, 125, 50, 0.16);
}

/* ============================================================
   Login (static SSR page; dark mode follows the OS setting)
   ============================================================ */
.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
    background: linear-gradient(135deg, #e8f5e9 0%, #f4faf2 45%, #dcedd6 100%);
    font-family: 'Roboto', 'Segoe UI', Helvetica, Arial, sans-serif;
}

.login-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 16px;
    padding: 40px 36px;
    box-sizing: border-box;
    box-shadow: 0 18px 50px rgba(27, 94, 32, 0.16);
    border: 1px solid #e3efdf;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    color: #ffffff;
    background: linear-gradient(135deg, #43a047, #2e7d32);
    box-shadow: 0 6px 16px rgba(46, 125, 50, 0.35);
}

.login-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1b2620;
    line-height: 1.1;
}

.login-subtitle {
    margin: 2px 0 0 0;
    font-size: 0.85rem;
    color: #43a047;
    font-weight: 500;
}

.login-lead {
    margin: 0 0 24px 0;
    font-size: 0.9rem;
    color: #5c6b5e;
    line-height: 1.5;
}

.login-label {
    display: block;
    margin: 16px 0 6px 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: #2a352b;
}

.login-input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border: 1px solid #cfe0ca;
    border-radius: 10px;
    font-size: 0.95rem;
    color: #1b2620;
    background: #fbfdfa;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.login-input:focus {
    outline: none;
    border-color: #43a047;
    box-shadow: 0 0 0 3px rgba(67, 160, 71, 0.18);
    background: #ffffff;
}

.login-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 18px 0 24px 0;
    font-size: 0.85rem;
    color: #5c6b5e;
    cursor: pointer;
}

.login-remember input {
    width: 16px;
    height: 16px;
    accent-color: #2e7d32;
}

.login-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #43a047, #2e7d32);
    cursor: pointer;
    transition: filter .15s ease, transform .05s ease;
}

.login-button:not(:disabled):hover {
    filter: brightness(1.06);
}

.login-button:not(:disabled):active {
    transform: translateY(1px);
}

.login-button:disabled {
    cursor: progress;
    /* Desaturate the brand gradient to a muted gray + dim it, so the button clearly
       reads as disabled while the POST is in flight. Animates via the transition above. */
    filter: grayscale(1) opacity(0.55);
}

/* Spinner shown inside the button while the credentials POST is in flight. */
.login-button__spinner {
    display: none;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #ffffff;
    animation: login-spin 0.6s linear infinite;
}

.login-card.login-loading .login-button__spinner {
    display: inline-block;
}

/* Slim indeterminate progress bar pinned to the top edge of the card. */
.login-progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    overflow: hidden;
    border-radius: 16px 16px 0 0;
    background: rgba(67, 160, 71, 0.15);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.login-card.login-loading .login-progress {
    opacity: 1;
}

.login-progress span {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 40%;
    background: linear-gradient(90deg, #43a047, #2e7d32);
    animation: login-progress-slide 1.1s ease-in-out infinite;
}

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

@keyframes login-progress-slide {
    0% {
        left: -40%;
    }
    100% {
        left: 100%;
    }
}

.login-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 10px 14px;
    border-radius: 10px;
    background: #fdecea;
    border: 1px solid #f5c6c0;
    color: #b3261e;
    font-size: 0.85rem;
}

.login-card .validation-message {
    display: block;
    margin-top: 6px;
    font-size: 0.78rem;
    color: #b3261e;
}

.login-footer {
    margin: 26px 0 0 0;
    text-align: center;
    font-size: 0.75rem;
    color: #8aa08c;
}

.login-forgot {
    margin: 16px 0 0 0;
    text-align: center;
    font-size: 0.85rem;
}

.login-link {
    color: #2e7d32;
    font-weight: 600;
    text-decoration: none;
}

.login-link:hover {
    text-decoration: underline;
}

.login-success {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #e8f5e9;
    border: 1px solid #b6dcb9;
    color: #1b5e20;
    font-size: 0.85rem;
    line-height: 1.5;
}

.login-success svg {
    flex-shrink: 0;
    margin-top: 1px;
}

@media (prefers-color-scheme: dark) {
    .login-shell {
        background: linear-gradient(135deg, #11150f 0%, #161d14 50%, #0c120a 100%);
    }

    .login-card {
        background: #19211a;
        border-color: #27331f;
        box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
    }

    .login-title {
        color: #e7f0e6;
    }

    .login-subtitle {
        color: #81c784;
    }

    .login-lead {
        color: #9fb29f;
    }

    .login-label {
        color: #d7e4d6;
    }

    .login-input {
        background: #11160f;
        border-color: #2f3d27;
        color: #e7f0e6;
    }

    .login-input:focus {
        border-color: #81c784;
        box-shadow: 0 0 0 3px rgba(129, 199, 132, 0.22);
        background: #141b12;
    }

    .login-remember {
        color: #9fb29f;
    }

    .login-footer {
        color: #6f836f;
    }

    .login-alert {
        background: #2a1714;
        border-color: #5b2620;
        color: #f3b3ab;
    }

    .login-link {
        color: #81c784;
    }

    .login-success {
        background: #14241a;
        border-color: #2c5234;
        color: #a5d6a7;
    }
}

/* ============================================================
   Code blocks & language tabs (always dark, matching atom-one-dark)
   ============================================================ */
.code-tabs {
    margin: 16px 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #1c1f26;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    background: #282c34;
}

.code-tabs-bar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px 6px;
    background: #21252b;
    border-bottom: 1px solid #181b20;
    overflow-x: auto;
}

.code-tabs-grow {
    flex: 1 1 auto;
}

.code-tab {
    appearance: none;
    border: none;
    background: transparent;
    color: #9aa4b2;
    font: 500 0.8rem 'Roboto', 'Segoe UI', sans-serif;
    padding: 6px 12px;
    border-radius: 7px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .12s ease, color .12s ease;
}

.code-tab:hover {
    color: #e6e9ef;
    background: rgba(255, 255, 255, 0.05);
}

.code-tab.active {
    color: #ffffff;
    background: #2e7d32;
}

.code-copy {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    appearance: none;
    border: none;
    background: transparent;
    color: #9aa4b2;
    font: 500 0.78rem 'Roboto', 'Segoe UI', sans-serif;
    padding: 6px 10px;
    border-radius: 7px;
    cursor: pointer;
    transition: background .12s ease, color .12s ease;
}

.code-copy:hover {
    color: #e6e9ef;
    background: rgba(255, 255, 255, 0.06);
}

.code-pre {
    margin: 0;
    padding: 0;
    background: #282c34;
    overflow-x: auto;
}

.code-pre code {
    display: block;
    padding: 16px 18px;
    font-family: 'Roboto Mono', 'Cascadia Code', Consolas, 'Courier New', monospace;
    font-size: 0.84rem;
    line-height: 1.55;
    background: #282c34;
    color: #abb2bf;
    white-space: pre;
    tab-size: 2;
}

/* Tables used in the docs prose */
.docs-table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0 4px;
}

.docs-prose h2 {
    margin-top: 8px;
}

/* ============================================================
   Tutorial steps (numbered timeline)
   ============================================================ */
.tut-steps {
    position: relative;
    margin: 8px 0 8px;
}

.tut-step {
    display: flex;
    gap: 16px;
    padding-bottom: 22px;
    position: relative;
}

/* connecting line between step bullets */
.tut-step::before {
    content: "";
    position: absolute;
    left: 15px;
    top: 34px;
    bottom: -6px;
    width: 2px;
    background: var(--mud-palette-lines-default);
}

.tut-step:last-child::before {
    display: none;
}

.tut-step-num {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

.tut-step-body {
    flex: 1 1 auto;
    min-width: 0; /* lets code blocks scroll instead of overflowing the page */
    padding-top: 3px;
}

.tut-ul {
    margin: 4px 0 0 0;
    padding-left: 20px;
}

    .tut-ul li {
        margin-bottom: 6px;
        font-size: 0.875rem;
        line-height: 1.5;
    }

.tut-faq {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 10px;
    overflow: hidden;
}

/* ============================================================
   Flow diagrams (Overview) — theme-aware via MudBlazor variables
   ============================================================ */
.diagram {
    display: block;
    width: 100%;
    max-width: 560px;
    height: auto;
    margin: 16px auto 8px;
}

    .diagram text {
        font-family: 'Roboto', 'Segoe UI', sans-serif;
    }

    .diagram .node {
        fill: var(--mud-palette-surface);
        stroke: var(--mud-palette-lines-default);
        stroke-width: 1.5;
    }

    .diagram .node-soft {
        fill: var(--mud-palette-background-gray);
        stroke: var(--mud-palette-lines-default);
        stroke-width: 1.5;
    }

    .diagram .node-strong {
        fill: var(--mud-palette-primary);
        stroke: var(--mud-palette-primary);
    }

    .diagram .lbl {
        fill: var(--mud-palette-text-primary);
        font-size: 13px;
        font-weight: 500;
    }

    .diagram .lbl-strong {
        fill: var(--mud-palette-primary-text);
        font-size: 13px;
        font-weight: 600;
    }

    .diagram .lbl-sub {
        fill: var(--mud-palette-text-secondary);
        font-size: 11px;
        font-weight: 400;
    }

    .diagram .grp {
        fill: var(--mud-palette-primary);
        fill-opacity: .06;
        stroke: var(--mud-palette-primary);
        stroke-opacity: .5;
        stroke-width: 1.2;
        stroke-dasharray: 5 3;
    }

    .diagram .grp-title {
        fill: var(--mud-palette-primary);
        font-size: 10.5px;
        font-weight: 700;
        letter-spacing: .04em;
    }

    .diagram .edge {
        stroke: var(--mud-palette-text-secondary);
        stroke-width: 1.6;
        fill: none;
    }

    .diagram .edge-dash {
        stroke: var(--mud-palette-text-secondary);
        stroke-width: 1.6;
        fill: none;
        stroke-dasharray: 5 3;
        opacity: .85;
    }

    .diagram .edge-strong {
        stroke: var(--mud-palette-primary);
        stroke-width: 2;
        fill: none;
    }

    .diagram .ah {
        fill: var(--mud-palette-text-secondary);
    }

    .diagram .ah-strong {
        fill: var(--mud-palette-primary);
    }

    .diagram .elbl {
        fill: var(--mud-palette-text-secondary);
        font-size: 10.5px;
    }

    .diagram .elbl-strong {
        fill: var(--mud-palette-primary);
        font-size: 10.5px;
        font-weight: 600;
    }

    .diagram .msgbg {
        fill: var(--mud-palette-surface);
    }

    .diagram .life {
        stroke: var(--mud-palette-lines-default);
        stroke-width: 1.4;
        stroke-dasharray: 3 4;
    }

.diagram-caption {
    text-align: center;
    margin: 0 0 18px;
    font-size: 0.82rem;
    color: var(--mud-palette-text-secondary);
}
