{% from "govuk_frontend_jinja/components/error-summary/macro.html" import govukErrorSummary %}
{% from "common/partials/mhclg-header.html" import mhclgHeader %}

{% set assetPath = vite_asset('assets') %}

<!doctype html>
<html lang="en" class="govuk-template">
  <head>
    <meta charset="utf-8" />
    <title>Local SSO Stub Login - MHCLG Funding Service</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
    <meta name="theme-color" content="#0b0c0c" />
    {# We're pointing at the vite server used for local development here #}
    <link rel="stylesheet" href="{{ vite_asset('app/assets/main.scss') }}" type="text/css" />
    <script type="module" src="{{ vite_asset('app/assets/main.js') }}"></script>
    <link rel="icon" sizes="48x48" href="{{ assetPath | default('/assets', true) }}/images/favicon.ico" />
    <link rel="icon" sizes="any" href="{{ assetPath | default('/assets', true) }}/images/favicon.svg" type="image/svg+xml" />
    <link rel="mask-icon" href="{{ assetPath | default('/assets', true) }}/images/govuk-icon-mask.svg" color="{{ themeColor | default('#0b0c0c') }}" />
    {#- Hardcoded value of $govuk-black #}
    <link rel="apple-touch-icon" href="{{ assetPath | default('/assets', true) }}/images/govuk-icon-180.png" />
    <link rel="manifest" href="{{ assetPath | default('/assets', true) }}/manifest.json" />
  </head>

  <body class="govuk-template__body">
    <script>
      document.body.className += " js-enabled" + ("noModule" in HTMLScriptElement.prototype ? " govuk-frontend-supported" : "");
    </script>
    <a href="#main-content" class="govuk-skip-link" data-module="govuk-skip-link">Skip to main content</a>
    {{
      mhclgHeader(
        params={
          "homepageUrl": "#",
          "assetPath": assetPath
        },
        currentUser=current_user,
      )
    }}
    <div class="govuk-width-container">
      <main class="govuk-main-wrapper" id="main-content">
        <div class="govuk-grid-row">
          <div class="govuk-grid-column-two-thirds">
            {% if form.errors %}
              {{ govukErrorSummary(wtforms_errors(form)) }}
            {% endif %}

            <h1 class="govuk-heading-xl">Local SSO Stub Login</h1>

            <form method="post" novalidate>
              {{ form.csrf_token }}
              {{ form.email_address(params={"type": "email", "autocomplete": "email", "spellcheck": false }) }}
              {{ form.is_platform_admin }}
              {{ form.submit }}
            </form>
          </div>
        </div>
      </main>
    </div>
    <footer class="govuk-footer">
      <div class="govuk-width-container">
        <div class="govuk-footer__meta">
          <div class="govuk-footer__meta-item govuk-footer__meta-item--grow">
            <svg aria-hidden="true" focusable="false" class="govuk-footer__licence-logo" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 483.2 195.7" height="17" width="41">
              <path
                fill="currentColor"
                d="M421.5 142.8V.1l-50.7 32.3v161.1h112.4v-50.7zm-122.3-9.6A47.12 47.12 0 0 1 221 97.8c0-26 21.1-47.1 47.1-47.1 16.7 0 31.4 8.7 39.7 21.8l42.7-27.2A97.63 97.63 0 0 0 268.1 0c-36.5 0-68.3 20.1-85.1 49.7A98 98 0 0 0 97.8 0C43.9 0 0 43.9 0 97.8s43.9 97.8 97.8 97.8c36.5 0 68.3-20.1 85.1-49.7a97.76 97.76 0 0 0 149.6 25.4l19.4 22.2h3v-87.8h-80l24.3 27.5zM97.8 145c-26 0-47.1-21.1-47.1-47.1s21.1-47.1 47.1-47.1 47.2 21 47.2 47S123.8 145 97.8 145" />
            </svg>
            <span class="govuk-footer__licence-description">
              All content is available under the
              <a class="govuk-footer__link" href="https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/" rel="license">Open Government Licence v3.0</a>
              , except where otherwise stated
            </span>
          </div>
          <div class="govuk-footer__meta-item">
            <a class="govuk-footer__link govuk-footer__copyright-logo" href="https://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/uk-government-licensing-framework/crown-copyright/">
              © Crown copyright
            </a>
          </div>
        </div>
      </div>
    </footer>
  </body>
</html>
