<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:background="#121212">

    <!-- Tab bar -->
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="48dp"
        android:orientation="horizontal"
        android:background="#1E1E1E">

        <Button
            android:id="@+id/tab_browser"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:text="Browser Login"
            android:textSize="12sp"
            android:backgroundTint="#CC785C"
            android:textColor="#FFFFFF" />

        <Button
            android:id="@+id/tab_cookie"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:text="Paste Cookie"
            android:textSize="12sp"
            android:backgroundTint="#2A2A2A"
            android:textColor="#888888" />

    </LinearLayout>

    <!-- Browser login panel -->
    <LinearLayout
        android:id="@+id/panel_browser"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <WebView
            android:id="@+id/webView"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1" />

        <Button
            android:id="@+id/btn_done"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="I'm logged in — save session"
            android:backgroundTint="#CC785C"
            android:textColor="#FFFFFF"
            android:visibility="gone"
            android:layout_margin="12dp" />

    </LinearLayout>

    <!-- Manual cookie panel -->
    <LinearLayout
        android:id="@+id/panel_cookie"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:padding="20dp"
        android:visibility="gone">

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="Paste Session Cookie"
            android:textColor="#FFFFFF"
            android:textSize="18sp"
            android:textStyle="bold" />

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="12dp"
            android:text="1. Open Chrome on your phone\n2. Go to claude.ai and sign in\n3. Install the &quot;Cookie-Editor&quot; extension in Kiwi Browser, or use Firefox → Settings → Privacy → Cookies\n4. Find and copy the full cookie string for claude.ai\n5. Paste it below"
            android:textColor="#AAAAAA"
            android:textSize="13sp"
            android:lineSpacingExtra="4dp" />

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="20dp"
            android:text="Simpler: open claude.ai in browser → log in → come back here and tap the Browser Login tab — then tap 'I'm logged in'"
            android:textColor="#CC785C"
            android:textSize="12sp"
            android:lineSpacingExtra="3dp" />

        <EditText
            android:id="@+id/et_cookie"
            android:layout_width="match_parent"
            android:layout_height="120dp"
            android:layout_marginTop="20dp"
            android:hint="Paste cookie string here…"
            android:textColor="#FFFFFF"
            android:textColorHint="#555555"
            android:background="#1E1E1E"
            android:padding="12dp"
            android:gravity="top"
            android:inputType="textMultiLine"
            android:textSize="12sp" />

        <Button
            android:id="@+id/btn_save_cookie"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="16dp"
            android:text="Save and connect"
            android:backgroundTint="#CC785C"
            android:textColor="#FFFFFF" />

    </LinearLayout>

</LinearLayout>
