@font-face {
    font-family: "Manrope";
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url("fonts/Manrope-VariableFont_wght.ttf") format("truetype");
}

:root {
    color-scheme: light;
    color: #172536;
    background: #f3f7fb;
    font-family: "Manrope", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 100%;
    font-synthesis: none;
    --background-canvas: #f3f7fb;
    --background-surface: #ffffff;
    --background-surface-secondary: #e8f0f8;
    --border-default: #d4dfea;
    --border-strong: #9fb0c2;
    --brand-active: #162d49;
    --brand-hover: #1d395b;
    --brand-primary: #24466f;
    --danger-background: #fbe9e8;
    --danger-border: #b23a35;
    --danger-foreground: #8c2f2b;
    --focus: #315f91;
    --foreground-primary: #172536;
    --foreground-secondary: #526579;
    --success-background: #e7f4ec;
    --success-foreground: #23613a;
    --font-size-section: 1.5rem;
    --line-height-section: 2rem;
    --font-size-subtitle: 1.25rem;
    --line-height-subtitle: 1.75rem;
    --font-size-body: 1rem;
    --line-height-body: 1.5rem;
    --font-size-small: 0.875rem;
    --line-height-small: 1.25rem;
    --font-size-auxiliary: 0.75rem;
    --line-height-auxiliary: 1rem;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    min-height: 100%;
    background: var(--background-canvas);
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    background: var(--background-canvas);
    color: var(--foreground-primary);
}

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

a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
    border-color: var(--focus);
    outline: 2px solid transparent;
    box-shadow: 0 0 0 2px var(--focus);
}

.skip-link {
    position: fixed;
    z-index: 20;
    top: 12px;
    left: 12px;
    padding: 8px 12px;
    border-radius: 4px;
    background: var(--foreground-primary);
    color: #ffffff;
    transform: translateY(-180%);
}

.skip-link:focus {
    transform: translateY(0);
}

.identity-shell {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

.identity-stage {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    padding: 32px 16px 24px;
}

.identity-surface {
    width: min(100%, 400px);
    padding: 30px;
    border: 1px solid var(--border-default);
    border-radius: 10px;
    background: var(--background-surface);
    box-shadow: 0 4px 12px rgb(13 24 38 / 12%);
}

.identity-main,
.identity-card {
    width: 100%;
}

.identity-card {
    padding: 0;
    border: 0;
    background: transparent;
}

.eyebrow {
    margin-bottom: 8px;
    color: var(--brand-primary);
    font-size: var(--font-size-auxiliary);
    font-weight: 500;
    line-height: var(--line-height-auxiliary);
    text-align: center;
    text-transform: uppercase;
}

h1,
h2,
p {
    overflow-wrap: anywhere;
}

h1,
h2 {
    color: var(--foreground-primary);
    font-weight: 500;
}

h1 {
    margin: 0;
    font-size: var(--font-size-section);
    line-height: var(--line-height-section);
    text-align: center;
}

.identity-main h1:focus {
    outline: none;
    box-shadow: none;
}

h2 {
    margin: 24px 0 8px;
    font-size: var(--font-size-subtitle);
    line-height: var(--line-height-subtitle);
}

.lead {
    margin: 8px 0 0;
    color: var(--foreground-secondary);
    font-size: var(--font-size-body);
    line-height: var(--line-height-body);
}

.auth-introduction {
    margin: 0;
    color: var(--foreground-secondary);
    font-family: "Manrope", ui-sans-serif, system-ui, sans-serif;
    font-size: var(--font-size-body);
    font-weight: 400;
    line-height: var(--line-height-body);
}

.action-stack {
    display: flex;
    margin-top: 24px;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.button {
    display: inline-flex;
    min-width: 140px;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid transparent;
    border-radius: 4px;
    align-items: center;
    justify-content: center;
    font: inherit;
    font-weight: 500;
    line-height: var(--line-height-body);
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 120ms cubic-bezier(.2, 0, 0, 1),
                border-color 120ms cubic-bezier(.2, 0, 0, 1),
                color 120ms cubic-bezier(.2, 0, 0, 1);
}

form > .button {
    display: flex;
    margin: 24px auto 0;
}

.button--primary {
    border-color: var(--brand-primary);
    background: var(--brand-primary);
    color: #ffffff;
}

.button--primary:hover {
    border-color: var(--brand-hover);
    background: var(--brand-hover);
}

.button--primary:active {
    border-color: var(--brand-active);
    background: var(--brand-active);
}

.button--secondary {
    border-color: var(--border-strong);
    background: var(--background-surface);
    color: var(--brand-primary);
}

.button--secondary:hover {
    border-color: var(--brand-primary);
    background: var(--background-surface-secondary);
}

.button:disabled {
    cursor: not-allowed;
}

.text-link {
    display: inline-block;
    margin-top: 16px;
    font-weight: 500;
    text-underline-offset: 3px;
}

.privacy-note {
    margin: 24px 0 0;
    color: var(--foreground-secondary);
    font-size: var(--font-size-auxiliary);
    line-height: var(--line-height-auxiliary);
    text-align: center;
}

.notice {
    display: grid;
    margin-top: 24px;
    padding: 16px;
    border: 1px solid var(--border-default);
    border-radius: 4px;
    grid-template-columns: auto 1fr;
    gap: 12px;
    background: var(--background-surface-secondary);
}

.notice--error {
    border-color: var(--danger-border);
    background: var(--danger-background);
}

.notice-icon {
    display: grid;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    place-items: center;
    background: var(--brand-primary);
    color: #ffffff;
    font-size: var(--font-size-auxiliary);
    font-weight: 500;
}

.notice--error .notice-icon {
    background: var(--danger-border);
}

.notice strong {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
}

.notice p {
    margin: 0;
    color: var(--foreground-secondary);
    font-size: var(--font-size-small);
    line-height: var(--line-height-small);
}

form {
    margin-top: 24px;
}

.field {
    margin-bottom: 16px;
}

label,
.setup-key-block > span {
    display: block;
    margin-bottom: 8px;
    color: var(--foreground-primary);
    font-size: var(--font-size-small);
    font-weight: 500;
    line-height: var(--line-height-small);
}

input {
    width: 100%;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    background: var(--background-surface);
    color: var(--foreground-primary);
    font: inherit;
}

.login-form {
    margin-top: 28px;
}

.floating-field {
    position: relative;
    margin-bottom: 20px;
}

.floating-field input {
    min-height: 52px;
    padding: 17px 12px 7px;
    transition: border-color 160ms cubic-bezier(.2, 0, 0, 1),
                box-shadow 160ms cubic-bezier(.2, 0, 0, 1);
}

.validation-field input {
    padding-right: 44px;
}

.floating-field.validation-field--invalid input,
.floating-field.validation-field--invalid input:focus {
    border-color: var(--danger-border);
    color: var(--danger-foreground);
    box-shadow: 0 0 0 2px rgb(178 58 53 / 16%);
}

.floating-field.validation-field--invalid input + label,
.floating-field.validation-field--invalid input:focus + label,
.floating-field.validation-field--invalid input:not(:placeholder-shown) + label {
    color: var(--danger-foreground);
}

.field-error-indicator {
    position: absolute;
    z-index: 2;
    top: 16px;
    right: 12px;
    display: inline-flex;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--danger-border);
    cursor: pointer;
}

.field-error-indicator svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.field-error-popover {
    position: absolute;
    z-index: 10;
    top: calc(100% + 4px);
    right: 0;
    max-width: min(100%, 320px);
    padding: 8px 12px;
    border: 1px solid var(--danger-border);
    border-radius: 4px;
    background: var(--danger-background);
    box-shadow: 0 4px 12px rgb(13 24 38 / 12%);
    color: var(--danger-foreground);
    font-size: var(--font-size-small);
    line-height: var(--line-height-small);
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.floating-field label {
    position: absolute;
    top: 15px;
    left: 9px;
    margin: 0;
    padding: 0 4px;
    background: var(--background-surface);
    color: var(--foreground-secondary);
    font-size: var(--font-size-body);
    font-weight: 400;
    line-height: var(--line-height-body);
    pointer-events: none;
    transform-origin: left top;
    transition: color 160ms cubic-bezier(.2, 0, 0, 1),
                font-size 160ms cubic-bezier(.2, 0, 0, 1),
                top 160ms cubic-bezier(.2, 0, 0, 1);
}

.floating-field input:focus {
    border-color: var(--brand-primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(36, 70, 111, 0.18);
}

.floating-field input:focus + label,
.floating-field input:not(:placeholder-shown) + label {
    top: -8px;
    color: var(--brand-primary);
    font-size: var(--font-size-auxiliary);
    line-height: var(--line-height-auxiliary);
}

.login-form > .button {
    display: flex;
    margin: 24px auto 0;
    width: 100%;
}

.capability-note {
    margin: 12px 0 0;
    color: var(--foreground-secondary);
    font-size: var(--font-size-auxiliary);
    line-height: var(--line-height-auxiliary);
    text-align: center;
}

.auxiliary-links {
    display: flex;
    margin-top: 20px;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 18px;
}

.auxiliary-links a {
    color: var(--foreground-secondary);
    font-size: var(--font-size-small);
    line-height: var(--line-height-small);
    text-underline-offset: 3px;
}

.auxiliary-links a:hover {
    color: var(--brand-primary);
}

.field-help {
    margin: 8px 0 0;
    color: var(--foreground-secondary);
    font-size: var(--font-size-auxiliary);
    line-height: var(--line-height-auxiliary);
}

.validation-message,
.form-error {
    color: var(--danger-foreground);
    font-size: var(--font-size-small);
    line-height: var(--line-height-small);
}

.form-error {
    margin: 12px 0 0;
}

.setup-key-block {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid var(--border-default);
    border-radius: 4px;
    background: var(--background-surface-secondary);
}

.setup-key-block code {
    color: var(--foreground-primary);
    font-size: var(--font-size-small);
    overflow-wrap: anywhere;
}

.loading-row {
    display: flex;
    margin-top: 24px;
    align-items: center;
    gap: 12px;
    color: var(--foreground-secondary);
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-default);
    border-top-color: var(--brand-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.success-mark {
    display: grid;
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    border-radius: 50%;
    place-items: center;
    background: var(--success-background);
    color: var(--success-foreground);
    font-size: var(--font-size-section);
    font-weight: 500;
}

.site-footer {
    padding: 0 16px 20px;
    color: var(--foreground-secondary);
    font-size: var(--font-size-auxiliary);
    line-height: var(--line-height-auxiliary);
    text-align: center;
}

.site-footer p {
    margin: 0 0 4px;
}

.footer-brand-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.footer-brand-logo {
    display: block;
    width: 120px;
    height: auto;
}

.language-switcher {
    display: flex;
    margin-top: 4px;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.language-switcher a {
    padding: 4px;
    color: var(--foreground-secondary);
    font-weight: 500;
    text-decoration: none;
}

.language-switcher a:hover {
    color: var(--brand-primary);
    text-decoration: underline;
}

.blazor-error-boundary {
    margin: 16px;
    padding: 16px;
    border-radius: 4px;
    background: var(--danger-foreground);
    color: #ffffff;
}

.blazor-error-boundary::after {
    content: "La conexión se ha interrumpido.";
}

.logo-test-shell {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

.logo-test-main {
    width: min(calc(100% - 32px), 1280px);
    margin: 32px auto 24px;
    padding: 32px;
    border: 1px solid var(--border-default);
    border-radius: 10px;
    background: var(--background-surface);
    box-shadow: 0 4px 12px rgb(13 24 38 / 12%);
}

.logo-test-page > .lead {
    max-width: 720px;
    margin-right: auto;
    margin-left: auto;
    text-align: center;
}

.logo-test-section {
    margin-top: 40px;
    padding-top: 8px;
    border-top: 1px solid var(--border-default);
}

.logo-test-description {
    margin: 0 0 16px;
    color: var(--foreground-secondary);
    font-size: var(--font-size-small);
    line-height: var(--line-height-small);
}

.logo-test-size-row {
    display: grid;
    padding: 16px 0;
    border-top: 1px solid var(--border-default);
    grid-template-columns: 72px minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: 16px;
}

.logo-test-size-row h3 {
    margin: 38px 0 0;
    color: var(--foreground-secondary);
    font-size: var(--font-size-small);
    font-weight: 500;
    line-height: var(--line-height-small);
}

.logo-test-sample {
    min-width: 0;
    margin: 0;
}

.logo-test-canvas {
    display: flex;
    min-height: 96px;
    padding: 12px;
    border: 1px solid var(--border-default);
    border-radius: 4px;
    align-items: center;
    justify-content: center;
    overflow-x: auto;
    background: var(--background-surface);
    color: #000000;
}

.logo-test-canvas--dark {
    border-color: var(--brand-active);
    background: var(--brand-primary);
    color: #ffffff;
}

.logo-test-image,
.logo-test-render {
    display: block;
    max-width: none;
    height: auto;
    flex: 0 0 auto;
}

.logo-test-render__path {
    fill: currentColor;
    stroke: currentColor;
    stroke-linecap: butt;
    stroke-linejoin: miter;
}

.logo-test-render--fill .logo-test-render__path {
    stroke: none;
}

.logo-test-render--proportional-four .logo-test-render__path {
    stroke-width: 4;
}

.logo-test-render--proportional-six .logo-test-render__path {
    stroke-width: 6;
}

.logo-test-render--fixed-one .logo-test-render__path {
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}

.logo-test-sample figcaption {
    margin-top: 4px;
    color: var(--foreground-secondary);
    font-size: var(--font-size-auxiliary);
    line-height: var(--line-height-auxiliary);
    text-align: center;
}

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

@media (max-width: 479px) {
    .identity-stage {
        align-items: flex-start;
        padding: 16px;
    }

    .identity-surface {
        padding: 24px 16px;
    }

    .logo-test-main {
        width: calc(100% - 32px);
        margin-top: 16px;
        padding: 24px 16px;
    }

    .logo-test-size-row {
        grid-template-columns: 1fr;
    }

    .logo-test-size-row h3 {
        margin-top: 0;
    }
}

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