<?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:paddingHorizontal="32dp"
    android:paddingVertical="16dp"
    tools:context=".ui.auth.LoginActivity">

    <!-- Title -->
    <TextView
        android:id="@+id/tv_login_title"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:text="@string/login"
        android:textAlignment="center"
        android:textSize="24sp"
        android:textStyle="bold"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toTopOf="@+id/tv_email_label"
        android:layout_marginBottom="48dp"
        android:paddingBottom="24dp"/>

    <!-- Email label -->
    <TextView
        android:id="@+id/tv_email_label"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:fontFamily="@font/dmsans_medium"
        android:text="@string/login_email"
        android:textSize="18sp"
        android:layout_marginVertical="8dp"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/tv_login_title"
        app:layout_constraintEnd_toEndOf="parent" />

    <!-- Email input -->
    <com.google.android.material.textfield.TextInputLayout
        android:id="@+id/til_login_email"
        style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginBottom="12dp"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/tv_email_label"
        app:layout_constraintEnd_toEndOf="parent">

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

    <!-- Password label-->
    <TextView
        android:id="@+id/tv_password_label"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:fontFamily="@font/dmsans_medium"
        android:text="@string/password"
        android:textSize="18sp"
        android:layout_marginVertical="8dp"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/til_login_email"
        app:layout_constraintEnd_toEndOf="parent" />

    <!-- Password input -->
    <com.google.android.material.textfield.TextInputLayout
        android:id="@+id/til_login_password"
        style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginBottom="12dp"
        app:passwordToggleEnabled="true"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/tv_password_label"
        app:layout_constraintEnd_toEndOf="parent">

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

    <!-- “Forgot password” link -->
    <TextView
        android:id="@+id/tv_forgetPassword"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:text="@string/forget_password"
        android:textAlignment="textEnd"
        android:textColor="@android:color/holo_red_light"
        android:layout_marginBottom="16dp"
        android:visibility="gone"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toBottomOf="@id/til_login_password" />

    <!-- Login button -->
    <com.google.android.material.button.MaterialButton
        android:id="@+id/btn_login"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:text="@string/login"
        app:cornerRadius="8dp"
        android:layout_marginVertical="16dp"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toBottomOf="@id/tv_forgetPassword" />

    <!-- “Don’t have an account?” row (kept as LinearLayout) -->
    <LinearLayout
        android:id="@+id/ll_signup_row"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:orientation="horizontal"
        android:layout_marginTop="16dp"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toBottomOf="@id/btn_login">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/no_account" />

        <TextView
            android:id="@+id/tv_registrasi"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/signup"
            android:textColor="@color/blue1"
            android:textStyle="bold" />
    </LinearLayout>

</androidx.constraintlayout.widget.ConstraintLayout>
