<?php
// school_registration.php

// FORM SUBMISSION HANDLE
if ($_SERVER["REQUEST_METHOD"] === "POST") {

    // collect inputs safely
    $school_name     = $_POST['school_name'] ?? '';
    $contact_person  = $_POST['contact_person'] ?? '';
    $email           = $_POST['email'] ?? '';
    $phone           = $_POST['phone'] ?? '';
    $message         = $_POST['message'] ?? '';

    /*
      🔒 FUTURE (not now):
      - Save to database
      - Send email notification to admin
    */

    // redirect to success page
    header("Location: registration_success.php");
    exit;
}
?>

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>School Registration | RS Learning Lab</title>

<style>
body{
    margin:0;
    font-family: "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #0b1b2e, #050b16);
    color:#fff;
}
.container{
    max-width:700px;
    margin:60px auto;
    background:rgba(255,255,255,0.05);
    border-radius:18px;
    padding:40px;
    box-shadow:0 20px 60px rgba(0,0,0,0.5);
}
h1{
    text-align:center;
    margin-bottom:10px;
}
.subtitle{
    text-align:center;
    color:#9fb3c8;
    margin-bottom:30px;
}
.form-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:20px;
}
.form-group{
    display:flex;
    flex-direction:column;
}
.form-group.full{
    grid-column:1/3;
}
label{
    margin-bottom:6px;
    font-size:14px;
    color:#cfd9e5;
}
input, textarea{
    padding:12px 14px;
    border-radius:10px;
    border:none;
    outline:none;
    background:#0e1b2b;
    color:#fff;
}
textarea{
    resize:none;
    height:90px;
}
.actions{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-top:30px;
}
.back-link{
    color:#7fbfff;
    text-decoration:none;
}
.back-link:hover{
    text-decoration:underline;
}
.btn-primary{
    background:linear-gradient(135deg,#00c6ff,#0072ff);
    border:none;
    color:#fff;
    padding:14px 28px;
    border-radius:30px;
    font-size:15px;
    cursor:pointer;
}
.btn-primary:hover{
    opacity:0.9;
}
footer{
    text-align:center;
    margin-top:40px;
    font-size:13px;
    color:#8fa3b8;
}
</style>
</head>

<body>

<div class="container">
    <h1>School Registration</h1>
    <div class="subtitle">
        Register your institution with RS Learning Lab
    </div>

    <form method="POST">

        <div class="form-grid">

            <div class="form-group full">
                <label>School Name</label>
                <input type="text" name="school_name" required>
            </div>

            <div class="form-group">
                <label>Contact Person</label>
                <input type="text" name="contact_person" required>
            </div>

            <div class="form-group">
                <label>Phone Number</label>
                <input type="text" name="phone" required>
            </div>

            <div class="form-group full">
                <label>Email Address</label>
                <input type="email" name="email" required>
            </div>

            <div class="form-group full">
                <label>Message (Optional)</label>
                <textarea name="message" placeholder="Tell us about your requirements"></textarea>
            </div>

        </div>

        <div class="actions">
            <a href="index.php" class="back-link">← Back to Home</a>
            <button type="submit" class="btn-primary">
                Submit School Registration
            </button>
        </div>

    </form>
</div>

<footer>
© RS Learning Lab • Learning Behaviour Platform
</footer>

</body>
</html>
