/* Root, login, legal, and sitemap responsive family.
 * Loaded before responsive-system.css so global safety rules remain the final guardrail.
 */

.root-legal-page,
.root-sitemap-page {
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(circle at 8% 4%, rgba(125, 211, 252, 0.2), transparent 28rem),
    linear-gradient(180deg, #f4f9ff 0%, #ffffff 54%, #edf6ff 100%);
  color: #172033;
}

.root-legal-page .app-container {
  width: 100%;
  min-height: 100dvh;
  padding: clamp(1rem, 4vw, 3.75rem) var(--ui-page-gutter);
}

.root-legal-page .legal-container {
  inline-size: min(100%, 56.25rem);
  margin: 0 auto;
  padding: clamp(1.25rem, 3vw, 2.5rem);
  border: 1px solid rgba(91, 141, 191, 0.2);
  border-radius: clamp(1rem, 2vw, 1.5rem);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 1.25rem 3.5rem rgba(30, 74, 107, 0.1);
}

.root-legal-page .back-btn {
  display: inline-flex;
  min-height: 44px;
  margin-bottom: clamp(1rem, 3vw, 1.875rem);
  padding: 0.55rem 0.8rem;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid #d7e8f7;
  border-radius: 999px;
  background: #f4f9ff;
  color: #1e5f91;
  font-weight: 600;
  text-decoration: none;
  transition: color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.root-legal-page .back-btn:hover {
  background: #e8f4ff;
  color: #123e60;
  transform: translateX(-0.2rem);
}

.root-legal-page .legal-header {
  margin-bottom: clamp(1.75rem, 5vw, 2.5rem);
  padding-bottom: clamp(1rem, 3vw, 1.5rem);
  border-bottom: 1px solid #dcebf7;
  text-align: center;
}

.root-legal-page .legal-header h1 {
  margin: 0 0 0.5rem;
  color: #102f4a;
  font-size: clamp(1.75rem, 4.5vw, 2.5rem);
  font-weight: 800;
  line-height: 1.2;
  text-wrap: balance;
}

.root-legal-page .legal-header p {
  margin: 0;
  color: #668096;
}

.root-legal-page .legal-content {
  max-inline-size: var(--ui-reading-width);
  margin-inline: auto;
}

.root-legal-page .legal-content h2 {
  display: flex;
  margin: clamp(1.75rem, 4vw, 2.25rem) 0 0.75rem;
  align-items: flex-start;
  gap: 0.65rem;
  color: #1e5f91;
  font-size: clamp(1.15rem, 2.6vw, 1.5rem);
  font-weight: 700;
  line-height: 1.4;
}

.root-legal-page .legal-content h2 i {
  flex: 0 0 1.5rem;
  margin-top: 0.2em;
  text-align: center;
}

.root-legal-page .legal-content p,
.root-legal-page .legal-content li {
  margin: 0 0 0.9rem;
  color: #526779;
  font-size: clamp(0.95rem, 1.5vw, 1rem);
  line-height: 1.8;
}

.root-legal-page .legal-content ul,
.root-legal-page .legal-content ol {
  margin: 0 0 1.25rem;
  padding-inline-start: clamp(1.25rem, 4vw, 2rem);
}

.root-legal-page .legal-content a {
  color: #1268a5;
  text-underline-offset: 0.2em;
}

.root-legal-page .step-box {
  margin-bottom: 1.25rem;
  padding: clamp(1rem, 3vw, 1.25rem);
  border-inline-start: 0.25rem solid #2e83c5;
  border-radius: 0.875rem;
  background: #f2f8fd;
}

.root-legal-page .step-box > :last-child {
  margin-bottom: 0;
}

.root-login-page .login-page {
  min-height: 100dvh;
  height: auto;
  justify-content: safe center;
  padding:
    max(1rem, env(safe-area-inset-top, 0px))
    max(1rem, env(safe-area-inset-right, 0px))
    max(1rem, env(safe-area-inset-bottom, 0px))
    max(1rem, env(safe-area-inset-left, 0px));
}

.root-login-page .login-card {
  inline-size: min(100%, 26.25rem);
  max-inline-size: 100%;
  padding: clamp(1.25rem, 5vw, 2.25rem) clamp(1rem, 5vw, 2rem);
  border-radius: clamp(1.25rem, 4vw, 1.75rem);
}

.root-login-page .login-brand {
  max-inline-size: 100%;
  justify-content: center;
  text-align: center;
}

.root-login-page .login-brand-name,
.root-login-page .login-title,
.root-login-page .login-subtitle,
.root-login-page .oauth-browser-notice {
  overflow-wrap: anywhere;
}

.root-login-page .btn-toggle-pw {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
}

.root-sitemap-page {
  padding: clamp(1rem, 4vw, 3rem) var(--ui-page-gutter);
  font-family: 'Prompt', sans-serif;
}

.root-sitemap-page .sitemap-container {
  inline-size: min(100%, 56.25rem);
  margin: 0 auto;
  padding: clamp(1.25rem, 4vw, 2.5rem);
  border: 1px solid rgba(91, 141, 191, 0.2);
  border-radius: clamp(1rem, 2vw, 1.5rem);
  background: #fff;
  box-shadow: 0 1rem 3rem rgba(30, 74, 107, 0.1);
}

.root-sitemap-page .sitemap-container h1 {
  margin: 0 0 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #dcebf7;
  color: #102f4a;
  font-size: clamp(1.65rem, 4vw, 2.35rem);
  line-height: 1.25;
  text-wrap: balance;
}

.root-sitemap-page .sitemap-container ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0.5rem 0 1.25rem;
  padding: 0;
  gap: 0.625rem;
  list-style: none;
}

.root-sitemap-page .sitemap-container li {
  min-width: 0;
  margin: 0;
}

.root-sitemap-page .sitemap-container a {
  display: flex;
  min-height: 44px;
  padding: 0.7rem 0.85rem;
  align-items: center;
  border: 1px solid #dcebf7;
  border-radius: 0.75rem;
  background: #f7fbff;
  color: #1e5f91;
  font-size: clamp(0.9rem, 1.5vw, 1rem);
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
}

.root-sitemap-page .sitemap-container a:hover {
  border-color: #8fc5ed;
  background: #eaf6ff;
  color: #123e60;
}

.root-sitemap-page .section-title {
  margin-top: 1.5rem;
  color: #587084;
  font-weight: 700;
}

.root-home-page :where(#auth-modal-overlay, .checkin-modal-overlay) {
  padding:
    max(1rem, env(safe-area-inset-top, 0px))
    max(1rem, env(safe-area-inset-right, 0px))
    max(1rem, env(safe-area-inset-bottom, 0px))
    max(1rem, env(safe-area-inset-left, 0px));
  overflow-y: auto;
}

.root-home-page :where(.auth-modal, .checkin-modal) {
  inline-size: min(100%, 31.25rem) !important;
  max-inline-size: 100% !important;
  max-block-size: calc(100dvh - 2rem) !important;
  margin: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.root-home-page :where(.auth-close-btn, .checkin-close-btn, .close-menu) {
  min-width: 44px !important;
  min-height: 44px !important;
}

.root-home-page .home-category-chip {
  min-height: 44px;
}

.root-home-page .footer-links a,
.root-home-page .footer-social-new a {
  min-width: 44px;
  min-height: 44px;
}

@media (max-width: 48rem) {
  .root-legal-page .app-container,
  .root-sitemap-page {
    padding: var(--ui-page-gutter);
  }

  .root-legal-page .legal-container,
  .root-sitemap-page .sitemap-container {
    padding: clamp(1rem, 5vw, 1.5rem);
    border-radius: 1rem;
  }

  .root-sitemap-page .sitemap-container ul {
    grid-template-columns: 1fr;
  }

  .root-home-page .home-section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .root-home-page .home-section-link {
    align-self: stretch;
    justify-content: space-between;
  }
}

@media (max-width: 30rem) {
  .root-legal-page .legal-header {
    text-align: start;
  }

  .root-legal-page .legal-content h2 {
    gap: 0.5rem;
  }

  .root-login-page .login-page {
    justify-content: flex-start;
  }

  .root-login-page .login-brand {
    align-items: flex-start;
  }

  .root-login-page .login-brand-name {
    font-size: 1.1rem;
  }

  .root-home-page .quick-actions {
    gap: 0.5rem;
  }
}
