:root {
    color-scheme: light;
    --charcoal: #18201d;
    --steel: #2c3732;
    --ice: #e9f0ed;
    --paper: #f7f9f6;
    --white: #ffffff;
    --ember: #e45a35;
    --ember-dark: #bd4225;
    --conference: #34758c;
    --success: #3f765b;
    --warning: #ad6a23;
    --danger: #9f3e34;
    --muted: #68736e;
    --line: #d9e1dd;
    --shadow: 0 16px 40px rgba(24, 32, 29, 0.08);
    --font-body: "Segoe UI Variable Text", "Noto Sans", "Segoe UI", Arial, sans-serif;
    --font-display: "Bahnschrift SemiCondensed", "Arial Narrow", "Roboto Condensed", "Segoe UI", sans-serif;
    --font-data: "IBM Plex Mono", "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

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

html {
    scroll-behavior: smooth;
}

html, body {
    min-height: 100%;
    margin: 0;
}

body {
    background: var(--paper);
    color: var(--charcoal);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.58;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button, input, select, textarea {
    font: inherit;
}

button, a, select, input {
    -webkit-tap-highlight-color: transparent;
}

button, a {
    touch-action: manipulation;
}

a {
    color: inherit;
}

button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible {
    outline: 3px solid rgba(52, 117, 140, 0.35);
    outline-offset: 3px;
}

h1, h2, h3, h4, p {
    margin-top: 0;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    letter-spacing: -0.03em;
    text-wrap: balance;
}

p { text-wrap: pretty; }

h1:focus { outline: none; }

.button {
    align-items: center;
    border: 1px solid transparent;
    border-radius: 7px;
    cursor: pointer;
    display: inline-flex;
    font-weight: 720;
    gap: 0.55rem;
    justify-content: center;
    min-height: 44px;
    padding: 0.68rem 1rem;
    text-decoration: none;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button:disabled {
    cursor: wait;
    opacity: 0.62;
    transform: none;
}

.button--primary {
    background: var(--ember);
    color: var(--white);
}

.button--primary:hover {
    background: var(--ember-dark);
}

.button--quiet {
    background: var(--white);
    border-color: var(--line);
    color: var(--charcoal);
}

.button--quiet:hover {
    border-color: #aebbb5;
}

.button--text {
    background: transparent;
    color: var(--muted);
}

.button--confirm {
    background: var(--charcoal);
    color: var(--white);
    width: 100%;
}

.pilot-badge {
    align-items: center;
    color: #527064;
    display: inline-flex;
    font-size: 0.72rem;
    font-weight: 750;
    gap: 0.45rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.pilot-badge i {
    background: #62a079;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(98, 160, 121, 0.13);
    height: 7px;
    width: 7px;
}

.state-panel {
    align-items: center;
    background: var(--white);
    border: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin: clamp(2rem, 12vh, 8rem) auto;
    max-width: 560px;
    min-height: 300px;
    padding: 2rem;
    text-align: center;
}

.state-panel strong {
    font-family: var(--font-display);
    font-size: 1.6rem;
}

.state-panel p {
    color: var(--muted);
    margin: 0.4rem 0 1.25rem;
}

.state-mark {
    align-items: center;
    background: #fbe9e4;
    color: var(--danger);
    display: inline-flex;
    font-size: 1.1rem;
    font-weight: 800;
    justify-content: center;
    margin-bottom: 1rem;
    min-height: 48px;
    min-width: 48px;
    padding: 0.5rem;
}

.loader {
    animation: spin 800ms linear infinite;
    border: 3px solid var(--ice);
    border-right-color: var(--ember);
    border-radius: 50%;
    height: 38px;
    margin-bottom: 1rem;
    width: 38px;
}

#blazor-error-ui {
    background: #2e1814;
    bottom: 0;
    color: white;
    display: none;
    left: 0;
    padding: 0.8rem 1.25rem;
    position: fixed;
    right: 0;
    z-index: 1000;
}

#blazor-error-ui a {
    font-weight: 700;
    margin-left: 0.5rem;
}

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

.loading-progress {
    display: block;
    inset: 22vh 0 auto;
    margin: auto;
    position: absolute;
    width: 7rem;
}

.loading-progress circle {
    fill: none;
    stroke: var(--ice);
    stroke-width: 0.55rem;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

.loading-progress circle:last-child {
    stroke: var(--ember);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
}

.loading-progress-text {
    font-size: 0.8rem;
    font-weight: 750;
    inset: calc(22vh + 7.6rem) 0 auto;
    letter-spacing: 0.08em;
    position: absolute;
    text-align: center;
    text-transform: uppercase;
}

.loading-progress-text::after {
    content: "Preparando operação";
}

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

.access-card {
    max-width: 470px;
    width: 100%;
}

.access-card--wide { max-width: 650px; }

.access-card h1 {
    font-size: clamp(2.35rem, 5vw, 4rem);
    line-height: 0.95;
    margin-bottom: 1rem;
}

.access-lead {
    color: var(--muted);
    margin-bottom: 2rem;
    max-width: 590px;
}

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

.field {
    color: var(--steel);
    display: flex;
    flex-direction: column;
    font-size: 0.72rem;
    font-weight: 760;
    gap: 0.45rem;
    letter-spacing: 0.045em;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.field input {
    background: var(--white);
    border: 1px solid #cbd6d1;
    border-radius: 6px;
    color: var(--charcoal);
    font-size: 1rem;
    min-height: 50px;
    padding: 0.72rem 0.8rem;
    text-transform: none;
}

.field input:focus { border-color: var(--conference); }

.field small,
.field-hint {
    color: var(--muted);
    font-size: 0.67rem;
    font-weight: 550;
    letter-spacing: 0;
    margin-top: 0.15rem;
    text-transform: none;
}

.field small code {
    background: var(--ice);
    padding: 0.1rem 0.25rem;
}

.field-hint { margin: -0.2rem 0 1rem; }

.check-field {
    align-items: center;
    color: var(--muted);
    cursor: pointer;
    display: flex;
    font-size: 0.76rem;
    gap: 0.6rem;
    margin: 0.2rem 0 1.2rem;
    min-height: 44px;
}

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

.access-submit {
    min-height: 50px;
    width: 100%;
}

.access-message {
    background: #e8f1eb;
    border-left: 3px solid var(--success);
    color: #315844;
    font-size: 0.78rem;
    margin: 0 0 1rem;
    padding: 0.8rem 0.9rem;
}

.access-message--error {
    background: #f8e7e4;
    border-left-color: var(--danger);
    color: #7d3029;
}

.access-links {
    border-top: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    font-size: 0.74rem;
    gap: 0.55rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
}

.access-links a {
    color: var(--conference);
    font-weight: 750;
    width: fit-content;
}

.access-links span { color: var(--muted); }

.recovery-code {
    background: var(--charcoal);
    color: white;
    font-family: var(--font-data);
    font-size: clamp(0.82rem, 2.8vw, 1.25rem);
    font-weight: 750;
    letter-spacing: 0.035em;
    margin: 1.5rem 0 1rem;
    overflow-wrap: anywhere;
    padding: 1.2rem;
    text-align: center;
}

@media (max-width: 560px) {
    .access-grid { grid-template-columns: 1fr; gap: 0; }
    .access-card h1 { font-size: 2.55rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }

    .loader { animation-duration: 1.8s; }
}
