/* Shared legal document pages (EULA, Privacy Policy) — login blue theme */

body.legal-page {
  margin: 0;
  font-family: 'Noto Sans JP', sans-serif;
  background-image: linear-gradient(180deg, #8fc2e7f0 0%, #283890 100%);
  background-size: cover;
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: auto;
}

body.legal-page .header {
  margin-bottom: 24px;
  flex-shrink: 0;
}

body.legal-page .footer {
  margin-top: 24px;
  flex-shrink: 0;
}

.content.legal-content {
  position: relative;
  z-index: 2;
  width: min(960px, calc(100% - 32px));
  min-width: 0;
  min-height: 0;
  margin: 0 auto;
  padding: 0;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(40, 56, 144, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.legal-article {
  display: flex;
  flex-direction: column;
  padding: 0;
  height: min(82vh, 860px);
  max-height: 860px;
}

.legal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  background: linear-gradient(90deg, #283890 0%, #0f75bd 100%);
  color: #fff;
  flex-shrink: 0;
}

.legal-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.legal-logo {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  background: #fff;
  border-radius: 10px;
  padding: 6px;
  box-sizing: border-box;
}

.legal-heading {
  min-width: 0;
}

.legal-heading h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  color: #fff;
  text-align: left;
}

.legal-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.88);
}

.legal-meta {
  margin: 6px 0 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
}

.legal-meta-sep {
  margin: 0 6px;
}

.legal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.legal-lang {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  overflow: hidden;
}

.legal-lang button {
  margin: 0;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, color 0.15s ease;
}

.legal-lang button + button {
  border-left: 1px solid rgba(255, 255, 255, 0.22);
}

.legal-lang button:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.legal-lang button.active {
  background: #fff;
  color: #283890;
}

a.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

a.legal-back:hover {
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.55);
}

a.legal-back:active {
  transform: translateY(1px);
  background: rgba(255, 255, 255, 0.18);
}

.scrollable-card.legal-card {
  width: 100%;
  height: auto;
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px 32px;
  box-sizing: border-box;
  color: #1f2937;
  line-height: 1.65;
  font-size: 14px;
}

.legal-card::-webkit-scrollbar {
  width: 8px;
}

.legal-card::-webkit-scrollbar-thumb {
  background: #b7c7e8;
  border-radius: 8px;
}

.legal-card::-webkit-scrollbar-track {
  background: #f0f4fa;
}

.legal-doc-title {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid #e8eef8;
}

.legal-doc-title h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #283890;
}

.legal-doc-title h3 {
  margin: 6px 0 0;
  font-size: 15px;
  font-weight: 400;
  color: #0f75bd;
}

.legal-section {
  margin: 0 0 22px;
}

.legal-section-title {
  margin: 0 0 10px;
  padding: 8px 12px;
  font-size: 15px;
  font-weight: 700;
  color: #283890;
  background: #f0f5fc;
  border-left: 4px solid #283890;
  border-radius: 0 6px 6px 0;
}

.legal-subsection-title {
  margin: 14px 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: #0f75bd;
}

.legal-p {
  margin: 0 0 10px;
  color: #374151;
}

.legal-card ul {
  margin: 0 0 12px;
  padding-left: 22px;
}

.legal-card li {
  margin-bottom: 6px;
  color: #374151;
}

.legal-card b {
  color: #283890;
}

.legal-card a.caption,
.legal-card a {
  color: #0f75bd;
  font-size: inherit;
  text-decoration: none;
  word-break: break-word;
}

.legal-card a.caption:hover,
.legal-card a:hover {
  text-decoration: underline;
}

.legal-contact-row {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr;
  gap: 8px 16px;
  margin: 0 0 8px;
  padding: 10px 12px;
  background: #f7fafc;
  border-radius: 8px;
  border: 1px solid #e8eef8;
}

.legal-contact-label {
  font-weight: 700;
  color: #283890;
  font-size: 13px;
}

.legal-contact-value,
a.legal-contact-value {
  color: #374151;
  font-size: 13px;
  text-decoration: none;
  word-break: break-word;
}

a.legal-contact-value {
  color: #0f75bd;
}

a.legal-contact-value:hover {
  text-decoration: underline;
}

@media screen and (max-width: 768px) {
  body.legal-page .header {
    margin-bottom: 12px;
  }

  .content.legal-content {
    width: calc(100% - 20px);
    border-radius: 10px;
  }

  .legal-article {
    height: min(88vh, 900px);
  }

  .legal-top {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
  }

  .legal-heading h1 {
    font-size: 18px;
  }

  .legal-actions {
    width: 100%;
    justify-content: stretch;
  }

  .legal-lang {
    flex: 1;
  }

  .legal-lang button {
    flex: 1;
  }

  a.legal-back {
    flex: 1;
    justify-content: center;
  }

  .scrollable-card.legal-card {
    padding: 16px 16px 24px;
  }

  .legal-contact-row {
    grid-template-columns: 1fr;
  }
}
