<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Register as Member - Lakhsman Wellness</title>
    <style>
        :root { --brand:#4f46e5; --accent:#06b6d4; --line:#dbe4f0; --ink:#0f172a; --muted:#64748b; }
        * { box-sizing: border-box; }
        body {
            margin: 0;
            min-height: 100vh;
            font-family: "Manrope", "Segoe UI", sans-serif;
            color: var(--ink);
            background:
                radial-gradient(circle at 12% 12%, rgba(79,70,229,.14), transparent 35%),
                radial-gradient(circle at 90% 22%, rgba(6,182,212,.12), transparent 32%),
                #f8fafc;
            padding: 18px;
        }
        .shell {
            max-width: 1140px;
            margin: 0 auto;
            display: grid;
            grid-template-columns: 1.05fr 1.6fr;
            gap: 16px;
        }
        .left, .right {
            border-radius: 22px;
            border: 1px solid #e2e8f0;
            background: #fff;
            box-shadow: 0 24px 58px rgba(15,23,42,.12);
            overflow: hidden;
        }
        .left {
            background: linear-gradient(145deg,#312e81,#4f46e5 50%,#0891b2);
            color: #eef2ff;
            padding: 28px;
        }
        .left h1 { margin: 0 0 10px; font-size: clamp(1.4rem, 2.5vw, 2rem); }
        .left p { margin: 0; color: #dbeafe; line-height: 1.55; }
        .highlights { margin-top: 16px; display: grid; gap: 10px; }
        .highlight { border: 1px solid rgba(255,255,255,.25); border-radius: 12px; background: rgba(2,6,23,.2); padding: 10px 12px; font-size: 14px; }
        .right { padding: 24px; }
        .title { margin: 0; font-size: 1.65rem; font-weight: 800; }
        .subtitle { margin: 8px 0 16px; color: var(--muted); }
        .grid { display: grid; gap: 11px; grid-template-columns: repeat(2,minmax(0,1fr)); }
        .field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; color: #334155; }
        .field input, .field select {
            width: 100%;
            border: 1px solid var(--line);
            border-radius: 11px;
            padding: 10px 11px;
            font-size: 14px;
            outline: none;
            transition: .2s ease;
        }
        .field input:focus, .field select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79,70,229,.14); }
        .hint { margin-top: 4px; font-size: 11px; color: var(--muted); }
        .error { margin-top: 4px; font-size: 12px; color: #b91c1c; }
        .submit {
            margin-top: 14px;
            width: 100%;
            border: 0;
            border-radius: 12px;
            background: linear-gradient(135deg,var(--brand),var(--accent));
            color: #fff;
            font-size: 15px;
            font-weight: 800;
            padding: 12px;
            cursor: pointer;
        }
        .links { margin-top: 12px; font-size: 13px; color: var(--muted); display: grid; gap: 6px; }
        .links a { color: var(--brand); font-weight: 700; text-decoration: none; }
        .links a:hover { text-decoration: underline; }
        .made-by { margin-top: 14px; font-size: 12px; color: #64748b; }
        .made-by a { color: #0f172a; font-weight: 700; text-decoration: none; }
        .made-by a:hover { text-decoration: underline; }
        @media (max-width: 940px) {
            .shell { grid-template-columns: 1fr; }
            .grid { grid-template-columns: 1fr; }
        }
    </style>
</head>
<body>
    <div class="shell">
        <aside class="left">
            <h1>Register as Member</h1>
            <p>Create your distributor account and start building your Lakhsman Wellness network.</p>
            <div class="highlights">
                <div class="highlight">Use valid sponsor referral code (LW + 7 digits)</div>
                <div class="highlight">Choose left/right/auto placement safely</div>
                <div class="highlight">Access dashboard, wallet, team tree, and reports</div>
                <div class="highlight">Need franchise? <a href="{{ route('register.franchise') }}" style="color:#bfdbfe; font-weight:700;">Apply here</a></div>
            </div>
        </aside>

        <section class="right">
            <h2 class="title">Member Registration Form</h2>
            <div class="subtitle">Fill details carefully. Your login credentials will be created after successful registration.</div>

            <form method="post" action="{{ route('register.user.submit') }}">
                @csrf
                <div class="grid">
                    <div class="field">
                        <label for="name">Full Name</label>
                        <input id="name" name="name" value="{{ old('name') }}" required>
                        @error('name')<div class="error">{{ $message }}</div>@enderror
                    </div>
                    <div class="field">
                        <label for="mobile">Mobile Number</label>
                        <input id="mobile" name="mobile" value="{{ old('mobile') }}" required>
                        @error('mobile')<div class="error">{{ $message }}</div>@enderror
                    </div>
                    <div class="field">
                        <label for="email">Email (Optional)</label>
                        <input id="email" name="email" type="email" value="{{ old('email') }}">
                        @error('email')<div class="error">{{ $message }}</div>@enderror
                    </div>
                    <div class="field">
                        <label for="sponsor_code">Sponsor Referral Code</label>
                        <input id="sponsor_code" name="sponsor_code" value="{{ old('sponsor_code', request('sponsor')) }}" placeholder="LW1234567" required>
                        <div class="hint">Required format: LW + 7 digits</div>
                        @error('sponsor_code')<div class="error">{{ $message }}</div>@enderror
                    </div>
                    <div class="field">
                        <label for="placement_leg">Placement Leg</label>
                        @php $selectedLeg = old('placement_leg', request('leg')); @endphp
                        <select id="placement_leg" name="placement_leg" required>
                            <option value="left" {{ $selectedLeg === 'left' ? 'selected' : '' }}>Left</option>
                            <option value="right" {{ $selectedLeg === 'right' ? 'selected' : '' }}>Right</option>
                            <option value="auto" {{ $selectedLeg === 'auto' ? 'selected' : '' }}>Auto (Weak Leg)</option>
                        </select>
                        @error('placement_leg')<div class="error">{{ $message }}</div>@enderror
                    </div>
                    <div class="field">
                        <label for="password">Password</label>
                        <input id="password" type="password" name="password" required>
                        @error('password')<div class="error">{{ $message }}</div>@enderror
                    </div>
                    <div class="field">
                        <label for="password_confirmation">Confirm Password</label>
                        <input id="password_confirmation" type="password" name="password_confirmation" required>
                    </div>
                </div>

                <button class="submit" type="submit">Create Member Account</button>
            </form>

            <div class="links">
                <div>Already registered? <a href="{{ route('login.user') }}">Member Login</a></div>
                <div>Franchise partner? <a href="{{ route('login.franchise') }}">Franchise Login</a></div>
                <div>Back to website: <a href="{{ route('home') }}">Homepage</a></div>
            </div>

            <div class="made-by">
                Made By:
                <a href="https://akrsworld.in" target="_blank" rel="noopener noreferrer">AKRS WORLD (https://akrsworld.in)</a>
            </div>
        </section>
    </div>
</body>
</html>
