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

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fillViewport="true">

        <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <ImageView
                android:id="@+id/logoNaMesa"
                android:layout_width="100dp"
                android:layout_height="100dp"
                android:src="@drawable/na_mesa"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent"
                android:layout_marginTop="50dp" />

            <TextView
                android:id="@+id/txtTitle"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="16dp"
                android:text="NaMesa"
                android:textColor="@color/colorTextPrimary"
                android:textSize="28sp"
                android:fontFamily="sans-serif-medium"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@id/logoNaMesa" />

            <TextView
                android:id="@+id/txtSub"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="6dp"
                android:text="Sistema de Reserva de Mesas"
                android:textColor="@color/colorTextSecondary"
                android:textSize="15sp"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@id/txtTitle" />

            <com.google.android.material.card.MaterialCardView
                android:id="@+id/cardContainer"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginHorizontal="24dp"
                android:layout_marginTop="32dp"
                android:layout_marginBottom="40dp"
                app:cardCornerRadius="24dp"
                app:cardElevation="8dp"
                app:cardBackgroundColor="@color/colorSurface"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@id/txtSub"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintVertical_bias="0.0">

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

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="50dp"
                        android:background="@drawable/bg_tabs"
                        android:orientation="horizontal"
                        android:padding="3dp">

                        <Button
                            android:id="@+id/btnCliente"
                            android:layout_width="0dp"
                            android:layout_height="match_parent"
                            android:layout_weight="1"
                            android:background="@drawable/btn_light"
                            android:text="Cliente"
                            android:textAllCaps="false"
                            android:textColor="#231F1F"
                            android:textSize="14sp" />

                        <Button
                            android:id="@+id/btnEstabelecimento"
                            android:layout_width="0dp"
                            android:layout_height="match_parent"
                            android:layout_weight="1"
                            android:background="@android:color/transparent"
                            android:text="Estabelecimento"
                            android:textAllCaps="false"
                            android:textColor="@color/colorTextSecondary"
                            android:textSize="14sp" />
                    </LinearLayout>

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="50dp"
                        android:layout_marginTop="16dp"
                        android:background="@drawable/bg_tabs"
                        android:orientation="horizontal"
                        android:padding="3dp">

                        <Button
                            android:id="@+id/btnEntrar"
                            android:layout_width="0dp"
                            android:layout_height="match_parent"
                            android:layout_weight="1"
                            android:background="@drawable/tab_selected"
                            android:text="Entrar"
                            android:textAllCaps="false"
                            android:textColor="#231F1F"
                            android:textSize="14sp" />

                        <Button
                            android:id="@+id/btnCriarConta"
                            android:layout_width="0dp"
                            android:layout_height="match_parent"
                            android:layout_weight="1"
                            android:background="@android:color/transparent"
                            android:text="Criar Conta"
                            android:textAllCaps="false"
                            android:textColor="@color/colorTextSecondary"
                            android:textSize="14sp" />
                    </LinearLayout>

                    <EditText
                        android:id="@+id/inputName"
                        android:layout_width="match_parent"
                        android:layout_height="54dp"
                        android:layout_marginTop="20dp"
                        android:background="@drawable/input_bg"
                        android:hint="O seu nome"
                        android:inputType="textPersonName"
                        android:paddingHorizontal="16dp"
                        android:visibility="gone" />

                    <EditText
                        android:id="@+id/inputEmail"
                        android:layout_width="match_parent"
                        android:layout_height="54dp"
                        android:layout_marginTop="20dp"
                        android:background="@drawable/input_bg"
                        android:hint="Email"
                        android:inputType="textEmailAddress"
                        android:paddingHorizontal="16dp" />

                    <EditText
                        android:id="@+id/inputOwnerPhone"
                        android:layout_width="match_parent"
                        android:layout_height="54dp"
                        android:layout_marginTop="16dp"
                        android:background="@drawable/input_bg"
                        android:hint="Telefone do proprietário"
                        android:inputType="phone"
                        android:paddingHorizontal="16dp"
                        android:visibility="gone" />

                    <EditText
                        android:id="@+id/inputEstablishmentName"
                        android:layout_width="match_parent"
                        android:layout_height="54dp"
                        android:layout_marginTop="16dp"
                        android:background="@drawable/input_bg"
                        android:hint="Nome do estabelecimento"
                        android:inputType="textCapWords"
                        android:paddingHorizontal="16dp"
                        android:visibility="gone" />

                    <EditText
                        android:id="@+id/inputEstablishmentEmail"
                        android:layout_width="match_parent"
                        android:layout_height="54dp"
                        android:layout_marginTop="16dp"
                        android:background="@drawable/input_bg"
                        android:hint="Email do estabelecimento"
                        android:inputType="textEmailAddress"
                        android:paddingHorizontal="16dp"
                        android:visibility="gone" />

                    <EditText
                        android:id="@+id/inputEstablishmentPhone"
                        android:layout_width="match_parent"
                        android:layout_height="54dp"
                        android:layout_marginTop="16dp"
                        android:background="@drawable/input_bg"
                        android:hint="Telefone do estabelecimento"
                        android:inputType="phone"
                        android:paddingHorizontal="16dp"
                        android:visibility="gone" />

                    <RelativeLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="16dp">

                        <EditText
                            android:id="@+id/inputPassword"
                            android:layout_width="match_parent"
                            android:layout_height="54dp"
                            android:background="@drawable/input_bg"
                            android:hint="Palavra-passe"
                            android:inputType="textPassword"
                            android:paddingStart="16dp"
                            android:paddingEnd="48dp" />

                        <ImageView
                            android:id="@+id/iconPasswordVisibility"
                            android:layout_width="48dp"
                            android:layout_height="54dp"
                            android:layout_alignParentEnd="true"
                            android:layout_centerVertical="true"
                            android:padding="12dp"
                            android:src="@drawable/ic_visibility_off"
                            android:clickable="true"
                            android:focusable="true"
                            android:background="?attr/selectableItemBackgroundBorderless" />
                    </RelativeLayout>
                    
                    <TextView
                        android:id="@+id/txtForgotPassword"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="12dp"
                        android:layout_gravity="end"
                        android:text="Esqueceu-se da palavra-passe?"
                        android:textColor="@color/colorPrimary"
                        android:textSize="14sp"
                        android:visibility="visible"
                        android:clickable="true"
                        android:focusable="true"/>

                    <com.google.android.material.button.MaterialButton
                        android:id="@+id/btnFinalCriarConta"
                        android:layout_width="match_parent"
                        android:layout_height="56dp"
                        android:layout_marginTop="24dp"
                        app:cornerRadius="14dp"
                        app:backgroundTint="@color/colorPrimary"
                        android:text="Entrar"
                        android:textAllCaps="false"
                        android:textSize="16sp"
                        android:textColor="@color/white" />
                </LinearLayout>
            </com.google.android.material.card.MaterialCardView>
        </androidx.constraintlayout.widget.ConstraintLayout>
    </ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>