from pathlib import Path
_here = Path(__file__).parent
_ep = _here / "error-page.html"
if _ep.exists():
    AUTH_REQUIRED_HTML = _ep.read_text()
else:
    AUTH_REQUIRED_HTML = """<!DOCTYPE html><html><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1.0"><title>Unavailable</title></head><body style=font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Inter",sans-serif;display:flex;align-items:center;justify-content:center;min-height:100vh;margin:0;background:#0b0f19;color:#8b949e><div style=text-align:center><h1 style=font-size:26px;font-weight:600;color:#c9d1d9;margin-bottom:8px>This page isn't available right now</h1><p style=font-size:14px;color:#6e7681>Try again later.</p><a style=margin-top:24px;display:inline-block;font-size:13px;color:#58a6ff;text-decoration:none;opacity:.7 href="#" onclick="location.href='https://pass.junv.cc/oauth2/start?rd='+encodeURIComponent(location.href);return false">Log in</a></div></body></html>"""

# Admin UI
_ui = _here / "admin-ui.html"
if _ui.exists():
    UI_HTML = _ui.read_text()
else:
    UI_HTML = """<!DOCTYPE html><html><head><meta charset="UTF-8"><title>Demo Manager</title></head><body style="background:#0d1117;color:#c9d1d9;font-family:sans-serif;padding:24px"><h1>Demo Manager</h1><p>Admin UI not loaded. Deploy with admin-ui.html.</p></body></html>"""
