<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/bg_base">

    <!-- Header background (Optional dark gradient layer instead of light bg) -->
    <View
        android:id="@+id/headerBg"
        android:layout_width="match_parent"
        android:layout_height="220dp"
        android:background="@color/bg_surface"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent" />

    <!-- Logo (Using our brand icon layer) -->
    <View
        android:id="@+id/logoImage"
        android:layout_width="64dp"
        android:layout_height="64dp"
        android:layout_marginTop="40dp"
        android:background="@drawable/brand_icon_bg"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <!-- App Name Title -->
    <TextView
        android:id="@+id/textAppName"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dp"
        android:text="VdcScore"
        android:textColor="@color/text_1"
        android:fontFamily="@font/font_bebas_neue"
        android:textSize="26sp"
        android:letterSpacing="0.06"
        app:layout_constraintTop_toBottomOf="@+id/logoImage"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent" />

    <!-- Login Form Container -->
    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:fillViewport="true"
        android:layout_marginTop="-20dp"
        app:layout_constraintTop_toBottomOf="@+id/headerBg"
        app:layout_constraintBottom_toBottomOf="parent">

         <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:paddingHorizontal="24dp"
            android:paddingTop="20dp"
            android:paddingBottom="20dp">

             <TextView
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_gravity="center_horizontal"
                 android:layout_marginBottom="32dp"
                 android:fontFamily="@font/font_bebas_neue"
                 android:letterSpacing="0.04"
                 android:text="Iniciar Sessão"
                 android:textColor="@color/text_1"
                 android:textSize="32sp" />

            <!-- Email Label -->
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:fontFamily="@font/font_ibm_plex_sans"
                android:text="Email"
                android:textColor="@color/text_1"
                android:textStyle="bold"
                android:textSize="13sp"
                android:layout_marginBottom="8dp"
                android:layout_marginStart="4dp"/>

            <!-- Email Input -->
            <com.google.android.material.textfield.TextInputEditText
                android:id="@+id/editEmail"
                android:layout_width="match_parent"
                android:layout_height="48dp"
                android:background="@drawable/bg_input_field"
                android:paddingHorizontal="16dp"
                android:inputType="textEmailAddress"
                android:hint="email@exemplo.com"
                android:textColor="@color/text_1"
                android:textColorHint="@color/text_3"
                android:fontFamily="@font/font_ibm_plex_sans"
                android:textSize="13sp"
                android:layout_marginBottom="20dp" />

            <!-- Password Label -->
             <TextView
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_marginStart="4dp"
                 android:layout_marginBottom="8dp"
                 android:fontFamily="@font/font_ibm_plex_sans"
                 android:text="Palavra-passe"
                 android:textColor="@color/text_1"
                 android:textSize="13sp"
                 android:textStyle="bold" />

            <!-- Password Input -->
            <com.google.android.material.textfield.TextInputEditText
                android:id="@+id/editPassword2"
                android:layout_width="match_parent"
                android:layout_height="48dp"
                android:background="@drawable/bg_input_field"
                android:paddingHorizontal="16dp"
                android:inputType="textPassword"
                android:hint="********"
                android:textColor="@color/text_1"
                android:textColorHint="@color/text_3"
                android:fontFamily="@font/font_ibm_plex_sans"
                android:textSize="13sp"
                android:layout_marginBottom="14dp" />

            <!-- Remember Me & Forgot Password -->
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:gravity="center_vertical"
                android:layout_marginBottom="28dp">

                <CheckBox
                    android:id="@+id/checkRememberMe"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:fontFamily="@font/font_ibm_plex_sans"
                    android:text="Lembrar"
                    android:buttonTint="@color/brand"
                    android:textColor="@color/text_2"
                    android:textSize="13sp"/>

                <View
                    android:layout_width="0dp"
                    android:layout_height="0dp"
                    android:layout_weight="1" />

                <TextView
                    android:id="@+id/txtForgotPassword"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:clickable="true"
                    android:focusable="true"
                    android:fontFamily="@font/font_ibm_plex_sans"
                    android:text="Esqueceu-se da palavra-passe?"
                    android:textColor="@color/text_2"
                    android:textSize="12sp"
                    android:textStyle="bold" />
            </LinearLayout>

            <!-- Login Button -->
            <com.google.android.material.button.MaterialButton
                android:id="@+id/btnLogin"
                android:layout_width="match_parent"
                android:layout_height="48dp"
                android:text="Login"
                android:textAllCaps="false"
                android:textSize="14sp"
                android:textStyle="bold"
                android:fontFamily="@font/font_ibm_plex_sans"
                android:textColor="@color/bg_base"
                app:backgroundTint="@color/brand"
                app:cornerRadius="8dp"
                android:layout_marginBottom="20dp" />

            <!-- Sign Up Link -->
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:gravity="center">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:fontFamily="@font/font_ibm_plex_sans"
                    android:text="Não tem uma conta? "
                    android:textColor="@color/text_2"
                    android:textSize="13sp" />

                <TextView
                    android:id="@+id/txtRegister"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:fontFamily="@font/font_ibm_plex_sans"
                    android:text="Criar Conta"
                    android:textColor="@color/brand"
                    android:textStyle="bold"
                    android:textSize="13sp"
                    android:clickable="true"
                    android:focusable="true"/>
            </LinearLayout>
            
            <!-- Usar sem conta -->
            <TextView
                android:id="@+id/txtGuestMode"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_horizontal"
                android:layout_marginTop="24dp"
                android:fontFamily="@font/font_ibm_plex_sans"
                android:text="Usar a app sem conta"
                android:textColor="@color/text_2"
                android:textStyle="bold"
                android:textSize="13sp"
                android:clickable="true"
                android:focusable="true"/>

         </LinearLayout>
    </ScrollView>

</androidx.constraintlayout.widget.ConstraintLayout>
