.login-scene {
    --ink: #102348;
    --muted: #415a80;
    --blue: #064cda;
    --border: #d9e4f2;
    --scene-art: url(../images/treelink-login/scene-right.webp);
    isolation: isolate;
    position: relative;
    display: grid;
    grid-template-columns: 60.2% minmax(0, 1fr);
    min-height: max(100svh, 56.28vw);
    overflow: hidden;
    color: var(--ink);
    background:
        var(--scene-art) right center / 39.84% 100% no-repeat,
        radial-gradient(ellipse at 90% 5%, #baf9b9, transparent 36%),
        radial-gradient(ellipse at 71% 74%, #7cc3fc, transparent 54%),
        linear-gradient(132deg,#f8fbfd,#d6ebfb 41%,#e7f5ff);
}
.login-scene :focus-visible { outline: 3px solid #1f6ded; outline-offset: 3px; }
.login-brand {
    position: absolute;
    z-index: 2;
    top: 2.3vw;
    left: 4.55vw;
    width: clamp(156px, 15.2vw, 290px);
    display: inline-block;
}
.login-brand img { display: block; width: 100%; height: auto; }
.login-illustration { position: relative; min-width: 0; z-index: -1; }
.login-illustration img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: right center;
}
.login-card {
    position: relative;
    align-self: center;
    min-width: 0;
    margin: 6.45vw 2.58vw 5.45vw 0;
    padding: clamp(28px,3.62vw,72px) clamp(25px,2.98vw,57px) clamp(24px,1.92vw,39px);
    border: 1px solid #f1f7fd;
    border-radius: clamp(26px,3.16vw,58px);
    background: linear-gradient(142deg,#f8fbff,#f9fbfd 56%,#f7fbff);
    box-shadow: 0 24px 46px #106cb02c;
}
.login-card::after {
    content: "";
    position: absolute;
    right: -1.5vw;
    bottom: -3.55vw;
    width: 8.3vw;
    height: 7.4vw;
    pointer-events: none;
    background: url(../images/treelink-login/corner-leaves.webp) center / contain no-repeat;
}
.login-heading { display: flex; align-items: center; gap: clamp(13px,1.1vw,24px); }
.login-heading img {
    flex: none;
    width: clamp(56px,6.25vw,120px);
    height: auto;
    border-radius: 23%;
    box-shadow: 0 7px 16px #3f87b622;
}
.login-heading h1 {
    margin: 0;
    font-size: clamp(1.4rem,1.83vw,2.25rem);
    font-weight: 800;
    line-height: 1.18;
    letter-spacing: -.046em;
}
.login-heading p {
    margin: .43em 0 0;
    color: var(--muted);
    font-size: clamp(.84rem,1vw,1.15rem);
    font-weight: 600;
    line-height: 1.52;
}
.login-form { display: grid; row-gap: clamp(16px,1.22vw,24px); margin-top: clamp(24px,2.76vw,54px); }
.login-field { display: grid; gap: clamp(7px,.59vw,11px); }
.login-field-label { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.login-field label {
    display: flex;
    align-items: center;
    gap: .66em;
    font-weight: 800;
    font-size: clamp(.86rem,1.05vw,1.24rem);
}
.login-field svg, .login-submit svg, .login-google svg {
    flex: none;
    width: 1.3em;
    height: 1.3em;
}
.login-field-label a, .login-register a { color: var(--blue); font-weight: 800; }
.login-field-label a { font-size: clamp(.79rem,.96vw,1.1rem); text-align: right; }
.login-field-label a:hover, .login-register a:hover { text-decoration: underline; }
.login-input {
    position: relative;
    display: flex;
    align-items: center;
    min-height: clamp(47px,3.48vw,67px);
    border: 1.5px solid var(--border);
    border-radius: clamp(13px,1.1vw,22px);
    background: #ffffffb8;
    font-size: clamp(1rem,1.2vw,1.4rem);
    transition: border-color .16s, box-shadow .16s;
}
.login-input:focus-within { border-color: #75a8f5; box-shadow: 0 0 0 3px #d9e9ff; }
.login-input > svg {
    margin-inline: clamp(12px,1.18vw,24px) .55em;
    color: #7891b6;
    pointer-events: none;
}
.login-input input {
    width: 100%;
    min-width: 0;
    padding: .65em .7em .65em .28em;
    color: var(--ink);
    background: transparent;
    border: 0;
    outline: 0;
    box-shadow: none;
    font: inherit;
}
.login-input input:focus-visible { outline: none; }
.login-input input::placeholder { color: #6981a6; opacity: 1; }
.login-input:has([aria-invalid="true"]) { border-color: #d48b93; }
.login-password-toggle {
    display: grid;
    place-items: center;
    min-width: 44px;
    min-height: 42px;
    margin-inline: 0 .3em;
    color: #5a749b;
    border-radius: 10px;
    cursor: pointer;
}
.login-password-toggle[hidden] { display: none; }
.login-password-toggle:hover { background: #edf4fd; }
.login-remember {
    width: fit-content;
    display: flex;
    align-items: center;
    gap: .78em;
    color: var(--muted);
    font-size: clamp(.88rem,1vw,1.14rem);
    font-weight: 600;
    cursor: pointer;
}
.login-remember input {
    width: 1.34em;
    height: 1.34em;
    accent-color: #3c8f20;
    border-color: #7490b2;
    border-radius: 5px;
    cursor: pointer;
}
.login-submit, .login-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .6em;
    width: 100%;
    border-radius: clamp(14px,1.28vw,24px);
    font-weight: 800;
    cursor: pointer;
    transition: background .16s, box-shadow .16s;
}
.login-submit {
    min-height: clamp(49px,4.03vw,78px);
    color: #14273c;
    background: linear-gradient(103deg,#bfff4d,#89f649);
    box-shadow: 0 5px 10px #76b73a20;
    font-size: clamp(1.09rem,1.34vw,1.65rem);
}
.login-submit:hover { background: linear-gradient(103deg,#afff2f,#70ec32); box-shadow: 0 5px 12px #76b73a36; }
.login-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5em;
    margin: clamp(10px,.78vw,17px) 0 clamp(8px,.52vw,11px);
    color: var(--muted);
    font-size: clamp(.78rem,.91vw,1.05rem);
    font-weight: 600;
}
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.login-divider span { padding: .1em 1.05em; border-radius: 6px; background: #eaf0f7; }
.login-google {
    min-height: clamp(47px,3.4vw,66px);
    border: 1.5px solid var(--border);
    background: #ffffffa0;
    font-size: clamp(.95rem,1.05vw,1.24rem);
}
.login-google:hover { background: #eef6ff; border-color: #afc7e8; }
.login-register {
    margin: clamp(17px,1.48vw,29px) 0 0;
    text-align: center;
    color: var(--muted);
    font-size: clamp(.86rem,1vw,1.13rem);
    font-weight: 600;
}
.login-message {
    margin: 1rem 0 0;
    padding: .72rem .9rem;
    border: 1px solid;
    border-radius: 11px;
    font-size: .87rem;
    overflow-wrap: anywhere;
}
.login-status { background: #eefbf0; color: #164f2d; border-color: #b8e3c0; }
.login-errors { background: #fff1f2; color: #8b2637; border-color: #f5c0c8; }
.login-errors li + li { margin-top: .3em; }
.login-card--compact {
    container-type: inline-size;
    padding-block: clamp(20px,2.05vw,40px) clamp(18px,1.8vw,34px);
}
.login-card--compact .login-heading img { width: clamp(52px,4.4vw,76px); }
.register-form { row-gap: 11px; margin-top: 16px; }
.register-fields { display: grid; grid-template-columns: minmax(0,1fr); gap: 9px 12px; }
.register-fields .login-field { gap: 4px; min-width: 0; }
.register-fields .login-field label { font-size: clamp(.8rem,.92vw,1.02rem); }
.register-fields .login-input { min-height: 42px; font-size: max(16px,1vw); }
.register-fields .login-input input { padding: .47em .68em; }
.register-fields .login-password-toggle { min-width: 35px; min-height: 38px; margin-right: .15em; }
.register-agreement {
    display: flex;
    align-items: flex-start;
    gap: .65em;
    color: var(--muted);
    font-size: clamp(.75rem,.84vw,.92rem);
    line-height: 1.45;
    font-weight: 600;
}
.register-agreement input { flex: none; margin-top: .2em; accent-color: #3c8f20; cursor: pointer; }
.register-agreement a { color: var(--blue); font-weight: 800; }
.register-agreement a:hover { text-decoration: underline; }
.login-card--compact .login-submit { min-height: clamp(44px,3.25vw,62px); }
.login-card--compact .login-google { min-height: clamp(44px,2.85vw,55px); }
.login-card--compact .login-divider { margin-block: 9px 7px; }
.login-card--compact .login-register { margin-top: 13px; }
@container (min-width: 287px) {
    .register-fields { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .register-email { grid-column: 1/-1; }
}
@media (min-width: 901px) and (max-height: 850px) {
    .login-card { margin-block: clamp(30px,4vw,62px); }
}
@media (max-width: 900px) {
    .login-scene {
        --scene-art: url(../images/treelink-login/top-leaves.webp);
        grid-template-columns: minmax(0,1fr);
        align-content: center;
        justify-items: center;
        gap: 21px;
        padding: 24px 16px 34px;
        background-size: max(110px,18vw) auto, auto, auto, auto;
        background-position: top right;
    }
    .login-brand { position: static; width: 153px; }
    .login-illustration { display: none; }
    .login-card { width: min(100%, 548px); margin: 0; padding: clamp(19px,4vw,33px); }
    .login-card--compact { padding: clamp(16px,3.5vw,25px); }
    .login-card::after { width: 56px; height: 50px; right: -7px; bottom: -16px; }
}
@media (prefers-reduced-motion: reduce) {
    .login-scene :is(.login-submit,.login-google,.login-input) { transition: none; }
}
