/* ═══ Legal Widgets (Privacy Policy, Refund Policy, TOS) ═══ */

/* Full screen overlay */
[id$="Overlay"] {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: var(--c-bg);
  display: flex;
  flex-direction: column;
  animation: legalIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Desktop: centered background */
@media (min-width: 768px) {
  [id$="Overlay"] {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    align-items: center;
    justify-content: center;
    padding: 20px;
  }
}

/* Header — close button on right */
.legal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--c-border);
  flex-shrink: 0;
  background: var(--c-bg);
  position: sticky;
  top: 0;
  z-index: 10;
  width: 100%;
}

@media (min-width: 768px) {
  .legal-header {
    max-width: 600px;
    margin: 0 auto;
    border-radius: 20px 20px 0 0;
    border-left: 1px solid var(--c-border2);
    border-right: 1px solid var(--c-border2);
    border-top: 1px solid var(--c-border2);
  }
}

/* Content */
.legal-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 24px 60px;
  scrollbar-width: none;
  width: 100%;
  background: var(--c-bg);
}

@media (min-width: 768px) {
  .legal-content {
    max-width: 600px;
    margin: 0 auto;
    border-radius: 0 0 20px 20px;
    border-left: 1px solid var(--c-border2);
    border-right: 1px solid var(--c-border2);
    border-bottom: 1px solid var(--c-border2);
    box-shadow: var(--shadow-lg);
  }
}

.legal-content::-webkit-scrollbar { display: none; }

.legal-title {
  font-family: var(--ff-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--c-text);
  letter-spacing: -0.02em;
}

.legal-back {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--c-surface2);
  border: 1px solid var(--c-border);
  color: var(--c-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s;
  margin-left: auto;
}

.legal-back:hover { background: var(--c-surface3); }

.legal-date {
  display: inline-block;
  font-size: 12px;
  color: var(--c-muted2);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  padding: 6px 12px;
  border-radius: 8px;
  margin-bottom: 28px;
}

.legal-content h3 {
  font-family: var(--ff-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--c-accent);
  margin: 28px 0 10px;
}

.legal-content h3:first-of-type { margin-top: 0; }

.legal-content p {
  font-size: 14px;
  line-height: 1.75;
  color: var(--c-muted);
  margin: 8px 0;
}

.legal-content ul,
.legal-content ol {
  padding-left: 20px;
  margin: 10px 0;
}

.legal-content li {
  font-size: 14px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.55);
  margin: 5px 0;
}

.legal-content strong { color: var(--c-text); font-weight: 600; }

.legal-content a {
  color: var(--c-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

@keyframes legalIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
