<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="UTF-8">
    <title>Preview Data Pendaftaran</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <!-- Bootstrap -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">

    <style>
        body{
            background:#f4f6fb;
        }
        .card{
            border-radius:20px;
            box-shadow:0 10px 25px rgba(0,0,0,.08);
        }
        .label{
            width:35%;
            font-weight:600;
        }
    </style>
</head>
<body>

<div class="container my-5">
    <div class="card p-4">

        <h4 class="text-center fw-bold text-primary mb-4">
            PREVIEW DATA PENDAFTARAN
        </h4>

        <p class="text-center text-muted">
            Silakan periksa kembali data Anda sebelum dikirim
        </p>

        <table class="table table-bordered">
            <tr><td class="label">Nama Lengkap</td><td>{{ $data->nama_lengkap }}</td></tr>
            <tr><td class="label">No Telepon</td><td>{{ $data->no_telepon }}</td></tr>
            <tr><td class="label">NISN</td><td>{{ $data->nisn ?? '-' }}</td></tr>
            <tr><td class="label">Sekolah Asal</td><td>{{ $data->sekolah_asal ?? '-' }}</td></tr>
            <tr><td class="label">Tempat, Tanggal Lahir</td>
                <td>{{ $data->tempat_lahir }}, {{ $data->tanggal_lahir }}</td>
            </tr>
            <tr><td class="label">Jenis Kelamin</td><td>{{ $data->jenis_kelamin }}</td></tr>
            <tr><td class="label">Agama</td><td>{{ $data->agama }}</td></tr>
            <tr><td class="label">Alamat Murid</td><td>{{ $data->alamat_murid }}</td></tr>
            <tr><td class="label">Riwayat Penyakit</td><td>{{ $data->riwayat_penyakit ?? '-' }}</td></tr>

            <tr class="table-secondary">
                <td colspan="2"><strong>Data Orang Tua / Wali</strong></td>
            </tr>

            <tr><td class="label">Nama Ayah</td><td>{{ $data->nama_ayah ?? '-' }}</td></tr>
            <tr><td class="label">Pekerjaan Ayah</td><td>{{ $data->pekerjaan_ayah ?? '-' }}</td></tr>
            <tr><td class="label">Pendidikan Ayah</td><td>{{ $data->pendidikan_ayah ?? '-' }}</td></tr>
            <tr><td class="label">Penghasilan Ayah</td><td>{{ $data->penghasilan_ayah ?? '-' }}</td></tr>
            <tr><td class="label">Nama Ibu</td><td>{{ $data->nama_ibu ?? '-' }}</td></tr>
            <tr><td class="label">Pekerjaan Ibu</td><td>{{ $data->pekerjaan_ibu ?? '-' }}</td></tr>
            <tr><td class="label">Pendidikan Ibu</td><td>{{ $data->pendidikan_ibu ?? '-' }}</td></tr>
            <tr><td class="label">Penghasilan Ibu</td><td>{{ $data->penghasilan_ibu ?? '-' }}</td></tr>
            <tr><td class="label">Alamat Orang Tua</td><td>{{ $data->alamat_orangtua ?? '-' }}</td></tr>
            <tr><td class="label">No Telepon Orang Tua</td><td>{{ $data->telepon_orangtua ?? '-' }}</td></tr>
            <tr><td class="label">Nomor KIP</td><td>{{ $data->nomor_kip ?? '-' }}</td></tr>

            <tr class="table-secondary">
                <td colspan="2"><strong>Pilihan Jurusan</strong></td>
            </tr>

            <tr><td class="label">Jurusan</td><td>{{ $data->jurusan }}</td></tr>
        </table>

        <div class="d-flex justify-content-between mt-4">
            <a href="{{ route('daftar') }}" class="btn btn-secondary">
                ⬅ Kembali Edit Data
            </a>

            <form action="{{ route('daftar.store') }}" method="POST">
                @csrf
                @foreach($data->all() as $key => $value)
                    <input type="hidden" name="{{ $key }}" value="{{ $value }}">
                @endforeach

                <button type="submit" class="btn btn-success">
                    ✔ Simpan & Kirim Pendaftaran
                </button>
            </form>
        </div>

    </div>
</div>

</body>
</html>
