<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>EstatesBase - Coming Soon</title>
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Spectral:wght@400;600;700&family=Outfit:wght@300;400;500;600&display=swap" rel="stylesheet">
    <style>
        *, *::before, *::after {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        html, body {
            height: 100%;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
        }

        body {
            font-family: 'Outfit', system-ui, sans-serif;
            background-color: #f5f7fa;
        }

        .page-wrapper {
            min-height: 100vh;
            background-color: #0B2750;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            position: relative;
            overflow: hidden;
            padding: 24px;
        }

        /* Subtle diagonal line pattern overlay */
        .page-wrapper::before {
            content: '';
            position: absolute;
            inset: 0;
            opacity: 0.04;
            background: repeating-linear-gradient(
                45deg,
                transparent,
                transparent 40px,
                rgba(255, 255, 255, 0.1) 40px,
                rgba(255, 255, 255, 0.1) 41px
            );
            pointer-events: none;
        }

        /* Top gradient accent bar */
        .top-bar {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 4px;
            background: linear-gradient(to right, #4B979B, #FAAB00, #4B979B);
            z-index: 10;
        }

        .content {
            position: relative;
            z-index: 1;
            text-align: center;
            max-width: 600px;
            width: 100%;
        }

        /* Logo */
        .logo {
            font-family: 'Spectral', Georgia, serif;
            font-size: 30px;
            font-weight: 600;
            margin-bottom: 6px;
        }

        .logo-estates {
            color: #ffffff;
        }

        .logo-base {
            color: #C58D0D;
        }

        /* Tagline */
        .tagline {
            font-family: 'Outfit', system-ui, sans-serif;
            font-size: 12px;
            font-weight: 400;
            color: rgba(255, 255, 255, 0.5);
            letter-spacing: 3px;
            text-transform: uppercase;
            margin-bottom: 48px;
        }

        /* Heading */
        .heading {
            font-family: 'Spectral', Georgia, serif;
            font-size: 48px;
            font-weight: 600;
            color: #ffffff;
            line-height: 1;
            margin-bottom: 20px;
        }

        /* Subtext */
        .subtext {
            font-family: 'Outfit', system-ui, sans-serif;
            font-size: 20px;
            font-weight: 400;
            color: rgba(255, 255, 255, 0.7);
            line-height: 28px;
            margin-bottom: 32px;
            max-width: 500px;
            margin-left: auto;
            margin-right: auto;
        }

        /* Form */
        .signup-form {
            display: flex;
            flex-direction: row;
            gap: 12px;
            max-width: 448px;
            margin: 0 auto 48px auto;
        }

        .signup-input {
            flex: 1;
            height: 50px;
            padding: 12px 16px;
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 4px;
            color: #ffffff;
            font-family: 'Outfit', system-ui, sans-serif;
            font-size: 16px;
            outline: none;
            transition: border-color 0.2s ease, background 0.2s ease;
        }

        .signup-input::placeholder {
            color: rgba(255, 255, 255, 0.5);
        }

        .signup-input:focus {
            border-color: rgba(255, 255, 255, 0.4);
            background: rgba(255, 255, 255, 0.15);
        }

        .signup-btn {
            height: 50px;
            padding: 12px 24px;
            background-color: #4B979B;
            color: #ffffff;
            font-family: 'Outfit', system-ui, sans-serif;
            font-size: 16px;
            font-weight: 500;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            transition: background-color 0.2s ease;
            white-space: nowrap;
        }

        .signup-btn:hover {
            background-color: #3d8286;
        }

        .signup-btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
        }

        /* Footer */
        .footer-text {
            font-family: 'Outfit', system-ui, sans-serif;
            font-size: 14px;
            color: rgba(255, 255, 255, 0.4);
        }

        /* Success / Error messages */
        .form-message {
            margin-top: 12px;
            font-size: 14px;
            font-family: 'Outfit', system-ui, sans-serif;
            min-height: 20px;
        }

        .form-message.success {
            color: #4B979B;
        }

        .form-message.error {
            color: #e74c3c;
        }

        /* Responsive */
        @media (max-width: 640px) {
            .heading {
                font-size: 32px;
                line-height: 1.1;
            }

            .subtext {
                font-size: 17px;
                line-height: 26px;
            }

            .signup-form {
                flex-direction: column;
            }

            .signup-input,
            .signup-btn {
                width: 100%;
            }
        }
    </style>
</head>
<body>
    <div class="page-wrapper">
        <div class="top-bar"></div>
        <div class="content">
            <div class="logo">
                <span class="logo-estates">Estates</span><span class="logo-base">Base</span>
            </div>
            <p class="tagline">Compliance &middot; Assets &middot; Evidence</p>

            <h1 class="heading">Something new is coming</h1>
            <p class="subtext">We're building the next generation of estate management for UK education. Be the first to know when we launch.</p>

            <form class="signup-form" id="signupForm" method="POST" action="submit.php">
                <input
                    type="email"
                    name="email"
                    class="signup-input"
                    placeholder="Your work email"
                    required
                    autocomplete="email"
                >
                <button type="submit" class="signup-btn" id="submitBtn">Notify me</button>
            </form>
            <div class="form-message" id="formMessage"></div>

            <p class="footer-text">&copy; 2026 EstatesBase. All rights reserved.</p>
        </div>
    </div>

    <script>
        document.getElementById('signupForm').addEventListener('submit', function(e) {
            e.preventDefault();

            var btn = document.getElementById('submitBtn');
            var msg = document.getElementById('formMessage');
            var email = this.email.value.trim();

            if (!email) return;

            btn.disabled = true;
            btn.textContent = 'Sending...';
            msg.className = 'form-message';
            msg.textContent = '';

            var xhr = new XMLHttpRequest();
            xhr.open('POST', 'submit.php', true);
            xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
            xhr.onreadystatechange = function() {
                if (xhr.readyState === 4) {
                    btn.disabled = false;
                    btn.textContent = 'Notify me';
                    try {
                        var resp = JSON.parse(xhr.responseText);
                        if (resp.success) {
                            msg.className = 'form-message success';
                            msg.textContent = resp.message;
                            document.getElementById('signupForm').reset();
                        } else {
                            msg.className = 'form-message error';
                            msg.textContent = resp.message;
                        }
                    } catch(err) {
                        msg.className = 'form-message error';
                        msg.textContent = 'Something went wrong. Please try again.';
                    }
                }
            };
            xhr.send('email=' + encodeURIComponent(email));
        });
    </script>
</body>
</html>
