@extends('client.layouts.app')

@section('title', 'Профайл')
@section('page_title', 'Профайл')

@section('content')

@php $client = auth('client')->user(); @endphp

<form action="{{ route('client.profile.update') }}" method="POST" class="max-w-2xl bg-white rounded-2xl border border-gray-100 p-6 lg:p-8 space-y-5">
    @csrf @method('PUT')

    <h3 class="font-bold mb-4 pb-2 border-b border-gray-100">Үндсэн мэдээлэл</h3>

    <div class="grid md:grid-cols-2 gap-4">
        <div>
            <label class="block text-sm font-semibold mb-1">Нэр <span class="text-nsma-red">*</span></label>
            <input type="text" name="name" value="{{ old('name', $client->name) }}" required class="w-full px-4 py-3 border border-gray-200 rounded-lg outline-none">
        </div>
        <div>
            <label class="block text-sm font-semibold mb-1">Байгууллага</label>
            <input type="text" name="company_name" value="{{ old('company_name', $client->company_name) }}" class="w-full px-4 py-3 border border-gray-200 rounded-lg outline-none">
        </div>
    </div>

    <div class="grid md:grid-cols-2 gap-4">
        <div>
            <label class="block text-sm font-semibold mb-1">Утас <span class="text-nsma-red">*</span></label>
            <input type="tel" name="phone" value="{{ old('phone', $client->phone) }}" required class="w-full px-4 py-3 border border-gray-200 rounded-lg outline-none">
        </div>
        <div>
            <label class="block text-sm font-semibold mb-1">И-мэйл</label>
            <input type="email" value="{{ $client->email }}" disabled class="w-full px-4 py-3 border border-gray-200 rounded-lg bg-gray-50 text-gray-500">
        </div>
    </div>

    <div class="grid md:grid-cols-2 gap-4">
        <div>
            <label class="block text-sm font-semibold mb-1">Албан тушаал</label>
            <input type="text" name="position" value="{{ old('position', $client->position) }}" class="w-full px-4 py-3 border border-gray-200 rounded-lg outline-none">
        </div>
        <div>
            <label class="block text-sm font-semibold mb-1">Салбар</label>
            <input type="text" name="industry" value="{{ old('industry', $client->industry) }}" class="w-full px-4 py-3 border border-gray-200 rounded-lg outline-none">
        </div>
    </div>

    <div>
        <label class="block text-sm font-semibold mb-1">Вэбсайт</label>
        <input type="url" name="website" value="{{ old('website', $client->website) }}" class="w-full px-4 py-3 border border-gray-200 rounded-lg outline-none">
    </div>

    <div>
        <label class="block text-sm font-semibold mb-1">Хаяг</label>
        <textarea name="address" rows="2" class="w-full px-4 py-3 border border-gray-200 rounded-lg outline-none">{{ old('address', $client->address) }}</textarea>
    </div>

    <h3 class="font-bold mb-4 pb-2 border-b border-gray-100 pt-4">Нууц үг солих</h3>

    <div class="grid md:grid-cols-2 gap-4">
        <div>
            <label class="block text-sm font-semibold mb-1">Шинэ нууц үг</label>
            <input type="password" name="password" minlength="8" class="w-full px-4 py-3 border border-gray-200 rounded-lg outline-none">
        </div>
        <div>
            <label class="block text-sm font-semibold mb-1">Давтах</label>
            <input type="password" name="password_confirmation" class="w-full px-4 py-3 border border-gray-200 rounded-lg outline-none">
        </div>
    </div>
    <p class="text-xs text-gray-500">Хоосон үлдээвэл нууц үг өөрчлөгдөхгүй.</p>

    <div class="pt-4 border-t border-gray-100">
        <button class="bg-nsma-red text-white font-semibold px-6 py-3 rounded-lg hover:bg-red-600">Хадгалах</button>
    </div>
</form>

@endsection
