@extends('website.main')
@section('main-content')
    <section class="hero-wrap hero-wrap-2" style="background-image: url('{{ asset('assets/images/about_1.webp') }}');">
        <div class="overlay"></div>
        <div class="container">
            <div class="row no-gutters slider-text align-items-center justify-content-center">
                <div class="col-md-9 pt-5 text-center">
                    <p class="breadcrumbs">
                        <span class="mr-2">
                            <a href="{{ route('home') }}">Home <i class="fa fa-chevron-right"></i></a>
                        </span>
                        <span>Sign In <i class="fa fa-chevron-right"></i></span>
                    </p>
                    <h1 class="mb-0 bread">Sign in Here</h1>
                </div>
            </div>
        </div>
    </section>

    <!-- Custom Styling for Interactive & Attractive Inputs -->
    <style>
        .custom-registration .form-group {
            margin-bottom: 20px;
            /* Input fields ke darmiyan gaps */
        }

        .custom-registration .form-control {
            height: 52px;
            background: #f8f9fa;
            color: #495057;
            font-size: 15px;
            border-radius: 8px;
            box-shadow: none;
            border: 1px solid #e6e6e6;
            padding-left: 20px;
            padding-right: 20px;
            transition: all 0.3s ease;
        }

        .custom-registration .form-control:focus {
            background: #ffffff;
            border-color: #008BF9;
            /* Focus border color */
            box-shadow: 0 4px 12px rgba(0, 139, 249, 0.15);
            /* Soft Blue Glow */
            outline: none;
        }

        .custom-registration .btn-primary {
            height: 52px;
            border-radius: 8px;
            font-weight: 600;
            letter-spacing: 0.5px;
            text-transform: uppercase;
            font-size: 14px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
            transition: all 0.3s ease;
        }

        .custom-registration .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
        }

        .text-danger {
            color: #dc3545 !important;
            font-size: 14px;
            font-weight: 500;
            display: block;
            margin-top: 5px;
        }

        .is-invalid {
            border: 1px solid #dc3545 !important;
        }

        .alert-success {
            margin-bottom: 20px;
        }

        .alert-danger {
            margin-bottom: 20px;
        }

        /* Validation Error */

        .validation-error {
            color: #dc3545 !important;
            font-size: 14px;
            font-weight: 500;
            display: block;
            margin-top: 6px;
        }

        /* Invalid Input */

        .form-control.is-invalid {
            border: 1px solid #dc3545 !important;
            box-shadow: none !important;
        }

        /* Session Error */

        .alert-danger {
            background: #f8d7da;
            color: #842029;
            border: 1px solid #f5c2c7;
            padding: 12px 15px;
            border-radius: 6px;
            margin-bottom: 20px;
        }

        /* Session Success */
        .alert-success {
            background: #d1e7dd;
            color: #0f5132;
            border: 1px solid #badbcc;
            padding: 12px 15px;
            border-radius: 6px;
            margin-bottom: 20px;
        }
    </style>

    <section class="ftco-section bg-light custom-registration">
        <div class="container">
            <div class="row no-gutters justify-content-center">
                <div class="col-md-12">
                    <div class="wrapper">
                        <div class="row g-0">

                            <!-- Login Form -->
                            <div class="col-lg-6">
                                <div class="contact-wrap w-100 p-md-5 p-4">

                                    <h3 class="mb-2">Sign In</h3>
                                    <p class="mb-4 text-muted">
                                        Login to your account
                                    </p>

                                    {{-- Success Message --}}
                                    @if (session('success'))
                                        <div class="alert alert-success">
                                            {{ session('success') }}
                                        </div>
                                    @endif

                                    {{-- Error Message --}}
                                    @if (session('error'))
                                        <div class="alert alert-danger">
                                            {{ session('error') }}
                                        </div>
                                    @endif

                                    <form action="{{ route('login.authenticate') }}" method="POST"
                                        class="appointment-form">

                                        @csrf

                                        <div class="row">

                                            <!-- Email or Phone -->
                                            <div class="col-md-12">
                                                <div class="form-group">

                                                    <input type="text" name="login" value="{{ old('login') }}"
                                                        class="form-control @error('login') is-invalid @enderror"
                                                        placeholder="Email Address or Phone Number">

                                                    @error('login')
                                                        <small class="validation-error">
                                                            {{ $message }}
                                                        </small>
                                                    @enderror

                                                </div>
                                            </div>

                                            <!-- Password -->
                                            <div class="col-md-12">
                                                <div class="form-group">

                                                    <input type="password" name="password"
                                                        class="form-control @error('password') is-invalid @enderror"
                                                        placeholder="Password">

                                                    @error('password')
                                                        <small class="validation-error">
                                                            {{ $message }}
                                                        </small>
                                                    @enderror

                                                </div>
                                            </div>

                                            <!-- Remember -->
                                            <div class="col-md-12 mb-3">
                                                <div class="d-flex justify-content-between align-items-center">

                                                    <div class="form-check">

                                                        <input class="form-check-input" type="checkbox" name="remember"
                                                            id="rememberMe">

                                                        <label class="form-check-label" for="rememberMe">
                                                            Remember Me
                                                        </label>

                                                    </div>

                                                    <a href="#">
                                                        Forgot Password?
                                                    </a>

                                                </div>
                                            </div>

                                            <!-- Login Button -->
                                            <div class="col-md-12">
                                                <button type="submit" class="btn btn-primary w-100" style=" background-color:#1F3044 ">
                                                    Login Now
                                                </button>
                                            </div>

                                            <!-- Register -->
                                            <div class="col-md-12 text-center mt-4">
                                                <p class="mb-0">
                                                    Don't have an account?
                                                    <a href="{{ route('register') }}">
                                                        Register Here
                                                    </a>
                                                </p>
                                            </div>

                                        </div>

                                    </form>

                                    <!-- Social -->
                                    <div class="w-100 social-media mt-5">
                                        <h3>Follow us here</h3>

                                        <p>
                                            <a href="#">Facebook</a>
                                            <a href="#">Twitter</a>
                                            <a href="#">Instagram</a>
                                            <a href="#">LinkedIn</a>
                                        </p>
                                    </div>

                                </div>
                            </div>

                            <!-- Google Map -->
                            <div class="col-lg-6 d-flex align-items-stretch">

                                <div id="map" class="bg-white w-100 h-100"
                                    style="min-height:400px;border-radius:8px;overflow:hidden;">

                                    <iframe
                                        src="https://www.google.com/maps/embed?pb=!1m14!1m8!1m3!1d11045.367991763966!2d46.685879!3d24.687493!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x3e2f03007eeb048f%3A0x54e1ed0ec3801b4d!2z2YXZg9iq2Kgg2YbYp9i12LEg2LnZitiz2Ykg2KfZhNis2KjZitmEINmE2YTZhdit2KfZhdin2Kkg2YjYp9mE2KfYs9iq2LTYp9ix2KfYqiDYp9mE2YLYp9mG2YjZhtmK2Kk!5e1!3m2!1sen!2seg!4v1785395989064!5m2!1sen!2seg"
                                        width="100%" height="100%" style="border:0;" allowfullscreen="" loading="lazy">
                                    </iframe>

                                </div>

                            </div>

                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
@endsection()
