/* =========================================================
   Fotosortierer – interaktive Login-Bühne
   ========================================================= */

body.is-guest {
    overflow-x: hidden;
}

body.is-guest .app-shell {
    transition:
        grid-template-columns 760ms cubic-bezier(.22, .72, .22, 1),
        background-color 500ms ease;
}

.story-panel,
.access-panel,
.story-content,
.story-header,
.story-footer,
.login-wrap,
.login-card {
    transition:
        transform 760ms cubic-bezier(.22, .72, .22, 1),
        opacity 520ms ease,
        filter 620ms ease,
        padding 760ms cubic-bezier(.22, .72, .22, 1),
        box-shadow 520ms ease;
}

.story-panel {
    overflow: hidden;
}

.story-video {
    position: absolute;
    inset: -2%;
    z-index: -3;
    width: 104%;
    height: 104%;
    object-fit: cover;
    object-position: center;
    opacity: 0;
    transform: scale(1.035);
    transition: opacity 900ms ease, transform 10s ease;
    pointer-events: none;
}

.story-video.is-ready {
    opacity: 1;
}

.story-photo {
    z-index: -4 !important;
}

.story-shade {
    z-index: -2 !important;
}

body.login-focus-mode .app-shell {
    grid-template-columns: minmax(260px, 28vw) minmax(0, 72vw);
}

body.login-focus-mode .story-content {
    transform: translateX(-1.5vw) scale(.84);
    transform-origin: left center;
    opacity: .62;
}

body.login-focus-mode .story-header {
    transform: scale(.94);
    transform-origin: left top;
    opacity: .78;
}

body.login-focus-mode .story-footer {
    opacity: .42;
    transform: translateY(8px);
}

body.login-focus-mode .story-panel {
    filter: saturate(.78) brightness(.84);
}

body.login-focus-mode .story-video {
    transform: scale(1.08);
}

body.login-focus-mode .access-panel {
    padding-left: 0;
    padding-right: 0;
}

body.login-focus-mode .login-wrap {
    transform: translateX(-14vw);
}

body.login-focus-mode .login-card {
    box-shadow:
        0 34px 90px rgba(31, 46, 42, .17),
        0 6px 18px rgba(31, 46, 42, .07);
}

.login-card .input-shell {
    transition:
        transform 180ms ease,
        box-shadow 180ms ease,
        border-color 180ms ease;
}

.login-card .field:focus-within .input-shell {
    transform: translateY(-1px);
}

/* =========================================================
   Kompakter Passwortbereich
   ========================================================= */

.login-card .password-field {
    margin-bottom: 0 !important;
}

.login-card .field-label-row {
    min-height: 28px;
    align-items: center;
}

.login-card .field-label-row .forgot-link {
    min-height: auto;
    padding: 2px 0;
    font-size: 12.5px;
    font-weight: 720;
}

/* =========================================================
   Sicher-anmelden Button
   ========================================================= */

.primary-button-login {
    position: relative;
    isolation: isolate;
    min-height: 68px;
    margin-top: 0 !important;
    padding: 8px 14px 8px 10px !important;
    gap: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .12) !important;
    border-radius: 18px !important;
    background:
        radial-gradient(circle at 18% 0%, rgba(255,255,255,.14), transparent 35%),
        linear-gradient(135deg, #214b3b 0%, #173c2f 55%, #102f25 100%) !important;
    box-shadow:
        0 16px 34px rgba(25, 62, 48, .25),
        inset 0 1px 0 rgba(255, 255, 255, .12) !important;
    transition:
        transform 190ms ease,
        box-shadow 190ms ease,
        filter 190ms ease,
        opacity 190ms ease !important;
}

.primary-button-login::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    background: linear-gradient(110deg, transparent 18%, rgba(255,255,255,.12) 42%, transparent 62%);
    transform: translateX(-120%);
    transition: transform 700ms cubic-bezier(.2,.7,.2,1);
}

.primary-button-login:hover:not(:disabled) {
    transform: translateY(-2px) !important;
    filter: brightness(1.04);
    box-shadow:
        0 21px 42px rgba(25, 62, 48, .30),
        inset 0 1px 0 rgba(255,255,255,.15) !important;
}

.primary-button-login:hover:not(:disabled)::before {
    transform: translateX(120%);
}

.primary-button-login:active:not(:disabled) {
    transform: translateY(0) scale(.995) !important;
}

.button-lock {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: #f7ead1;
    background: rgba(255,255,255,.10);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.11);
}

.button-lock svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.button-copy {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    text-align: left;
}

.button-copy strong {
    color: #fff;
    font-size: 15.5px;
    line-height: 1.25;
    letter-spacing: -.01em;
}

.button-copy small {
    color: rgba(255,255,255,.60);
    font-size: 10.5px;
    font-weight: 620;
    line-height: 1.2;
}

.primary-button-login .button-arrow {
    flex: 0 0 auto;
    opacity: .82;
    transition: transform 180ms ease, opacity 180ms ease;
}

.primary-button-login:hover:not(:disabled) .button-arrow {
    transform: translateX(3px);
    opacity: 1;
}

.button-spinner {
    position: absolute;
    right: 17px;
    width: 19px;
    height: 19px;
    display: none;
    border: 2px solid rgba(255,255,255,.28);
    border-top-color: #fff;
    border-radius: 50%;
    animation: loginSpinner .75s linear infinite;
}

.primary-button-login.is-loading .button-arrow {
    visibility: hidden;
}

.primary-button-login.is-loading .button-spinner {
    display: block;
}

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

.primary-button-login:disabled {
    cursor: not-allowed;
}

.primary-button-login.is-mobile-blocked {
    min-height: 72px;
    opacity: .78;
    background:
        radial-gradient(circle at 18% 0%, rgba(255,255,255,.08), transparent 35%),
        linear-gradient(135deg, #47534e 0%, #35423d 100%) !important;
    box-shadow: 0 10px 24px rgba(31, 46, 42, .14) !important;
}

.primary-button-login.is-mobile-blocked .button-arrow {
    display: none;
}

.primary-button-login.is-mobile-blocked .button-lock {
    color: rgba(255,255,255,.78);
}

.primary-button-login.is-mobile-blocked .button-copy strong {
    font-size: 12.5px;
    line-height: 1.3;
}

.desktop-only-notice {
    display: none;
    margin-top: -6px;
    padding: 12px 13px;
    grid-template-columns: 34px 1fr;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(115, 94, 53, .15);
    border-radius: 14px;
    color: #685b41;
    background: #f8f1e4;
}

.desktop-only-notice.is-visible {
    display: grid;
    animation: mobileNoticeIn 320ms ease both;
}

.desktop-only-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: #66593f;
    background: rgba(200,169,119,.22);
    font-size: 16px;
}

.desktop-only-notice strong,
.desktop-only-notice small {
    display: block;
}

.desktop-only-notice strong {
    margin-bottom: 2px;
    font-size: 12.5px;
}

.desktop-only-notice small {
    color: #82745b;
    font-size: 11px;
    line-height: 1.35;
}

@keyframes mobileNoticeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   Begrüßungs-Splash nach erfolgreichem Login
   ========================================================= */

body.has-welcome-splash {
    overflow: hidden;
}

.welcome-splash {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: 28px;
    color: #fff;
    background:
        radial-gradient(circle at 18% 20%, rgba(216, 191, 143, .18), transparent 28%),
        radial-gradient(circle at 82% 78%, rgba(77, 128, 107, .22), transparent 32%),
        linear-gradient(145deg, #17271f 0%, #10241c 52%, #0a1914 100%);
    opacity: 0;
    transition: opacity 600ms ease, visibility 600ms ease;
}

.welcome-splash::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: radial-gradient(rgba(255,255,255,.17) .65px, transparent .65px);
    background-size: 8px 8px;
    opacity: .035;
}

.welcome-splash.is-visible {
    opacity: 1;
}

.welcome-splash.is-leaving {
    opacity: 0;
    pointer-events: none;
}

.welcome-orb {
    position: absolute;
    width: 38vw;
    height: 38vw;
    min-width: 320px;
    min-height: 320px;
    border-radius: 50%;
    filter: blur(90px);
    opacity: .16;
    pointer-events: none;
    animation: welcomeFloat 7s ease-in-out infinite alternate;
}

.welcome-orb-one {
    top: -18vw;
    left: -10vw;
    background: #d2b680;
}

.welcome-orb-two {
    right: -13vw;
    bottom: -20vw;
    background: #4f8a72;
    animation-delay: -2.5s;
}

@keyframes welcomeFloat {
    from { transform: translate3d(0, 0, 0) scale(.95); }
    to { transform: translate3d(4vw, 2vw, 0) scale(1.08); }
}

.welcome-splash-inner {
    position: relative;
    z-index: 2;
    width: min(100%, 780px);
    text-align: center;
    opacity: 0;
    transform: translateY(18px) scale(.985);
}

.welcome-splash.is-visible .welcome-splash-inner {
    animation: welcomeContentIn 800ms 140ms cubic-bezier(.2,.72,.2,1) forwards;
}

@keyframes welcomeContentIn {
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.welcome-mark {
    width: 72px;
    height: 72px;
    margin: 0 auto 26px;
    display: grid;
    place-items: center;
    padding: 7px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 22px;
    background: rgba(255,255,255,.94);
    box-shadow:
        0 22px 55px rgba(0,0,0,.22),
        0 0 0 8px rgba(255,255,255,.035);
}

.welcome-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.welcome-kicker {
    margin: 0 0 14px;
    color: rgba(228, 206, 165, .80);
    font-size: 11.5px;
    font-weight: 780;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.welcome-splash h1 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(44px, 6vw, 78px);
    font-weight: 400;
    line-height: .98;
    letter-spacing: -.045em;
}

.welcome-splash h1 span {
    display: block;
    margin-top: 8px;
    color: #e2c99c;
}

.welcome-quote {
    max-width: 650px;
    min-height: 58px;
    margin: 28px auto 0;
    color: rgba(255,255,255,.69);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(17px, 2vw, 21px);
    font-style: italic;
    line-height: 1.55;
}

.welcome-loader {
    width: min(280px, 66vw);
    height: 3px;
    margin: 34px auto 0;
    overflow: hidden;
    border-radius: 99px;
    background: rgba(255,255,255,.10);
}

.welcome-loader span {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #c9aa73, #f2e4c6, #79a58f);
    transform: scaleX(0);
    transform-origin: left center;
}

.welcome-splash.is-visible .welcome-loader span {
    animation: welcomeLoading 3.35s 380ms cubic-bezier(.22,.72,.22,1) forwards;
}

@keyframes welcomeLoading {
    0% { transform: scaleX(0); }
    32% { transform: scaleX(.31); }
    68% { transform: scaleX(.72); }
    100% { transform: scaleX(1); }
}

.welcome-loading-copy {
    margin: 11px 0 0;
    color: rgba(255,255,255,.38);
    font-size: 11px;
    letter-spacing: .02em;
}

@media (max-width: 1180px) {
    body.login-focus-mode .app-shell {
        grid-template-columns: minmax(340px, 38vw) minmax(0, 62vw);
    }

    body.login-focus-mode .login-wrap {
        transform: translateX(-5vw);
    }

    body.login-focus-mode .story-content {
        transform: scale(.9);
        transform-origin: left center;
    }
}

@media (max-width: 900px) {
    body.is-guest .app-shell,
    body.login-focus-mode .app-shell {
        display: block;
    }

    body.login-focus-mode .story-content,
    body.login-focus-mode .story-header,
    body.login-focus-mode .story-footer,
    body.login-focus-mode .story-panel,
    body.login-focus-mode .login-wrap {
        transform: none;
        filter: none;
        opacity: 1;
    }

    .story-video {
        inset: 0;
        width: 100%;
        height: 100%;
    }

    body.is-guest .story-panel {
        min-height: 330px;
    }

    body.is-guest .story-content {
        padding: 58px 0 34px;
    }

    body.is-guest .story-content h1 {
        font-size: clamp(38px, 8vw, 52px);
    }

    body.is-guest .story-content > p {
        max-width: 620px;
    }

    body.is-guest .access-panel {
        padding-top: 28px;
    }
}

@media (max-width: 560px) {
    body.is-guest .story-panel {
        min-height: 265px;
        padding: 18px;
    }

    body.is-guest .story-content {
        padding: 42px 0 18px;
    }

    body.is-guest .story-content h1 {
        font-size: 35px;
    }

    body.is-guest .story-content > p {
        margin-top: 14px;
        display: -webkit-box;
        overflow: hidden;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    body.is-guest .login-card {
        padding: 25px 18px;
    }

    body.is-guest .login-intro {
        margin-bottom: 23px;
    }

    .login-card .field-label-row {
        align-items: center;
        gap: 10px;
    }

    .login-card .field-label-row .forgot-link {
        font-size: 11px;
        white-space: nowrap;
    }

    .primary-button-login {
        min-height: 68px !important;
    }

    .button-lock {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
    }

    .button-copy strong {
        font-size: 14.5px;
    }

    .welcome-splash {
        padding: 22px;
    }

    .welcome-mark {
        width: 62px;
        height: 62px;
        margin-bottom: 22px;
        border-radius: 19px;
    }

    .welcome-splash h1 {
        font-size: 43px;
    }

    .welcome-quote {
        min-height: 72px;
        margin-top: 22px;
        font-size: 17px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .story-video {
        display: none !important;
    }

    body.is-guest .app-shell,
    .story-panel,
    .access-panel,
    .story-content,
    .story-header,
    .story-footer,
    .login-wrap,
    .login-card {
        transition: none !important;
    }

    .welcome-orb {
        animation: none !important;
    }

    .welcome-splash.is-visible .welcome-splash-inner {
        animation-duration: 1ms !important;
        animation-delay: 0ms !important;
    }

    .welcome-splash.is-visible .welcome-loader span {
        animation-duration: 1.5s !important;
        animation-delay: 0ms !important;
    }
}
