/* Responsive layer, loaded after new-ui.css. See ~/claude-docs/keycloak-theme spec 2026-09-04. */

/* ── Layout ─────────────────────────────────────────────
   body stays a column flexbox, but centring moves from
   justify-content to auto margins on #container so content taller
   than the viewport scrolls instead of being clipped above the top. */
body {
  justify-content: flex-start;
  min-height: 100vh;
  min-height: 100svh;
}

#container {
  width: 100%;
  margin: auto;
  padding: 80px 16px 16px;
}

#card,
.instruction,
p.saml-post-form-message-text {
  --card-pad: clamp(20px, 4vw, 50px);
  max-width: min(1000px, 100%);
  padding-top: var(--card-pad);
  padding-left: var(--card-pad);
  padding-right: var(--card-pad);
}

#kc-login-form {
  width: 100%;
  max-width: 500px;
}

#kc-otp-login-form {
  width: 100%;
  max-width: 300px;
}

.form-input input {
  max-width: 100%;
}

.title-container,
.button-login,
.footer-container {
  width: 100%;
  max-width: 464px;
}

/* ── Actions ────────────────────────────────────────────
   new-ui.css sizes .form-actions to 25% × 2em. Let it size to its
   buttons, and give every button a 44px tap target. */
.form-actions,
.form-actions-custom {
  width: auto;
  max-width: 100%;
  height: auto;
  justify-content: flex-end;
}

.button,
.button.solid,
input[type="submit"] {
  min-height: 44px;
}

#kc-accept,
#kc-decline,
#kc-login {
  min-width: 120px;
}

/* Terms only: its action bar is the form directly inside #card. Keep it in
   view above the in-app browser toolbar while the terms text scrolls. */
#card > form.form-actions {
  position: sticky;
  bottom: 0;
  width: calc(100% + 2 * var(--card-pad));
  margin-left: calc(-1 * var(--card-pad));
  margin-right: calc(-1 * var(--card-pad));
  padding: 12px var(--card-pad) calc(12px + env(safe-area-inset-bottom));
}

/* ── Breakpoints ────────────────────────────────────────── */
@media (min-width: 1025px) {
  /* desktop: full-width bar, but buttons stay their own width */
  #card > form.form-actions #kc-accept,
  #card > form.form-actions #kc-decline {
    width: auto;
    flex: 0 0 auto;
  }
}

@media (max-width: 1024px) {
  /* iPad, either orientation */
  #container {
    padding-top: 72px;
  }
  .form-actions,
  .form-actions-custom {
    width: 100%;
  }
  .logo {
    height: 48px;
    margin: 8px 0 0 16px;
  }
  .text.primary {
    font-size: 1.6em;
  }
  #card h4 {
    font-size: 1.25rem;
  }
  #card h5 {
    font-size: 1rem;
  }
}

@media (max-width: 600px) {
  /* phone */
  #card,
  .instruction,
  p.saml-post-form-message-text {
    --card-pad: 16px;
    padding: 16px;
    border-radius: 12px;
  }
  .form-actions,
  .form-actions-custom {
    flex-direction: column;
  }
  .form-actions .button,
  .form-actions-custom .button {
    width: 100%;
  }
}

/* ── gamewarden-theme only: light card, so a light sticky bar and an outlined Decline. */
#card > form.form-actions {
  background: #fdfdfd;
}

#kc-decline {
  border: 1px solid #000;
  border-radius: 8px;
}
