<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:tools="http://schemas.android.com/tools"
    tools:context=".ui.activities.LoginActivity">

    <com.habitrpg.android.habitica.ui.views.login.LockableScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/background_container"
        android:scrollIndicators="none"
        android:scrollbars="none">

        <com.habitrpg.android.habitica.ui.views.login.LoginBackgroundView
            android:id="@+id/background_view"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@drawable/login_gradient"
            android:clipChildren="false"
            android:clipToPadding="false"
            android:layout_marginEnd="-2dp"
            >
            <ImageView
                android:id="@+id/city_view"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
                app:srcCompat="@drawable/login_background"
                android:layout_centerHorizontal="true"
                android:scaleType="centerCrop" />
            <Space android:id="@+id/cloud_anchor"
                android:layout_width="0dp"
                android:layout_height="0dp"
                android:layout_centerHorizontal="true"
                android:visibility="invisible"
                android:layout_above="@id/city_view" />
            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                app:srcCompat="@drawable/cloud_1"
                android:id="@+id/left_cloud_view"
                android:layout_toStartOf="@id/cloud_anchor"
                android:layout_marginEnd="150dp"
                android:layout_alignParentBottom="true"
                android:scaleType="centerCrop"
                android:paddingBottom="460dp"
                />
            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                app:srcCompat="@drawable/cloud_2"
                android:id="@+id/right_cloud_view"
                android:layout_toEndOf="@id/cloud_anchor"
                android:layout_marginStart="170dp"
                android:layout_alignParentBottom="true"
                android:scaleType="centerCrop"
                android:paddingBottom="400dp"
                />
        </com.habitrpg.android.habitica.ui.views.login.LoginBackgroundView>

    </com.habitrpg.android.habitica.ui.views.login.LockableScrollView>


    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fitsSystemWindows="true">
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:paddingTop="@dimen/spacing_large"
            android:paddingStart="@dimen/spacing_large"
            android:paddingEnd="@dimen/spacing_large"
            android:orientation="vertical"
            android:background="@color/transparent"
                        >

            <ImageView
                android:id="@+id/logo_view"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_horizontal"
                android:src="@drawable/login_logo"
                android:layout_margin="24dp"
                android:contentDescription="@string/brand_name" />

            <androidx.appcompat.widget.AppCompatButton
                android:id="@+id/new_game_button"
                android:layout_width="@dimen/login_intro_button_size"
                android:layout_height="@dimen/login_intro_button_size"
                android:text="@string/register_btn"
                android:layout_gravity="center_vertical|center_horizontal"
                android:textColor="@color/white"
                android:layout_marginTop="@dimen/spacing_large"
                android:background="@drawable/login_begin_button"
                android:backgroundTint="@color/brand_100"/>

            <androidx.appcompat.widget.AppCompatButton
                android:id="@+id/show_login_button"
                android:layout_width="@dimen/login_intro_button_size"
                android:layout_height="@dimen/login_intro_button_size"
                android:text="@string/login_btn"
                android:layout_gravity="center_vertical|center_horizontal"
                android:textColor="@color/white"
                android:layout_marginTop="@dimen/spacing_large"
                android:background="@drawable/login_begin_button"
                android:backgroundTint="@color/brand_100"/>

            <ScrollView
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="@color/transparent"
                android:visibility="invisible"
                android:id="@+id/login_scrollview"
                android:scrollIndicators="none"
                tools:visibility="visible"
                android:padding="0dp"
                >

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:padding="@dimen/spacing_large"
                    android:id="@+id/form_wrapper"
                    android:orientation="vertical"
                    android:background="@color/transparent">

                    <EditText
                        android:id="@+id/username"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:drawableEnd="@drawable/ic_username"
                        android:imeOptions="actionNext"
                        android:inputType="textPersonName"
                        android:nextFocusDown="@+id/email"
                        android:hint="@string/username"
                        android:theme="@style/LoginEditTextTheme"
                        android:textColor="@color/white_75_alpha"
                        android:textColorHighlight="@color/white"/>

                    <EditText
                        android:id="@+id/email"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:inputType="textEmailAddress"
                        android:imeOptions="actionNext"
                        android:nextFocusDown="@+id/password"
                        android:drawableEnd="@drawable/ic_email"
                        android:hint="@string/emailAddress"
                        android:textColor="@color/white_75_alpha"
                        android:theme="@style/LoginEditTextTheme"
                        android:autofillHints="emailAddress"
                        />

                    <EditText
                        android:id="@+id/password"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:inputType="textPassword"
                        android:imeOptions="actionNext"
                        android:nextFocusDown="@+id/confirm_password"
                        android:drawableEnd="@drawable/ic_password"
                        android:hint="@string/password"
                        android:textColor="@color/white_75_alpha"
                        android:theme="@style/LoginEditTextTheme"/>

                    <EditText
                        android:id="@+id/confirm_password"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:inputType="textPassword"
                        android:drawableEnd="@drawable/ic_password"
                        android:imeOptions="actionDone"
                        android:hint="@string/confirmpassword"
                        android:textColor="@color/white_75_alpha"
                        android:theme="@style/LoginEditTextTheme"
                        android:autofillHints="newPassword"/>

                    <ProgressBar
                        android:id="@+id/PB_AsyncTask"
                        android:indeterminate="true"
                        android:visibility="gone"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center"/>

                    <Button
                        android:id="@+id/login_btn"
                        android:layout_width="match_parent"
                        android:layout_height="42dp"
                        android:text="@string/register_btn"
                        android:layout_marginTop="@dimen/spacing_xlarge"
                        style="@style/LoginButton"/>

                    <Button
                        android:id="@+id/google_login_button"
                        android:layout_width="match_parent"
                        android:layout_marginTop="@dimen/spacing_large"
                        android:layout_height="@dimen/diamond_button_height"
                        android:text="@string/login_btn_google"
                        android:drawableStart="@drawable/google_icon"
                        style="@style/LoginButton"/>

                    <Button
                        android:id="@+id/apple_login_button"
                        android:layout_width="match_parent"
                        android:layout_marginTop="@dimen/spacing_large"
                        android:layout_height="@dimen/diamond_button_height"
                        android:text="@string/login_btn_apple"
                        android:drawableStart="@drawable/apple_icon"
                        android:visibility="gone"
                        style="@style/LoginButton"/>

                    <Button
                        android:id="@+id/forgot_password"
                        android:layout_width="match_parent"
                        android:layout_marginTop="@dimen/spacing_xlarge"
                        android:gravity="center_horizontal"
                        android:layout_height="wrap_content"
                        android:text="@string/forgot_pw_btn"
                        android:layout_gravity="center_horizontal"
                        android:textColor="@color/white_75_alpha"
                        android:background="@color/transparent" />

                    <TextView
                        android:id="@+id/privacy_policy"
                        android:layout_width="match_parent"
                        android:layout_marginTop="@dimen/spacing_large"
                        android:layout_marginBottom="@dimen/spacing_xlarge"
                        android:gravity="center_horizontal"
                        android:layout_height="wrap_content"
                        android:text="@string/login_disclaimer"
                        android:linksClickable="true"
                        android:layout_gravity="center_horizontal"
                        android:textColor="@color/white_75_alpha"
                        android:background="@color/transparent" />

                </LinearLayout>

            </ScrollView>

        </LinearLayout>

        <ImageButton
            android:id="@+id/back_button"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/ic_arrow_back_white_36dp"
            android:background="@color/transparent"
            android:paddingStart="12dp"
            android:paddingEnd="0dp"
            android:layout_marginTop="@dimen/spacing_small"
            android:alpha="0" />
    </FrameLayout>

</FrameLayout>