<?php session_start(); ?>
<!DOCTYPE html>
<html lang="he" dir="rtl">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>ShareIt - הרשמה</title>
    <link rel="stylesheet" href="../assets/css/main.css">
    <link rel="stylesheet" href="../assets/css/register.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
</head>
<body>

    <header>
        <div class="header-right">
            <a href="../index.php">
                <img src="../assets/img/logo.jpeg" alt="ShareIt Logo" class="header-logo">
            </a>
        </div>
        <div id="user-info">
            <a href="../login.php">כניסה</a>
        </div>
    </header>

    <main class="auth-wrapper">
        <div class="auth-container">
            <div class="hero-brand-name" style="color: #d63031; font-size: 3.5rem; font-weight: 900; margin-bottom: 10px;">ShareIt</div>
            <h1>הצטרפו לקהילה</h1>
            <p class="auth-subtitle">קהילה משתפת, חוסכת ויוצרת קיימות חברתית 🌍♻️</p>
            
            <form action="../api/auth_register.php" method="POST" id="registerForm" novalidate>
                
                <div class="form-row">
                    <div class="input-wrapper">
                        <input type="text" name="first_name" placeholder="שם פרטי *" required>
                    </div>
                    <div class="input-wrapper">
                        <input type="text" name="last_name" placeholder="שם משפחה *" required>
                    </div>
                </div>

                <div class="form-group">
                    <input type="email" id="email" name="email" placeholder="אימייל *" required>
                    <div class="error-bubble" id="email-error"></div>
                </div>

                <div class="form-group password-container">
                    <input type="password" name="password" id="password" placeholder="סיסמה * (8 תווים, אות ומספר)" required>
                    <i class="far fa-eye toggle-password" id="togglePassword"></i>
                    <div class="error-bubble" id="password-feedback"></div>
                </div>

                <div class="form-group password-container">
                    <input type="password" id="password_confirm" placeholder="אימות סיסמה *" required>
                    <i class="far fa-eye toggle-password" id="togglePasswordConfirm"></i>
                    <div class="error-bubble" id="confirm-feedback"></div>
                </div>

                <div class="form-group">
                    <input type="tel" name="phone" id="phone" placeholder="טלפון * (ספרות בלבד)" required>
                    <div class="error-bubble" id="phone-error"></div>
                </div>

                <h3 class="form-section-title">📍 כתובת למסירת אוכל</h3>
                <div class="address-grid">
                    <input type="text" name="city" placeholder="עיר *" required>
                    <input type="text" name="street" placeholder="רחוב *" required>
                    <input type="text" name="house_number" placeholder="מספר בית *" required>
                    <input type="text" name="apartment" placeholder="דירה">
                </div>

                <input type="hidden" name="formatted_address" id="formatted_address">
                <input type="hidden" name="lat" id="lat">
                <input type="hidden" name="lng" id="lng">

                <button type="submit" id="submit-btn" class="btn-primary" disabled>צרו חשבון והתחילו לשתף</button>
            </form>

            <div class="auth-footer-link">
                כבר יש לכם חשבון? <a href="../login.php">התחברו כאן</a>
            </div>
        </div>
    </main>

    <footer>
        <div class="footer-links">
            <a href="about.php">אודות</a> | <a href="#">צרו קשר</a> | <a href="#">שאלות תשובות</a>
        </div>
        <p>© 2026 ShareIt - פלטפורמה קהילתית לשיתוף מזון</p>
    </footer>

    <script src="../assets/js/register.js"></script>
</body>
</html> 