@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700;800&family=Roboto:wght@400;500;700&display=swap");

:root {
    --font-sans: "DM Sans", "Segoe UI", system-ui, sans-serif;
    --font-metric: "Roboto", "Segoe UI", Arial, sans-serif;
    --font-mono: var(--font-metric);
    --ap-font-sans: var(--font-sans);
    --ap-font-mono: var(--font-metric);
    --ap-bg: #f4f6f0;
    --ap-surface: #fbfbf7;
    --ap-sidebar: #edf2ea;
    --ap-card: #fffefa;
    --ap-accent: #dfeadf;
    --ap-primary: #2f684f;
    --ap-primary-hover: #25563f;
    --ap-text: #10231d;
    --ap-muted: #60736a;
    --ap-muted-light: #93a099;
    --ap-border: #d6ddd2;
    --ap-border-strong: #c6d1c2;
    --ap-success: #3d7354;
    --ap-success-bg: #e7f1e8;
    --ap-error: #b65b4e;
    --ap-error-bg: #f7e7e2;
    --ap-warning: #8a6f2e;
    --ap-warning-bg: #f4ecd8;
    --ap-paused: #3e6f92;
    --ap-paused-bg: #e4edf4;
    --ap-shadow-soft: 0 1px 1px rgba(26, 44, 35, 0.04);
    --ap-shadow-card: 0 14px 28px rgba(33, 54, 42, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    color-scheme: light;
    background: var(--ap-bg);
}

body {
    margin: 0;
    background: var(--ap-bg);
    color: var(--ap-text);
    font-family: var(--ap-font-sans);
    letter-spacing: 0;
}

h1:focus {
    outline: none;
}

a {
    color: var(--ap-primary);
}

button,
input,
select {
    font: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--ap-primary) 32%, transparent);
    outline-offset: 2px;
}

.font-mono,
.metric-mono {
    font-family: var(--ap-font-mono);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 8px 13px;
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.button-primary {
    background: var(--ap-primary);
    color: #ffffff;
}

.button-primary:hover:not(:disabled) {
    background: var(--ap-primary-hover);
}

.button-secondary {
    border-color: var(--ap-border);
    background: var(--ap-surface);
    color: var(--ap-text);
}

.button-danger {
    border-color: color-mix(in srgb, var(--ap-error) 45%, var(--ap-border));
    background: var(--ap-error-bg);
    color: var(--ap-error);
}

.icon-button {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--ap-border);
    border-radius: 9px;
    background: var(--ap-card);
    color: var(--ap-primary);
    cursor: pointer;
}

.language-selector {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ap-muted);
    font-size: 14px;
    font-weight: 800;
}

.language-selector select,
.language-selector__button {
    min-height: 40px;
    border: 1px solid var(--ap-border);
    border-radius: 8px;
    padding: 8px 11px;
    background: var(--ap-surface);
    color: var(--ap-text);
    font: inherit;
}

.language-selector__button {
    background: var(--ap-primary);
    color: #ffffff;
    cursor: pointer;
}

.message {
    margin: 0 0 16px;
    border-radius: 8px;
    padding: 12px 14px;
    font-weight: 700;
}

.message-error {
    border: 1px solid color-mix(in srgb, var(--ap-error) 35%, var(--ap-border));
    background: var(--ap-error-bg);
    color: var(--ap-error);
}

.message-success {
    border: 1px solid color-mix(in srgb, var(--ap-success) 30%, var(--ap-border));
    background: var(--ap-success-bg);
    color: var(--ap-success);
}

.auth-page {
    display: grid;
    grid-template-columns: minmax(340px, 1fr) minmax(360px, 1fr);
    min-height: 100vh;
    padding: 12px;
    background: var(--ap-bg);
    color: var(--ap-text);
}

.auth-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 24px);
    border-radius: 12px 0 0 12px;
    padding: 42px;
    overflow: hidden;
    background: linear-gradient(145deg, var(--ap-primary), #427d64);
    color: #f8fbf6;
}

.auth-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(color-mix(in srgb, #ffffff 7%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, #ffffff 7%, transparent) 1px, transparent 1px);
    background-size: 28px 28px;
    opacity: 0.28;
}

.auth-hero > * {
    position: relative;
    z-index: 1;
}

.auth-hero__brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    width: fit-content;
    color: #ffffff;
    text-decoration: none;
}

.auth-hero__mark {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: color-mix(in srgb, #ffffff 16%, transparent);
    font-size: 22px;
}

.auth-hero__brand strong {
    display: block;
    font-size: 18px;
}

.auth-hero__brand small {
    display: block;
    margin-top: 3px;
    color: color-mix(in srgb, #ffffff 78%, transparent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.auth-hero__content {
    display: grid;
    gap: 26px;
    margin: auto 0;
    max-width: 560px;
}

.auth-hero__content h1 {
    max-width: 520px;
    margin: 0;
    color: #ffffff;
    font-size: clamp(40px, 5vw, 62px);
    line-height: 0.98;
}

.auth-hero__content p {
    max-width: 540px;
    margin: 0;
    color: color-mix(in srgb, #ffffff 82%, transparent);
    font-size: 17px;
    line-height: 1.65;
}

.auth-hero__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}

.auth-hero__stats span {
    display: grid;
    gap: 3px;
    min-width: 108px;
    border-right: 1px solid color-mix(in srgb, #ffffff 24%, transparent);
    padding-right: 24px;
    margin-right: 24px;
    color: color-mix(in srgb, #ffffff 75%, transparent);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.auth-hero__stats span:last-child {
    border-right: 0;
    margin-right: 0;
    padding-right: 0;
}

.auth-hero__stats strong {
    color: #ffffff;
    font-family: var(--ap-font-mono);
    font-size: 24px;
    line-height: 1;
    text-transform: none;
}

.auth-hero__footer {
    margin: 0;
    color: color-mix(in srgb, #ffffff 72%, transparent);
    font-size: 13px;
}

.auth-panel {
    display: grid;
    align-content: center;
    justify-self: center;
    width: min(100%, 430px);
    padding: 42px 24px;
}

.auth-tabs {
    display: inline-flex;
    width: fit-content;
    margin-bottom: 34px;
    border-radius: 999px;
    padding: 4px;
    background: color-mix(in srgb, var(--ap-accent) 60%, transparent);
}

.auth-tab {
    min-width: 86px;
    border-radius: 999px;
    padding: 8px 15px;
    color: var(--ap-muted);
    font-size: 14px;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
}

.auth-tab--active {
    background: var(--ap-primary);
    color: #ffffff;
}

.auth-panel h1 {
    margin: 0 0 8px;
    color: var(--ap-text);
    font-size: 32px;
    line-height: 1.1;
}

.auth-panel__subtitle {
    margin: 0 0 34px;
    color: var(--ap-muted);
    font-size: 15px;
}

.auth-form {
    display: grid;
    gap: 18px;
}

.auth-form label {
    display: grid;
    gap: 8px;
    color: var(--ap-muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.auth-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.auth-label-row a {
    color: var(--ap-primary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: none;
    text-decoration: none;
}

.auth-input-shell {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    min-height: 46px;
    border: 1px solid var(--ap-border);
    border-radius: 8px;
    padding: 0 12px;
    background: var(--ap-surface);
    color: var(--ap-muted);
}

.auth-input-shell input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ap-text);
    font: inherit;
}

.auth-input-shell input::placeholder {
    color: var(--ap-muted);
}

.auth-checkbox {
    display: inline-flex !important;
    grid-template-columns: none !important;
    align-items: center;
    gap: 9px !important;
    color: var(--ap-muted) !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
}

.auth-checkbox input {
    width: 17px;
    height: 17px;
    accent-color: var(--ap-primary);
}

.auth-submit {
    min-height: 46px;
    gap: 8px;
}

.auth-panel__link {
    margin: 30px 0 0;
    color: var(--ap-muted);
    font-size: 14px;
    text-align: center;
}

.auth-panel__link a {
    color: var(--ap-primary);
    font-weight: 800;
    text-decoration: none;
}

.status-dot {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    border: 0;
    background: transparent;
    color: var(--ap-border-strong);
}

.status-dot::before,
.status-dot::after {
    content: "";
    position: absolute;
    border-radius: 999px;
}

.status-dot::before {
    width: 10px;
    height: 10px;
    background: currentColor;
    box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 18%, transparent);
}

.status-dot::after {
    inset: 0;
    border: 2px solid currentColor;
    opacity: 0.46;
    animation: status-pulse 1.8s ease-out infinite;
}

.status-dot--online {
    color: var(--ap-success);
}

.status-dot--down {
    color: var(--ap-error);
}

.status-dot--paused,
.status-dot--inactive {
    color: var(--ap-paused);
}

.status-dot--unknown {
    color: var(--ap-border-strong);
}

.status-dot--unknown::after {
    animation: none;
}

@keyframes status-pulse {
    0% {
        opacity: 0.42;
        transform: scale(0.82);
    }

    70% {
        opacity: 0;
        transform: scale(2.05);
    }

    100% {
        opacity: 0;
        transform: scale(2.05);
    }
}

.status-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 28px;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 800;
}

.status-badge--online {
    background: var(--ap-success-bg);
    color: var(--ap-success);
}

.status-badge--down {
    background: var(--ap-error-bg);
    color: var(--ap-error);
}

.status-badge--paused {
    background: var(--ap-paused-bg);
    color: var(--ap-paused);
}

.status-badge--unknown,
.status-badge--inactive {
    background: #eef1ea;
    color: var(--ap-muted);
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--ap-success);
}

.invalid {
    outline: 1px solid var(--ap-error);
}

.validation-message {
    color: var(--ap-error);
}

.blazor-error-boundary {
    background: #b32121;
    color: white;
    padding: 1rem;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

@media (max-width: 900px) {
    .auth-page {
        grid-template-columns: 1fr;
    }

    .auth-hero {
        min-height: auto;
        border-radius: 12px;
        padding: 28px;
    }

    .auth-hero__content {
        margin: 46px 0;
    }
}

@media (max-width: 620px) {
    .auth-page {
        padding: 0;
    }

    .auth-hero {
        display: none;
    }

    .auth-panel {
        min-height: 100vh;
        padding: 32px 20px;
    }
}

.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;
}
