{% extends base_template %}

{% block title %}{{ error_code }} | {{ brand_name }}{% endblock %}

{% block content %}

<style>
    .ens-error-wrapper {
        min-height: 72vh;
        display: flex;
        align-items: center;
        padding: 80px 0;
        position: relative;
        overflow: hidden;
        background:
            radial-gradient(circle at 12% 18%, rgba(251, 191, 36, 0.16), transparent 28%),
            radial-gradient(circle at 88% 12%, rgba(14, 165, 233, 0.13), transparent 30%),
            linear-gradient(135deg, #fffaf2 0%, #f8fbff 48%, #ffffff 100%);
    }

    .ens-error-card {
        position: relative;
        max-width: 880px;
        margin: 0 auto;
        border-radius: 34px;
        padding: 46px;
        background: rgba(255, 255, 255, 0.86);
        border: 1px solid rgba(255, 255, 255, 0.92);
        box-shadow:
            0 24px 70px rgba(15, 23, 42, 0.12),
            inset 0 1px 0 rgba(255,255,255,0.9);
        backdrop-filter: blur(18px);
    }

    .ens-error-badge {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 8px 14px;
        border-radius: 999px;
        font-size: 0.82rem;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        background: rgba(15, 23, 42, 0.06);
        color: #334155;
        margin-bottom: 20px;
    }

    .ens-error-code {
        font-size: clamp(4.6rem, 11vw, 8.5rem);
        line-height: 0.95;
        font-weight: 900;
        letter-spacing: -0.08em;
        margin-bottom: 16px;
        color: #0f172a;
    }

    .ens-error-title {
        font-size: clamp(2rem, 4vw, 3.2rem);
        font-weight: 850;
        letter-spacing: -0.04em;
        color: #0f172a;
        margin-bottom: 14px;
    }

    .ens-error-message {
        font-size: 1.08rem;
        color: #64748b;
        max-width: 680px;
        margin: 0 auto 10px;
        line-height: 1.75;
    }

    .ens-error-hint {
        font-size: 0.96rem;
        color: #94a3b8;
        margin-bottom: 28px;
    }

    .ens-error-actions {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-wrap: wrap;
        gap: 12px;
        margin-top: 28px;
    }

    .ens-error-primary-btn {
        border: 0;
        border-radius: 999px;
        padding: 13px 24px;
        font-weight: 800;
        background: #0f172a;
        color: #fff;
        text-decoration: none;
        box-shadow: 0 14px 30px rgba(15, 23, 42, 0.20);
        transition: all 0.25s ease;
    }

    .ens-error-primary-btn:hover {
        color: #fff;
        transform: translateY(-2px);
        box-shadow: 0 18px 36px rgba(15, 23, 42, 0.25);
    }

    .ens-error-secondary-btn {
        border-radius: 999px;
        padding: 12px 22px;
        font-weight: 700;
        color: #334155;
        background: rgba(255,255,255,0.72);
        border: 1px solid rgba(148, 163, 184, 0.35);
        text-decoration: none;
        transition: all 0.25s ease;
    }

    .ens-error-secondary-btn:hover {
        color: #0f172a;
        background: #fff;
        transform: translateY(-2px);
    }

    .error-theme-expat .ens-error-code {
        color: #0f3d3e;
    }

    .error-theme-rental .ens-error-code {
        color: #1e3a8a;
    }

    .error-theme-dating .ens-error-code {
        color: #be185d;
    }

    .error-theme-service .ens-error-code {
        color: #075985;
    }

    .error-theme-affiliates .ens-error-code {
        color: #92400e;
    }

    .error-theme-property .ens-error-code {
        color: #064e3b;
    }

    .error-theme-hosting .ens-error-code {
        color: #7c2d12;
    }

    @media (max-width: 767px) {
        .ens-error-wrapper {
            padding: 54px 16px;
        }

        .ens-error-card {
            padding: 34px 22px;
            border-radius: 26px;
        }

        .ens-error-actions {
            flex-direction: column;
        }

        .ens-error-primary-btn,
        .ens-error-secondary-btn {
            width: 100%;
            text-align: center;
        }
    }
</style>

<section class="ens-error-wrapper {{ theme_class }}">
    <div class="container">
        <div class="ens-error-card text-center">

            <div class="ens-error-badge">
                <i class="bi bi-shield-exclamation"></i>
                {{ brand_name }}
            </div>

            <div class="ens-error-code">
                {{ error_code }}
            </div>

            <h1 class="ens-error-title">
                {{ error_title }}
            </h1>

            <p class="ens-error-message">
                {{ error_message }}
            </p>

            <p class="ens-error-hint">
                {{ tagline }} — {{ error_hint }}
            </p>

            <div class="ens-error-actions">
                <a href="{{ home_url|default:'/' }}" class="ens-error-primary-btn">
                    <i class="bi bi-house-heart-fill me-2"></i>
                    {{ primary_label }}
                </a>

                <a href="javascript:history.back()" class="ens-error-secondary-btn">
                    <i class="bi bi-arrow-left me-2"></i>
                    Go Back
                </a>
            </div>

        </div>
    </div>
</section>

{% endblock %}