<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Authentication Configuration Warning - Rise</title>
    <link rel="icon" type="image/x-icon" href="/assets/favicon.ico">
    <link rel="icon" type="image/png" sizes="16x16" href="/assets/favicon-16x16.png">
    <link rel="icon" type="image/png" sizes="32x32" href="/assets/favicon-32x32.png">
    <style>
        :root {
            --bg: #111111;
            --panel: #141414;
            --line: #3a3a3a;
            --text: #ececec;
            --muted: #b8b8b8;
            --warn: #ffe3a8;
        }
        * { box-sizing: border-box; }
        body {
            margin: 0;
            min-height: 100vh;
            font-family: "IBM Plex Mono", ui-monospace, monospace;
            color: var(--text);
            background: radial-gradient(circle at 0 0, #202020 0%, #101010 40%), var(--bg);
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 1rem;
        }
        .card {
            width: 100%;
            max-width: 48rem;
            background: var(--panel);
            border: 1px solid #7a6d4a;
            padding: 1.2rem;
        }
        .logo {
            width: 2rem;
            height: 2rem;
            margin: 0 auto 0.75rem;
            background-color: currentColor;
            mask-size: contain;
            mask-repeat: no-repeat;
            mask-position: center;
            -webkit-mask-size: contain;
            -webkit-mask-repeat: no-repeat;
            -webkit-mask-position: center;
            mask-image: url(/assets/logo.svg);
            -webkit-mask-image: url(/assets/logo.svg);
        }
        .center { text-align: center; }
        h2 { margin: 0.2rem 0 0.9rem; font-size: 1.2rem; }
        .warn-box {
            border: 1px solid #7a6d4a;
            background: #1a1812;
            color: var(--warn);
            padding: 0.8rem;
            margin-bottom: 1rem;
        }
        .warn-box ul { margin: 0.5rem 0 0 1.1rem; }
        .mono-box {
            border: 1px solid var(--line);
            background: #1a1a1a;
            padding: 0.7rem;
            margin-bottom: 1rem;
        }
        .mono-code {
            color: var(--text);
            background: #111;
            border: 1px solid var(--line);
            padding: 0.1rem 0.35rem;
        }
        .muted { color: var(--muted); }
        .btn-row {
            display: flex;
            gap: 0.6rem;
            margin-top: 1rem;
        }
        .btn {
            flex: 1;
            text-align: center;
            border: 1px solid var(--line);
            background: #1a1a1a;
            color: var(--text);
            text-decoration: none;
            padding: 0.65rem 0.8rem;
        }
        @media (max-width: 700px) {
            .btn-row { flex-direction: column; }
        }
    </style>
</head>
<body>
    <div class="card">
        <div class="center">
            <div class="logo" aria-hidden="true"></div>
            <h2>Authentication Configuration Warning</h2>
        </div>

        <div class="warn-box">
            Authentication may not work correctly due to configuration issues:
            <ul>
                {% for warning in warnings %}
                <li>{{ warning }}</li>
                {% endfor %}
            </ul>
        </div>

        {% if project_name %}
        <div class="mono-box">
            <div class="muted">Project</div>
            <div><code class="mono-code">{{ project_name }}</code></div>
        </div>
        {% endif %}

        <div class="mono-box">
            <div class="muted" style="margin-bottom: 0.35rem;">Current Configuration</div>
            <div><span class="muted">Request from:</span> <code class="mono-code">{{ request_host }}</code></div>
            <div><span class="muted">Cookie domain:</span> <code class="mono-code">{{ cookie_domain }}</code></div>
            {% if redirect_host %}
            <div><span class="muted">Redirect to:</span> <code class="mono-code">{{ redirect_host }}</code></div>
            {% endif %}
        </div>

        <p class="muted">
            You may be able to continue, but authentication might fail or loop. If issues persist, contact your administrator.
        </p>

        <div class="btn-row">
            <a href="{{ continue_url }}" class="btn">Continue Anyway</a>
            <a href="/" class="btn">Go Back</a>
        </div>

        <p class="center muted" style="font-size:0.78rem; margin-top: 0.85rem;">
            This warning appears when cookie domain settings do not match the application domain.
        </p>
    </div>
</body>
</html>
