<header class="text-center mb-8">
  <h1 class="font-bold text-3xl text-white"><%= t('.title') %></h1>
</header>

<div class="bg-dark rounded-lg p-6 mb-8 border border-darkless">
  <p class="text-lg text-white mb-4">
    <%= raw t('.prompt', client_name: content_tag(:strong, class: 'text-primary') { @pre_auth.client.name }) %>
  </p>

  <% if @pre_auth.scopes.count > 0 %>
    <div id="oauth-permissions">
      <p class="text-sm text-white mb-3"><%= t('.able_to') %>:</p>

      <ul class="space-y-2">
        <% @pre_auth.scopes.each do |scope| %>
          <li class="flex items-center text-white">
            <span class="inline-block w-2 h-2 bg-primary rounded-full mr-3"></span>
            <%= t scope, scope: [:doorkeeper, :scopes] %>
          </li>
        <% end %>
      </ul>
    </div>
  <% end %>
</div>

<div class="space-y-3">
  <%= form_tag oauth_authorization_path, method: :post, class: "w-full" do %>
    <%= hidden_field_tag :client_id, @pre_auth.client.uid, id: nil %>
    <%= hidden_field_tag :redirect_uri, @pre_auth.redirect_uri, id: nil %>
    <%= hidden_field_tag :state, @pre_auth.state, id: nil %>
    <%= hidden_field_tag :response_type, @pre_auth.response_type, id: nil %>
    <%= hidden_field_tag :response_mode, @pre_auth.response_mode, id: nil %>
    <%= hidden_field_tag :scope, @pre_auth.scope, id: nil %>
    <%= hidden_field_tag :code_challenge, @pre_auth.code_challenge, id: nil %>
    <%= hidden_field_tag :code_challenge_method, @pre_auth.code_challenge_method, id: nil %>
    <%= submit_tag t('doorkeeper.authorizations.buttons.authorize'), class: "w-full px-4 py-3 bg-primary hover:bg-red-600 text-white font-bold rounded transition-colors cursor-pointer" %>
  <% end %>
  <%= form_tag oauth_authorization_path, method: :delete, class: "w-full" do %>
    <%= hidden_field_tag :client_id, @pre_auth.client.uid, id: nil %>
    <%= hidden_field_tag :redirect_uri, @pre_auth.redirect_uri, id: nil %>
    <%= hidden_field_tag :state, @pre_auth.state, id: nil %>
    <%= hidden_field_tag :response_type, @pre_auth.response_type, id: nil %>
    <%= hidden_field_tag :response_mode, @pre_auth.response_mode, id: nil %>
    <%= hidden_field_tag :scope, @pre_auth.scope, id: nil %>
    <%= hidden_field_tag :code_challenge, @pre_auth.code_challenge, id: nil %>
    <%= hidden_field_tag :code_challenge_method, @pre_auth.code_challenge_method, id: nil %>
    <%= submit_tag t('doorkeeper.authorizations.buttons.deny'), class: "w-full px-4 py-3 border-darkless bg-dark hover:bg-gray-600 border border-gray-600 text-gray-300 rounded transition-colors cursor-pointer" %>
  <% end %>
</div>
