.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

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

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

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

/* Loading screen (index.html): same colours as the iOS splash image, a cup that fills with the download progress. */
.dialed-loading {
    --loading-bg: #f4ece0;
    --loading-ink: #6f4e37;
    --loading-track: rgba(111, 78, 55, 0.18);
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    background: var(--loading-bg);
    color: var(--loading-ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
    .dialed-loading {
        --loading-bg: #1e1713;
        --loading-ink: #d2a77f;
        --loading-track: rgba(210, 167, 127, 0.2);
    }
}

.dialed-loading-brewer {
    position: relative;
    width: 9rem;
    height: 13rem;
}

.dialed-loading-brewer svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    fill: none;
    stroke: var(--loading-ink);
    stroke-width: 0.3rem;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dialed-loading-kettle {
    stroke-width: 0.22rem;
    transform-box: view-box;
    transform-origin: 30px 20px;
}

.dialed-loading-kettle-body {
    fill: var(--loading-bg);
}

.dialed-loading-cone {
    fill: var(--loading-track);
}

.dialed-loading-stream {
    stroke-width: 0.25rem;
    stroke-dasharray: 0.5rem 0.4rem;
    animation: dialed-loading-pour 0.5s linear infinite;
}

/* The coffee in the cone: the same shape as the outline, filling from the bottom with the download progress. */
.dialed-loading-cone-fill {
    position: absolute;
    left: 1.5rem;
    top: 4.4rem;
    width: 6rem;
    height: 4.2rem;
    clip-path: polygon(0 0, 100% 0, 63.3% 100%, 36.7% 100%);
}

.dialed-loading-water {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--loading-ink);
    opacity: 0.45;
}

.dialed-loading-cup-fill {
    position: absolute;
    left: 2.8rem;
    top: 10rem;
    width: 3.4rem;
    height: 2.6rem;
    overflow: hidden;
    border-radius: 0 0 1.2rem 1.2rem;
}

.dialed-loading-fill {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--blazor-load-percentage, 0%);
    background: var(--loading-ink);
    transition: height 1.2s cubic-bezier(0.3, 0.6, 0.3, 1);
}

@keyframes dialed-loading-pour {
    to { stroke-dashoffset: -0.9rem; }
}

/* The brew follows the real download: js/loading.js sets data-stage on .dialed-loading from the progress
   (bloom, rest1, pour1, rest2, pour2, done). Each stage sets how far the kettle tilts, whether it pours and how high the water stands. */
/* --sway and --rock are how far the pouring kettle drifts sideways and rocks, so the stream lands in different places like a real
   pour. They are registered properties so that they ease to 0 when the kettle rests instead of jumping. */
@property --sway {
    syntax: '<length>';
    inherits: true;
    initial-value: 0px;
}

@property --rock {
    syntax: '<angle>';
    inherits: true;
    initial-value: 0deg;
}

.dialed-loading {
    --kettle-tilt: 12deg;
    --pouring: 1;
    --water: 24%;
    --drip: 1;
    --sway: 4px;
    --rock: 1.5deg;
    /* The stream starts once the kettle has tilted, and the water rises once the stream has reached it. */
    --stream-delay: 0.6s;
    --water-delay: 1.3s;
}

.dialed-loading[data-stage="rest1"] { --kettle-tilt: 0deg; --pouring: 0; --stream-delay: 0s; --water-delay: 0s; --water: 16%; --sway: 0px; --rock: 0deg; }
.dialed-loading[data-stage="pour1"] { --kettle-tilt: 16deg; --pouring: 1; --water: 58%; --sway: 7px; --rock: 2deg; }
.dialed-loading[data-stage="rest2"] { --kettle-tilt: 0deg; --pouring: 0; --stream-delay: 0s; --water-delay: 0s; --water: 42%; --sway: 0px; --rock: 0deg; }
.dialed-loading[data-stage="pour2"] { --kettle-tilt: 16deg; --pouring: 1; --water: 86%; --sway: 7px; --rock: 2deg; }
.dialed-loading[data-stage="done"] { --kettle-tilt: 0deg; --pouring: 0; --stream-delay: 0s; --water-delay: 0s; --water: 0%; --drip: 0; --sway: 0px; --rock: 0deg; }

.dialed-loading-pourer {
    transform-box: view-box;
    transform-origin: 30px 20px;
}

.dialed-loading-kettle {
    transform: translate(-12px, -8px) rotate(var(--kettle-tilt));
}

.dialed-loading-stream {
    opacity: var(--drip);
}

/* The stream grows out of the spout instead of just appearing. */
.dialed-loading-stream-kettle {
    opacity: var(--pouring);
    transform: scaleY(var(--pouring));
    transform-box: view-box;
    transform-origin: 50px 19px;
}

.dialed-loading-water {
    height: var(--water);
}

@media (prefers-reduced-motion: no-preference) {
    .dialed-loading {
        transition: --sway 1.4s ease-in-out, --rock 1.4s ease-in-out;
    }

    /* The kettle and its stream drift left and right and rock a little while pouring. */
    .dialed-loading-pourer {
        animation: dialed-loading-sway 3.4s ease-in-out infinite alternate;
    }

    .dialed-loading-kettle {
        transition: transform 1.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .dialed-loading-stream {
        transition: opacity 0.5s ease;
    }

    /* Starts after the kettle has tilted, stops at once. */
    .dialed-loading-stream-kettle {
        transition: opacity 0.5s ease var(--stream-delay), transform 0.7s cubic-bezier(0.3, 0, 0.2, 1) var(--stream-delay);
    }

    /* The water rises a moment after a pour starts, while the stream travels down to it; it drops at once when the pour stops. */
    .dialed-loading-water {
        transition: height 1.1s ease-in-out var(--water-delay);
    }
}

@keyframes dialed-loading-sway {
    from { transform: translateX(calc(var(--sway) * -1)) rotate(calc(var(--rock) * -1)); }
    to { transform: translateX(var(--sway)) rotate(var(--rock)); }
}

.dialed-loading-name {
    display: grid;
    justify-items: center;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

/* "Bloom", "Pour" and "Dialed" sit in the same spot: Bloom for the bloom and its rest, Pour for the pours, Dialed at the end. */
.dialed-loading-bloom,
.dialed-loading-pour-word,
.dialed-loading-dialed {
    grid-area: 1 / 1;
    white-space: nowrap;
}

.dialed-loading-pour-word,
.dialed-loading-dialed {
    opacity: 0;
}

.dialed-loading[data-stage="pour1"] .dialed-loading-bloom,
.dialed-loading[data-stage="rest2"] .dialed-loading-bloom,
.dialed-loading[data-stage="pour2"] .dialed-loading-bloom,
.dialed-loading[data-stage="done"] .dialed-loading-bloom {
    opacity: 0;
}

.dialed-loading[data-stage="pour1"] .dialed-loading-pour-word,
.dialed-loading[data-stage="rest2"] .dialed-loading-pour-word,
.dialed-loading[data-stage="pour2"] .dialed-loading-pour-word {
    opacity: 1;
}

.dialed-loading[data-stage="done"] .dialed-loading-dialed {
    opacity: 1;
}

@media (prefers-reduced-motion: no-preference) {
    .dialed-loading-bloom,
    .dialed-loading-pour-word,
    .dialed-loading-dialed {
        transition: opacity 0.4s ease;
    }

    /* "Dialed" settles into place with a little overshoot, and the cup gives a small hop. */
    .dialed-loading[data-stage="done"] .dialed-loading-dialed {
        animation: dialed-loading-settle 0.6s cubic-bezier(0.2, 1.4, 0.4, 1) both;
    }

    .dialed-loading[data-stage="done"] .dialed-loading-brewer {
        animation: dialed-loading-cheer 0.6s ease-out;
    }
}

@keyframes dialed-loading-settle {
    from { opacity: 0; transform: translateY(0.6rem) scale(0.85); }
    to { opacity: 1; transform: none; }
}

@keyframes dialed-loading-cheer {
    0%, 100% { transform: none; }
    40% { transform: translateY(-0.4rem); }
}

.dialed-loading-percent {
    min-height: 1.25rem;
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
    opacity: 0.75;
}

.dialed-loading-percent::after {
    content: var(--blazor-load-percentage-text, "");
}

@media (prefers-reduced-motion: reduce) {
    .dialed-loading-stream {
        animation: none;
    }

    .dialed-loading-fill {
        transition: none;
    }
}

code {
    color: #c02d76;
}

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