/**
 * Login — modernes Mobile-Vollbild (nur ≤768px). Desktop via app.css unverändert.
 */
@media (max-width: 768px) {
    html:has(.login-page) {
        background: #eef1f6;
    }

    .login-page {
        position: relative;
        align-items: center;
        justify-content: center;
        padding:
            0
            max(20px, env(safe-area-inset-right, 0px))
            env(safe-area-inset-bottom, 0px)
            max(20px, env(safe-area-inset-left, 0px));
        background:
            radial-gradient(140% 90% at 50% -30%, rgba(212, 166, 41, 0.18) 0%, transparent 52%),
            linear-gradient(180deg, #f7f8fa 0%, #eef1f6 38%, #e8ecf2 100%);
        background-color: #eef1f6;
        min-height: 100dvh;
        min-height: -webkit-fill-available;
    }

    .login-container {
        position: relative;
        z-index: 1;
        width: 100%;
        max-width: 380px;
        max-height: none;
        flex: 0 1 auto;
        min-height: 0;
        margin: auto;
        display: flex;
        flex-direction: column;
    }

    .login-box {
        flex: 0 1 auto;
        display: flex;
        flex-direction: column;
        max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 24px);
        margin: 0;
        padding:
            calc(8px + env(safe-area-inset-top, 0px))
            0
            12px;
        background: transparent;
        border-radius: 0;
        box-shadow: none;
        animation: none;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .login-header {
        text-align: center;
        margin-bottom: 32px;
    }

    .logo-container {
        width: 88px;
        aspect-ratio: 1;
        margin: 0 auto 22px;
        justify-content: center;
    }

    .logo-image {
        width: 88px;
        height: 88px;
        max-width: 88px;
        max-height: 88px;
        object-fit: contain;
        filter: drop-shadow(0 6px 16px rgba(26, 26, 26, 0.1));
    }

    .tj-login-mobile-hero {
        display: block;
    }

    .tj-login-mobile-hero h1 {
        font-size: 1.75rem;
        font-weight: 700;
        letter-spacing: -0.035em;
        line-height: 1.15;
        color: #1a1a1a;
        margin: 0 0 8px;
    }

    .tj-login-mobile-hero p {
        font-size: 1rem;
        line-height: 1.45;
        color: rgba(88, 88, 90, 0.88);
        margin: 0 auto;
        max-width: 18rem;
    }

    #alertContainer {
        margin-bottom: 16px;
    }

    #alertContainer .alert {
        border-radius: 16px;
        border: none;
        font-size: 0.9375rem;
        box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
    }

    .login-form {
        display: flex;
        flex-direction: column;
        margin-bottom: 0;
        flex: 0 0 auto;
    }

    .tj-login-field-group {
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin-bottom: 20px;
        background: transparent;
        border-radius: 0;
        box-shadow: none;
        overflow: visible;
    }

    .login-page .tj-login-field-group .form-group {
        margin-bottom: 0;
        padding: 0;
        position: relative;
    }

    .login-page .tj-login-field-group .form-group + .form-group {
        border-top: none;
    }

    .login-page .tj-login-field-group .form-group > label:first-of-type {
        position: static;
        display: block;
        margin: 0 0 6px 4px;
        font-size: 0.8125rem;
        font-weight: 600;
        color: rgba(88, 88, 90, 0.85);
        letter-spacing: -0.01em;
    }

    .login-page .tj-login-field-group .form-group:focus-within > label:first-of-type {
        color: var(--primary-gold, #d4a629);
    }

    .login-page .form-group label i {
        display: none;
    }

    .login-page .form-control {
        width: 100%;
        height: 56px;
        padding: 0 18px;
        font-size: 1.0625rem;
        font-weight: 500;
        letter-spacing: -0.02em;
        line-height: 56px;
        color: #1a1a1a;
        border: 2px solid transparent;
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.92);
        box-shadow:
            0 0 0 1px rgba(15, 23, 42, 0.06),
            0 8px 24px rgba(15, 23, 42, 0.06);
        transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
        caret-color: var(--primary-gold, #d4a629);
        -webkit-appearance: none;
        appearance: none;
    }

    .login-page .form-control::placeholder {
        color: rgba(88, 88, 90, 0.5);
        font-weight: 400;
        opacity: 1;
    }

    .login-page .form-control:focus::placeholder {
        color: rgba(88, 88, 90, 0.35);
    }

    .login-page .form-control:focus {
        outline: none;
        border-color: rgba(212, 166, 41, 0.55);
        background: #fff;
        box-shadow:
            0 0 0 4px rgba(212, 166, 41, 0.18),
            0 8px 28px rgba(212, 166, 41, 0.12);
    }

    .login-page .password-wrapper {
        display: block;
    }

    .login-page .password-wrapper .form-control {
        padding-right: 52px;
        height: 56px;
    }

    .login-page .password-toggle {
        right: 6px;
        top: 50%;
        transform: translateY(-50%);
        width: 44px;
        height: 44px;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: rgba(88, 88, 90, 0.55);
        background: transparent;
    }

    .login-page .password-toggle:active {
        background: rgba(118, 118, 128, 0.12);
    }

    .login-page .form-options {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 22px;
    }

    .login-page .checkbox-label {
        font-size: 0.9375rem;
        color: #1a1a1a;
    }

    .login-page .checkbox-label input[type="checkbox"] {
        width: 20px;
        height: 20px;
        margin-right: 8px;
        border-radius: 6px;
        accent-color: var(--primary-gold, #d4a629);
    }

    .login-page .forgot-link {
        font-size: 0.875rem;
        font-weight: 600;
        color: var(--primary-gold, #d4a629);
        padding: 6px 0;
    }

    .login-page .btn-primary.btn-block {
        width: 100%;
        min-height: 54px;
        padding: 14px 22px;
        font-size: 1.0625rem;
        font-weight: 600;
        letter-spacing: -0.02em;
        border-radius: 16px;
        border: none;
        background: linear-gradient(180deg, #dbb033 0%, #c99a22 100%);
        box-shadow: 0 8px 22px rgba(201, 154, 34, 0.38);
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    .login-page .btn-primary.btn-block:hover {
        transform: none;
        filter: brightness(1.02);
    }

    .login-page .btn-primary.btn-block:active {
        transform: scale(0.985);
        filter: brightness(0.97);
    }

    .login-page .btn-primary.btn-block #loginText i {
        display: none;
    }

    .login-footer {
        margin-top: 28px;
        padding-top: 0;
        border-top: none;
        text-align: center;
    }

    .login-footer p {
        font-size: 0.9375rem;
        color: rgba(88, 88, 90, 0.85);
        margin-bottom: 12px;
    }

    .login-page .register-link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        max-width: 100%;
        min-height: 50px;
        padding: 0 20px;
        font-size: 1rem;
        font-weight: 600;
        color: #1a1a1a;
        background: rgba(255, 255, 255, 0.75);
        border: 1.5px solid rgba(15, 23, 42, 0.08);
        border-radius: 16px;
        gap: 8px;
        box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
    }

    .login-page .register-link i {
        color: var(--primary-gold, #d4a629);
    }

    .login-page .register-link:hover {
        gap: 8px;
        color: #1a1a1a;
        background: #fff;
    }

    .login-info {
        margin-top: 18px;
        text-align: center;
    }

    .login-info p {
        font-size: 0.8125rem;
        color: rgba(88, 88, 90, 0.65);
        justify-content: center;
    }
}

@media (min-width: 769px) {
    .tj-login-mobile-hero {
        display: none;
    }

    .login-page .tj-login-field-group .form-group > label:first-of-type {
        position: static;
        transform: none;
        font-size: 14px;
        font-weight: 600;
        color: var(--primary-gray);
        margin-bottom: 8px;
        text-transform: none;
    }

    .login-page .form-control::placeholder {
        color: #999;
    }
}
