.login-scene {
    --c0: #81b29a;
    --c1: #b5bb82;
    --c2: #e9c46a;
    --login-ink: #1f2a24;
    --page-pad: 32px;
    --wall-pad: 12px;
    --wall-pad-bottom: 96px;
    --box-w: min(480px, calc(100vw - var(--page-pad) * 2 - var(--wall-pad) * 2));
    --roller-time: 2.8s;
    --paint-delay: .7s;
    --paint-time: 1.5s;
    --flip-delay: 2.55s;
    --paint-colors: linear-gradient(90deg, var(--c0), var(--c2));
    --paint-sheen: linear-gradient(180deg, rgba(255, 255, 255, .14), transparent 30%, transparent 75%, rgba(0, 0, 0, .1));

    --floor-h: 76px;

    position: relative;
    display: grid;
    grid-template-rows: 1fr auto;
    justify-items: center;
    align-items: center;
    gap: 20px;
    min-height: 100vh;
    padding: 28px var(--page-pad) 26px;
    overflow: hidden;
    color: #2d2925;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.42 0 0 0 0 0.37 0 0 0 0 0.3 0 0 0 .16 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
        radial-gradient(ellipse 60% 55% at 50% 0%, rgba(255, 246, 225, .85), transparent 70%),
        radial-gradient(ellipse 120% 90% at 50% 40%, transparent 55%, rgba(70, 55, 40, .22) 100%),
        linear-gradient(180deg, #efe8dc 0%, #e6ddcf 60%, #d9cebd 100%);
    isolation: isolate;
}

.login-scene::before {
    position: absolute;
    right: 0;
    bottom: var(--floor-h);
    left: 0;
    z-index: -1;
    height: 16px;
    background: linear-gradient(180deg, #fbf8f3, #e9e3d9);
    box-shadow: 0 -1px 0 rgba(0, 0, 0, .06), 0 6px 10px -4px rgba(0, 0, 0, .25);
    content: "";
}

.login-scene::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: -2;
    height: var(--floor-h);
    background:
        linear-gradient(180deg, rgba(0, 0, 0, .28), transparent 40%),
        repeating-linear-gradient(90deg, transparent 0 158px, rgba(0, 0, 0, .22) 158px 160px),
        repeating-linear-gradient(90deg, #a06a43 0 40px, #9a6440 40px 90px, #a76f47 90px 160px),
        #9b6542;
    content: "";
}

.auth-body {
    background: #e6ddcf;
}

.scene-drips {
    position: absolute;
    top: 0;
    right: 0;
    bottom: var(--floor-h);
    left: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.scene-drips span {
    position: absolute;
    top: -24px;
    width: var(--s, 12px);
    height: var(--s, 12px);
    border-radius: 50% 0 50% 50%;
    background: var(--col, var(--c0));
    box-shadow: inset -2px -2px 4px rgba(0, 0, 0, .15), inset 2px 2px 3px rgba(255, 255, 255, .45);
    opacity: 0;
    rotate: -45deg;
    animation: rain-drop var(--t, 3s) var(--d, 0s) cubic-bezier(.55, 0, .9, .6) infinite;
}

.scene-drips span:nth-child(1)  { left: 4%;  --s: 12px; --fall: 62vh; --col: var(--c0); --d: .2s;  --t: 3.2s; }
.scene-drips span:nth-child(2)  { left: 11%; --s: 8px;  --fall: 48vh; --col: var(--c2); --d: 1.6s; --t: 2.6s; }
.scene-drips span:nth-child(3)  { left: 18%; --s: 14px; --fall: 70vh; --col: var(--c1); --d: .9s;  --t: 3.6s; }
.scene-drips span:nth-child(4)  { left: 26%; --s: 9px;  --fall: 55vh; --col: var(--c0); --d: 2.4s; --t: 2.9s; }
.scene-drips span:nth-child(5)  { left: 33%; --s: 7px;  --fall: 40vh; --col: var(--c2); --d: .5s;  --t: 2.4s; }
.scene-drips span:nth-child(6)  { left: 40%; --s: 11px; --fall: 66vh; --col: var(--c2); --d: 3s;   --t: 3.4s; }
.scene-drips span:nth-child(7)  { left: 59%; --s: 8px;  --fall: 50vh; --col: var(--c1); --d: 1.2s; --t: 2.7s; }
.scene-drips span:nth-child(8)  { left: 66%; --s: 13px; --fall: 72vh; --col: var(--c0); --d: 2s;   --t: 3.5s; }
.scene-drips span:nth-child(9)  { left: 73%; --s: 7px;  --fall: 44vh; --col: var(--c2); --d: .1s;  --t: 2.5s; }
.scene-drips span:nth-child(10) { left: 80%; --s: 10px; --fall: 60vh; --col: var(--c2); --d: 2.8s; --t: 3.1s; }
.scene-drips span:nth-child(11) { left: 88%; --s: 8px;  --fall: 46vh; --col: var(--c0); --d: 1.4s; --t: 2.6s; }
.scene-drips span:nth-child(12) { left: 95%; --s: 12px; --fall: 68vh; --col: var(--c1); --d: .7s;  --t: 3.3s; }

.scene-headline {
    position: absolute;
    bottom: calc(var(--floor-h) + 48px);
    left: 48px;
    max-width: 320px;
    margin: 0;
    color: #2d2925;
    font-family: "Fraunces", Georgia, serif;
    font-size: 2.2rem;
    font-weight: 600;
    line-height: 1.12;
    letter-spacing: -.02em;
    animation: fade-up .8s .3s ease both;
}

.scene-headline em {
    font-style: italic;
    background: linear-gradient(90deg, #5e8f78, #c9962c);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.scene-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    color: rgba(255, 255, 255, .85);
    font-size: .78rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .4);
}

.scene-footer__secure {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.scene-wall {
    position: relative;
    padding: var(--wall-pad) var(--wall-pad) var(--wall-pad-bottom);
    animation: fade-up .6s ease both;
}

.paint-box {
    position: relative;
    z-index: 0;
    display: grid;
    width: var(--box-w);
    perspective: 1400px;
}

.paint-surface,
.paint-form {
    grid-area: 1 / 1;
}

.paint-surface {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    pointer-events: none;
}

.paint-surface::before {
    position: absolute;
    inset: 0;
    border: 2px dashed rgba(70, 55, 40, .3);
    border-radius: inherit;
    content: "";
}

.paint-form {
    position: relative;
    z-index: 2;
    padding: 20px;
    transform-origin: 50% 50%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    animation: form-flip .9s var(--flip-delay) cubic-bezier(.3, .7, .25, 1) both;
}

.paint-coat {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1;
    height: 0;
    background: var(--paint-sheen), var(--paint-colors);
    animation: paint-down var(--paint-time) var(--paint-delay) linear both;
}

.paint-coat::after {
    position: absolute;
    right: 0;
    bottom: -7px;
    left: 0;
    height: 8px;
    background: var(--paint-colors);
    content: "";
    -webkit-mask: radial-gradient(circle at 50% 0, #000 5.5px, transparent 6px) 0 0 / 13px 8px repeat-x;
    mask: radial-gradient(circle at 50% 0, #000 5.5px, transparent 6px) 0 0 / 13px 8px repeat-x;
}

.paint-drip {
    position: absolute;
    top: calc(100% - 4px);
    width: 7px;
    height: 0;
    border-radius: 0 0 4px 4px;
    animation: drip-run .9s cubic-bezier(.5, 0, .7, 1) both;
}

.paint-drip::after {
    position: absolute;
    bottom: -6px;
    left: 50%;
    width: 12px;
    height: 12px;
    border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
    background: inherit;
    content: "";
    transform: translateX(-50%);
}

.paint-drip--1 { left: 8%;  --drip: 40px; background: var(--c0); animation-delay: 2.05s; }
.paint-drip--2 { left: 23%; --drip: 64px; background: var(--c0); animation-delay: 2.15s; }
.paint-drip--3 { left: 51%; --drip: 50px; background: var(--c1); animation-delay: 2.1s; }
.paint-drip--4 { left: 75%; --drip: 72px; background: var(--c2); animation-delay: 2.2s; }
.paint-drip--5 { left: 90%; --drip: 32px; background: var(--c2); animation-delay: 2.12s; }

.paint-tape {
    position: absolute;
    top: -10px;
    z-index: 3;
    width: 74px;
    height: 24px;
    background: rgba(244, 233, 196, .85);
    box-shadow: 0 2px 4px rgba(0, 0, 0, .18);
    animation: tape-in .5s .3s ease both;
}

.paint-tape--left  { left: -24px;  rotate: -38deg; }
.paint-tape--right { right: -24px; rotate: 38deg; }

.scene-roller {
    position: absolute;
    top: 0;
    left: -4.64%;
    z-index: 4;
    width: 113%;
    pointer-events: none;
    filter: drop-shadow(0 16px 20px rgba(0, 0, 0, .5));
    animation: roller-path var(--roller-time) both;
}

.scene-roller__svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
    transform: translateY(-11.2%);
    transform-origin: 50% 11.2%;
    animation: roller-wobble .5s ease-in-out infinite alternate;
}

.roller-frame {
    fill: none;
    stroke: url(#roller-metal);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.roller-ferrule { fill: #cbd5e1; }
.roller-handle  { fill: #f59e0b; }
.roller-grip    { fill: rgba(0, 0, 0, .18); }
.roller-cap     { fill: #e2e8f0; }

.roller-paint-start { stop-color: var(--c0); }
.roller-paint-end   { stop-color: var(--c2); }

.roller-texture {
    fill: rgba(255, 255, 255, .16);
    animation: roller-spin .3s linear infinite;
}

.login-card {
    padding: 44px 40px 36px;
    border-radius: 3rem;
    color: var(--login-ink);
}

.login-card > * {
    animation: fade-up .5s cubic-bezier(.2, .8, .2, 1) both;
    animation-delay: calc(var(--flip-delay) + .55s);
}

.login-card > :nth-child(2) { animation-delay: calc(var(--flip-delay) + .6s); }
.login-card > :nth-child(3) { animation-delay: calc(var(--flip-delay) + .65s); }
.login-card > :nth-child(4) { animation-delay: calc(var(--flip-delay) + .7s); }

.login-card__title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 0 0 26px;
    color: var(--login-ink);
    font-family: var(--dcr-font);
    font-size: 2.1rem;
    font-weight: 700;
    letter-spacing: -.02em;
    text-shadow: 0 1px 0 rgba(255, 255, 255, .35);
}

.login-card__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(31, 42, 36, .25);
    border-radius: 12px;
    background: rgba(255, 255, 255, .4);
    text-shadow: none;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.login-card__mark svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: var(--login-ink);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.login-card__mark svg rect:first-child {
    fill: var(--login-ink);
    stroke: none;
}

.login-alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 18px;
    padding: 11px 13px;
    border: 1px solid #fecaca;
    border-radius: 12px;
    background: #fef2f2;
    color: #991b1b;
    font-size: .85rem;
    font-weight: 500;
}

.login-alert .bi {
    margin-top: 1px;
    color: #dc2626;
}

.login-field {
    margin-bottom: 16px;
}

.login-field__label {
    display: block;
    margin-bottom: 6px;
    color: var(--login-ink);
    font-size: .82rem;
    font-weight: 600;
}

.login-field__control {
    position: relative;
}

.login-field__icon {
    position: absolute;
    top: 50%;
    left: 15px;
    color: #475569;
    font-size: 1.05rem;
    transform: translateY(-50%);
    transition: color var(--dcr-transition);
    pointer-events: none;
}

.login-input {
    width: 100%;
    height: 50px;
    padding: 0 16px 0 44px;
    border: 2px solid rgba(15, 23, 42, .4);
    border-radius: 12px;
    outline: 0;
    background: rgba(255, 255, 255, .96);
    color: var(--dcr-heading);
    font-size: .95rem;
    box-shadow: 0 4px 12px -6px rgba(0, 0, 0, .35);
    transition: border-color var(--dcr-transition), background-color var(--dcr-transition), box-shadow var(--dcr-transition);
}

.login-input::placeholder {
    color: #8492a6;
}

.login-input--password {
    padding-right: 50px;
}

.login-input:hover {
    border-color: rgba(15, 23, 42, .6);
}

.login-input:focus {
    border-color: var(--dcr-primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, .45);
}

.login-field__control:focus-within .login-field__icon {
    color: var(--dcr-primary);
}

.login-input.is-invalid {
    border-color: #dc2626;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(254, 202, 202, .6);
}

.login-field__toggle {
    position: absolute;
    top: 50%;
    right: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #475569;
    font-size: 1.1rem;
    transform: translateY(-50%);
    transition: color var(--dcr-transition), background-color var(--dcr-transition);
}

.login-field__toggle:hover,
.login-field__toggle:focus-visible {
    background: var(--dcr-primary-soft);
    color: var(--dcr-primary);
    outline: 0;
}

.login-field__hint {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    color: #7c4a03;
    font-size: .78rem;
    font-weight: 600;
}

.login-options {
    margin: 2px 0 20px;
}

.login-options .form-check-label {
    color: var(--login-ink);
    font-size: .86rem;
    font-weight: 500;
    cursor: pointer;
}

.login-options .form-check-input {
    border-color: rgba(31, 42, 36, .45);
    cursor: pointer;
}

.login-submit {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-width: 170px;
    height: 50px;
    margin-inline: auto;
    padding: 0 34px;
    overflow: hidden;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--dcr-primary) 0%, var(--dcr-accent) 100%);
    box-shadow: 0 12px 26px -10px rgba(0, 0, 0, .6);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    transition: transform var(--dcr-transition), box-shadow var(--dcr-transition), filter var(--dcr-transition);
}

.login-submit::after {
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .35), transparent);
    content: "";
    transform: skewX(-20deg);
    transition: left .6s ease;
}

.login-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px -10px rgba(0, 0, 0, .7);
    filter: brightness(1.06);
}

.login-submit:hover::after {
    left: 120%;
}

.login-submit:active {
    transform: translateY(0);
}

.login-submit:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, .5);
}

.login-submit__text {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.login-submit__text .bi {
    transition: transform var(--dcr-transition);
}

.login-submit:hover .login-submit__text .bi {
    transform: translateX(3px);
}

.login-submit__spinner {
    position: absolute;
    display: none;
    width: 22px;
    height: 22px;
    border: 2.5px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

.login-submit.is-loading {
    pointer-events: none;
}

.login-submit.is-loading .login-submit__text {
    visibility: hidden;
}

.login-submit.is-loading .login-submit__spinner {
    display: block;
}

.login-card__info {
    display: flex;
    gap: 8px;
    margin: 18px 0 0;
    padding: 11px 13px;
    border-radius: 12px;
    background: rgba(15, 12, 30, .45);
    color: rgba(255, 255, 255, .9);
    font-size: .70rem;
    line-height: 1.45;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.is-instant .scene-wall,
.is-instant .paint-form,
.is-instant .paint-coat,
.is-instant .paint-drip,
.is-instant .paint-tape,
.is-instant .login-card > * {
    animation: none;
}

.is-instant .paint-coat {
    height: 100%;
}

.is-instant .paint-drip {
    height: var(--drip);
}

.is-instant .scene-roller {
    display: none;
}

.is-instant .login-alert {
    animation: shake .45s .1s ease both;
}

@keyframes roller-path {
    0%    { top: -45%; opacity: 0; animation-timing-function: cubic-bezier(.2, .8, .3, 1); }
    15%   { opacity: 1; }
    25%   { top: 0; animation-timing-function: linear; }
    78.6% { top: 100%; opacity: 1; animation-timing-function: cubic-bezier(.5, 0, .8, .6); }
    100%  { top: 122%; opacity: 0; }
}

@keyframes paint-down {
    0%   { height: 0; opacity: 0; }
    2%   { opacity: 1; }
    100% { height: 100%; opacity: 1; }
}

@keyframes rain-drop {
    0%   { translate: 0 0; opacity: 0; }
    8%   { opacity: .9; }
    75%  { opacity: .85; }
    100% { translate: 0 var(--fall, 60vh); opacity: 0; }
}

@keyframes drip-run {
    0%   { height: 0; opacity: 0; }
    8%   { opacity: 1; }
    100% { height: var(--drip); opacity: 1; }
}

@keyframes form-flip {
    0%   { transform: rotateY(-180deg) scale(.92); }
    60%  { transform: rotateY(12deg) scale(1.02); }
    100% { transform: rotateY(0) scale(1); }
}

@keyframes roller-spin {
    from { transform: translateY(0); }
    to   { transform: translateY(8px); }
}

@keyframes roller-wobble {
    from { transform: translateY(-11.2%) rotate(-1.2deg); }
    to   { transform: translateY(-11.2%) rotate(.6deg); }
}

@keyframes tape-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: none; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-6px); }
    40%      { transform: translateX(6px); }
    60%      { transform: translateX(-4px); }
    80%      { transform: translateX(4px); }
}

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

@media (max-width: 1199.98px) {
    .scene-headline {
        display: none;
    }
}

@media (max-width: 575.98px) {
    .login-scene {
        --page-pad: 14px;
        --wall-pad: 12px;
        --wall-pad-bottom: 66px;
        gap: 16px;
        padding-block: 18px;
    }

    .paint-form {
        padding: 12px;
    }

    .login-card {
        padding: 32px 24px 26px;
        border-radius: 2rem;
    }

    .login-card__title {
        font-size: 1.7rem;
    }

    .paint-tape {
        width: 56px;
        height: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .scene-drips {
        display: none;
    }
}
