<?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:id="@+id/main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/colorPrimary"
    tools:context=".MainActivity">

    <ImageView
        android:id="@+id/imgBg"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scaleType="centerCrop"
        android:alpha="0.3"
        android:src="@drawable/na_mesa" />

    <LinearLayout
        android:id="@+id/header"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="80dp"
        android:gravity="center"
        android:orientation="vertical"
        app:layout_constraintTop_toTopOf="parent">

        <ImageView
            android:layout_width="80dp"
            android:layout_height="80dp"
            android:src="@drawable/na_mesa" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="16dp"
            android:fontFamily="sans-serif-black"
            android:text="NaMesa"
            android:textColor="@color/white"
            android:textSize="32sp" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Premium Dining Reservations"
            android:textColor="@color/white"
            android:alpha="0.7"
            android:textSize="14sp" />
    </LinearLayout>

    <com.google.android.material.card.MaterialCardView
        android:id="@+id/cardContainer"
        style="@style/Widget.NaMesa.Card"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginHorizontal="24dp"
        android:layout_marginBottom="48dp"
        app:cardBackgroundColor="@color/white"
        app:cardElevation="12dp"
        app:layout_constraintBottom_toBottomOf="parent">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:padding="24dp">

            <com.google.android.material.button.MaterialButtonToggleGroup
                android:id="@+id/toggleGroup"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="24dp"
                app:singleSelection="true"
                app:checkedButton="@+id/btnEntrar">

                <com.google.android.material.button.MaterialButton
                    android:id="@+id/btnEntrar"
                    style="@style/Widget.Material3.Button.OutlinedButton"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:text="Entrar" />

                <com.google.android.material.button.MaterialButton
                    android:id="@+id/btnCriarConta"
                    style="@style/Widget.Material3.Button.OutlinedButton"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:text="Registar" />

            </com.google.android.material.button.MaterialButtonToggleGroup>

            <com.google.android.material.textfield.TextInputLayout
                android:id="@+id/layoutName"
                style="@style/Widget.Material3.TextInputLayout.OutlinedBox"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="16dp"
                android:hint="Nome Completo"
                android:visibility="gone"
                app:startIconDrawable="@android:drawable/ic_menu_my_places">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/inputName"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:inputType="textPersonName" />
            </com.google.android.material.textfield.TextInputLayout>

            <com.google.android.material.textfield.TextInputLayout
                style="@style/Widget.Material3.TextInputLayout.OutlinedBox"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="16dp"
                android:hint="Email"
                app:startIconDrawable="@android:drawable/ic_dialog_email">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/inputEmail"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:inputType="textEmailAddress" />
            </com.google.android.material.textfield.TextInputLayout>

            <com.google.android.material.textfield.TextInputLayout
                style="@style/Widget.Material3.TextInputLayout.OutlinedBox"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="8dp"
                android:hint="Palavra-passe"
                app:endIconMode="password_toggle"
                app:startIconDrawable="@android:drawable/ic_lock_idle_lock">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/inputPassword"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:inputType="textPassword" />
            </com.google.android.material.textfield.TextInputLayout>

            <TextView
                android:id="@+id/txtForgotPassword"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="end"
                android:layout_marginBottom="24dp"
                android:text="Esqueceu-se da senha?"
                android:textColor="@color/colorPrimary"
                android:textSize="12sp"
                android:textStyle="bold" />

            <com.google.android.material.button.MaterialButton
                android:id="@+id/btnPrimaryAction"
                style="@style/Widget.NaMesa.Button"
                android:layout_width="match_parent"
                android:layout_height="60dp"
                android:text="Entrar"
                android:textSize="16sp" />

        </LinearLayout>
    </com.google.android.material.card.MaterialCardView>

</androidx.constraintlayout.widget.ConstraintLayout>