<?php
session_start();
include __DIR__ . '/includes/header.php';
include __DIR__ . '/includes/nav.php';

$sent = isset($_GET['sent']) && $_GET['sent'] == '1';
?>

<main class="content-area">

  <div class="smurf-divider"></div>

  <div class="content-wrapper">

    <section class="content-card center-text">
      <h1>Join the Almost Heaven Team</h1>
      <p>Apply to become part of Almost Heaven Radio.</p>
    </section>

    <div class="smurf-divider"></div>

    
    <?php if ($sent): ?>
      <section class="content-card center-text">
        <h2 style="color:#a6ff9e;">Your application has been sent! 🎉</h2>
        <p>Thank you — we’ve received it.</p>
      </section>
      <div class="smurf-divider"></div>
    <?php endif; ?>
    

    <section class="content-card">
      <div class="request-wrapper">
        <form method="post" action="send_join.php" enctype="multipart/form-data">
          <input type="hidden" name="return_to" value="<?= htmlspecialchars($_SERVER['REQUEST_URI'] ?? '/team.php') ?>">
<div class="request-box">
                <div class="request-field">
                    <label>Your Name</label>
                    <input type="text" class="request-input" name="name" required>
                </div>

                <div class="request-field">
                    <label>Your Email</label>
                    <input type="email" class="request-input" name="email" required>
                </div>
            </div>

            <div class="request-box">
                <div class="request-field">
                    <label>Role You're Interested In</label>
                    <input type="text" class="request-input" name="role" placeholder="DJ, Presenter, Producer, Social Media…" required>
                </div>

                <div class="request-field">
                    <label>Your Experience</label>
                    <input type="text" class="request-input" name="experience" placeholder="Beginner, Intermediate, Experienced" required>
                </div>
            </div>

            <div class="request-box">
                <div class="request-field">
                    <label>Why Do You Want to Join?</label>
                    <textarea class="request-textarea" name="why" required></textarea>
                </div>
            </div>

            <div class="request-box">
                <div class="request-field">
                    <label>Upload Demo Audio (optional)</label>
                    <input type="file" class="request-input" name="demo" accept="audio/*">
                </div>
            </div>

            <div class="request-box center-text">
                <button class="request-button">Submit Application 💼</button>
            </div>
        </form>
      </div>
    </section>

  </div>

  <div class="smurf-divider"></div>

</main>

<?php include __DIR__ . '/includes/footer.php'; ?>
