<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>FEMPHA Emprende – Iniciar sesión</title>
    @vite(['resources/css/app.css', 'resources/js/app.js'])
    @livewireStyles
    <style>
        * { box-sizing: border-box; }
        body {
            margin: 0;
            min-height: 100vh;
            background-image: url('{{ asset("images/fondocs.jpeg") }}');
            background-size: cover;
            background-position: center;
            background-repeat: no-repeat;
            display: flex;
            align-items: center;
            justify-content: center;
            font-family: ui-sans-serif, system-ui, sans-serif;
        }
        body::before {
            content: '';
            position: fixed;
            inset: 0;
            background: rgba(0, 25, 60, 0.60);
            z-index: 0;
        }
        .wrap {
            position: relative;
            z-index: 1;
            width: 100%;
            padding: 1.5rem;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .card {
            background: #ffffff;
            border-radius: 1.75rem;
            box-shadow: 0 32px 80px rgba(0, 0, 0, 0.4);
            overflow: hidden;
            width: 100%;
            max-width: 460px;
        }

        /* Header azul */
        .card-header {
            background: linear-gradient(135deg, #002d6b 0%, #0055b3 100%);
            padding: 2.25rem 2.5rem 3rem;
            text-align: center;
            position: relative;
        }
        .card-header::after {
            content: '';
            position: absolute;
            bottom: 0; left: 0; right: 0;
            height: 1.75rem;
            background: #ffffff;
            border-radius: 1.75rem 1.75rem 0 0;
        }
        .card-header img {
            height: 3rem;
            object-fit: contain;
            position: relative;
            z-index: 1;
        }
        .card-header p {
            color: #93c5fd;
            font-size: 0.8rem;
            margin: 0.5rem 0 0;
            position: relative;
            z-index: 1;
            letter-spacing: 0.04em;
        }

        /* Cuerpo */
        .card-body {
            padding: 0.5rem 2.5rem 2.5rem;
        }
        .divider {
            width: 3rem;
            height: 4px;
            background: linear-gradient(90deg, #FF6600, #ff9944);
            border-radius: 2px;
            margin: 0 auto 1.5rem;
        }
        .card-body h2 {
            text-align: center;
            font-size: 1.25rem;
            font-weight: 700;
            color: #111827;
            margin: 0 0 2rem;
        }

        /* Labels */
        .field { margin-bottom: 1.25rem; }
        .field label {
            display: block;
            font-size: 0.7rem;
            font-weight: 700;
            color: #6b7280;
            text-transform: uppercase;
            letter-spacing: 0.07em;
            margin-bottom: 0.5rem;
        }

        /* Inputs */
        .input-wrap { position: relative; }
        .input-wrap svg {
            position: absolute;
            left: 1rem;
            top: 50%;
            transform: translateY(-50%);
            width: 1rem;
            height: 1rem;
            color: #9ca3af;
            pointer-events: none;
        }
        .input-wrap input {
            width: 100%;
            border: 1.5px solid #e5e7eb;
            border-radius: 0.75rem;
            padding: 0.8rem 1rem 0.8rem 2.75rem;
            font-size: 0.9rem;
            color: #1f2937;
            background: #f9fafb;
            transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
        }
        .input-wrap input:focus {
            outline: none;
            border-color: #0055b3;
            background: #fff;
            box-shadow: 0 0 0 3px rgba(0, 85, 179, 0.12);
        }

        /* Fila recordar / olvidé */
        .row-remember {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 1.75rem;
            margin-top: 0.25rem;
        }
        .row-remember label {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.8rem;
            color: #6b7280;
            cursor: pointer;
        }
        .row-remember input[type=checkbox] {
            width: 1rem;
            height: 1rem;
            accent-color: #0055b3;
            border-radius: 0.25rem;
        }
        .row-remember a {
            font-size: 0.8rem;
            color: #0055b3;
            font-weight: 600;
            text-decoration: none;
            transition: color 0.2s;
        }
        .row-remember a:hover { color: #FF6600; }

        /* Botón */
        .btn {
            display: block;
            width: 100%;
            padding: 0.9rem;
            background: linear-gradient(135deg, #FF6600, #e05500);
            color: #fff;
            border: none;
            border-radius: 0.875rem;
            font-size: 0.95rem;
            font-weight: 700;
            letter-spacing: 0.04em;
            cursor: pointer;
            box-shadow: 0 4px 16px rgba(255, 102, 0, 0.35);
            transition: all 0.2s;
        }
        .btn:hover {
            background: linear-gradient(135deg, #e05500, #cc4400);
            transform: translateY(-1px);
            box-shadow: 0 8px 24px rgba(255, 102, 0, 0.4);
        }
        .btn:active { transform: translateY(0); }

        /* Error */
        .error-box {
            background: #fef2f2;
            border: 1px solid #fecaca;
            border-radius: 0.75rem;
            padding: 0.75rem 1rem;
            margin-bottom: 1.25rem;
        }
        .error-box p {
            color: #dc2626;
            font-size: 0.8rem;
            margin: 0;
            display: flex;
            align-items: center;
            gap: 0.4rem;
        }

        /* Footer */
        .card-footer {
            text-align: center;
            font-size: 0.7rem;
            color: #d1d5db;
            margin-top: 1.75rem;
        }
    </style>
</head>
<body>
<div class="wrap">
    <div class="card">

        {{-- Header --}}
        <div class="card-header">
            <img src="{{ asset('images/logo.png') }}" alt="FEMPHA">
            <p>Portal Capital Semilla</p>
        </div>

        {{-- Body --}}
        <div class="card-body">
            <div class="divider"></div>
            <h2>Iniciar sesión</h2>

            @if ($errors->any())
            <div class="error-box">
                @foreach ($errors->all() as $error)
                <p><span>•</span> {{ $error }}</p>
                @endforeach
            </div>
            @endif

            @session('status')
            <div style="background:#f0fdf4;border:1px solid #bbf7d0;border-radius:.75rem;padding:.75rem 1rem;margin-bottom:1.25rem;font-size:.8rem;color:#15803d;">
                {{ $value }}
            </div>
            @endsession

            <form method="POST" action="{{ route('login') }}">
                @csrf

                <div class="field">
                    <label for="email">Correo electrónico</label>
                    <div class="input-wrap">
                        <svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
                                  d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"/>
                        </svg>
                        <input type="email" id="email" name="email"
                               value="{{ old('email') }}"
                               required autofocus autocomplete="username"
                               placeholder="correo@fempha.com.co">
                    </div>
                </div>

                <div class="field">
                    <label for="password">Contraseña</label>
                    <div class="input-wrap">
                        <svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
                                  d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"/>
                        </svg>
                        <input type="password" id="password" name="password"
                               required autocomplete="current-password"
                               placeholder="••••••••">
                    </div>
                </div>

                <div class="row-remember">
                    <label>
                        <input type="checkbox" name="remember">
                        Recordarme
                    </label>
                    @if (Route::has('password.request'))
                    <a href="{{ route('password.request') }}">¿Olvidaste tu contraseña?</a>
                    @endif
                </div>

                <button type="submit" class="btn">Ingresar al portal</button>
            </form>

            <p class="card-footer">© {{ date('Y') }} FEMPHA · Todos los derechos reservados</p>
        </div>
    </div>
</div>
@livewireScripts
</body>
</html>