<?php
// Handle form submission
if ($_SERVER['REQUEST_METHOD'] === 'POST') {

    // NOTE:
    // Later you can save these values to database
    // For now, just capturing them is enough

    $school_name   = $_POST['school_name'] ?? '';
    $city          = $_POST['city'] ?? '';
    $state         = $_POST['state'] ?? '';
    $contact_name  = $_POST['contact_name'] ?? '';
    $designation   = $_POST['designation'] ?? '';
    $email         = $_POST['email'] ?? '';
    $phone         = $_POST['phone'] ?? '';
    $message       = $_POST['message'] ?? '';

    // After successful submit → redirect
    header("Location: registration_success.php");
    exit();
}
?>

<!DOCTYPE html>
<html>
<head>
    <title>School Registration | RS Learning Lab</title>
    <style>
        body {
            margin: 0;
            font-family: Arial, sans-serif;
            background: radial-gradient(circle at top, #020617, #0f172a);
            color: #e5e7eb;
        }
        .container {
            max-width: 520px;
            margin: 60px auto;
            background: #020617;
            padding: 40px;
            border-radius: 20px;
            box-shadow: 0 0 40px rgba(0,0,0,0.8);
        }
        h1 {
            text-align: center;
            margin-bottom: 10px;
        }
        .subtitle {
            text-align: center;
            font-size: 14px;
            color: #9ca3af;
            margin-bottom: 30px;
        }
        label {
            font-size: 14px;
            margin-top: 15px;
            display: block;
        }
        input, textarea {
            width: 100%;
            margin-top: 6px;
            padding: 12px;
            border-radius: 10px;
            border: none;
            background: #0f172a;
            color: #e5e7eb;
        }
        textarea {
            resize: none;
            height: 90px;
        }
        .row {
            display: flex;
            gap: 15px;
        }
        .row div {
            flex: 1;
        }
        .btn {
            margin-top: 30px;
            width: 100%;
            padding: 14px;
            border: none;
            border-radius: 999px;
            background: linear-gradient(135deg, #2563eb, #22c55e);
            color: #020617;
            font-weight: bold;
            cursor: pointer;
            font-size: 15px;
        }
        .btn:hover {
            opacity: 0.9;
        }
        .back {
            margin-top: 20px;
            text-align: center;
        }
        .back a {
            color: #60a5fa;
            text-decoration: none;
            font-size: 14px;
        }
    </style>
</head>
<body>

<div class="container">
    <h1>School Registration</h1>
    <div class="subtitle">
        Register your institution to begin a learning-first journey.
    </div>

    <form method="POST" action="register_school.php">

        <label>School Name</label>
        <input type="text" name="school_name" required>

        <div class="row">
            <div>
                <label>City</label>
                <input type="text" name="city" required>
            </div>
            <div>
                <label>State</label>
                <input type="text" name="state" required>
            </div>
        </div>

        <div class="row">
            <div>
                <label>Contact Person Name</label>
                <input type="text" name="contact_name" required>
            </div>
            <div>
                <label>Designation</label>
                <input type="text" name="designation" required>
            </div>
        </div>

        <div class="row">
            <div>
                <label>Email Address</label>
                <input type="email" name="email" required>
            </div>
            <div>
                <label>Contact Number</label>
                <input type="text" name="phone" required>
            </div>
        </div>

        <label>Message (Optional)</label>
        <textarea name="message" placeholder="Tell us about your requirements or expectations"></textarea>

        <button type="submit" class="btn">
            Submit School Registration
        </button>
    </form>

    <div class="back">
        <a href="index.php">← Back to Home</a>
    </div>
</div>

</body>
</html>
