/* Reset and base styles are in design-system.css */

a, .btn-link {
    color: var(--color-primary);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.15rem rgba(139, 92, 246, 0.4);
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--color-success);
}

.invalid {
    outline: 1px solid var(--color-error);
}

.validation-message {
    color: var(--color-error);
}

/* Blazor error UI - hidden by default, only shown when error occurs */
#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--color-surface-dark, #1a1a2e);
    color: var(--color-text-light, #e2e8f0);
    padding: 1rem;
    box-shadow: 0 -1px 5px rgba(0, 0, 0, 0.3);
}

    #blazor-error-ui .reload,
    #blazor-error-ui .dismiss {
        cursor: pointer;
        margin-left: 1rem;
        text-decoration: underline;
    }

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

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

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.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;
}

/* ============================================================
   Blazor Circuit Reconnect Overlay
   ============================================================ */

/* --- Keyframes --- */

/* Wave: sequential opacity fade on individual logo rects */
@keyframes rcr-wave {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.08; }
}

/* Breathe: scale + opacity pulse on whole logo */
@keyframes rcr-breathe {
    0%, 100% { opacity: 1;    transform: scale(1); }
    50%       { opacity: 0.45; transform: scale(0.82); }
}

/* Spin: full rotation */
@keyframes rcr-spin {
    to { transform: rotate(360deg); }
}

/* Drift: each rect drifts apart then returns */
@keyframes rcr-drift-a {
    0%, 100% { transform: translate(0, 0); }
    40%       { transform: translate(7px, -9px); }
}
@keyframes rcr-drift-b {
    0%, 100% { transform: translate(0, 0); }
    40%       { transform: translate(-9px, 7px); }
}
@keyframes rcr-drift-c {
    0%, 100% { transform: translate(0, 0); }
    40%       { transform: translate(5px, 8px); }
}

/* Animated dots suffix */
/* --- Base overlay --- */
#components-reconnect-modal,
.reconnect-preview {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.92);
    align-items: center;
    justify-content: center;
}

/* Blazor state classes */
#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    display: flex;
}

/* Showcase preview states — positioned inline, not fixed */
.reconnect-preview.state-reconnecting,
.reconnect-preview.state-failed,
.reconnect-preview.state-rejected {
    display: flex;
    position: relative;
    inset: unset;
    z-index: auto;
    min-height: 280px;
    border-radius: var(--radius-xl);
}

/* --- Inner content --- */
.reconnect-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-5);
    text-align: center;
    padding: var(--spacing-8);
}

/* --- Logo --- */
.reconnect-logo-wrap {
    width: 72px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reconnect-logo {
    width: 72px;
    height: auto;
    display: block;
    transform-origin: center center;
}

/* --- Text labels --- */
.reconnect-label {
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text-light);
    margin: 0;
    display: none;
}

.reconnect-action {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    font-weight: 400;
}

.reconnect-action a {
    color: var(--color-primary);
    text-decoration: underline;
    cursor: pointer;
}

.reconnect-action a:hover {
    color: var(--color-primary-light);
}

/* --- Show correct message per state --- */

#components-reconnect-modal.components-reconnect-show .reconnect-msg-reconnecting,
.reconnect-preview.state-reconnecting .reconnect-msg-reconnecting {
    display: block;
}

#components-reconnect-modal.components-reconnect-failed .reconnect-msg-failed,
.reconnect-preview.state-failed .reconnect-msg-failed {
    display: block;
}

#components-reconnect-modal.components-reconnect-rejected .reconnect-msg-rejected,
.reconnect-preview.state-rejected .reconnect-msg-rejected {
    display: block;
}

/* --- Animation variants --- */

/* Wave — reconnecting state */
#components-reconnect-modal.components-reconnect-show .rcr-a,
.anim-wave .rcr-a {
    animation: rcr-wave 1.8s ease-in-out 0s infinite;
}
#components-reconnect-modal.components-reconnect-show .rcr-b,
.anim-wave .rcr-b {
    animation: rcr-wave 1.8s ease-in-out 0.6s infinite;
}
#components-reconnect-modal.components-reconnect-show .rcr-c,
.anim-wave .rcr-c {
    animation: rcr-wave 1.8s ease-in-out 1.2s infinite;
}

/* Breathe — disconnected and session expired states */
#components-reconnect-modal.components-reconnect-failed .reconnect-logo,
#components-reconnect-modal.components-reconnect-rejected .reconnect-logo,
.anim-breathe .reconnect-logo {
    animation: rcr-breathe 2.5s ease-in-out infinite;
}

/* Spin */
.anim-spin .reconnect-logo {
    animation: rcr-spin 3s linear infinite;
}

/* Drift */
.anim-drift .rcr-a {
    animation: rcr-drift-a 2.5s ease-in-out 0s infinite;
}
.anim-drift .rcr-b {
    animation: rcr-drift-b 2.5s ease-in-out 0.4s infinite;
}
.anim-drift .rcr-c {
    animation: rcr-drift-c 2.5s ease-in-out 0.8s infinite;
}
