:root {
  --legal-bg: #0f172a;
  --legal-panel: #182335;
  --legal-border: #34465d;
  --legal-primary: #38bdf8;
  --legal-text: #f8fafc;
  --legal-muted: #c2ccda;
}

* { box-sizing: border-box; }

body.legal-page {
  margin: 0;
  min-height: 100vh;
  background: var(--legal-bg);
  color: var(--legal-text);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.7;
}

.legal-shell { min-height: 100vh; display: flex; flex-direction: column; }
.legal-embedded { min-height: 0; }
.legal-embedded .legal-shell { min-height: 0; }
.legal-header { position: relative; padding: 26px 68px 12px; text-align: center; }
.legal-brand { color: var(--legal-primary); font-size: clamp(1.35rem, 3vw, 2rem); font-weight: 800; text-decoration: none; }
.legal-close { position: absolute; top: 18px; right: 20px; width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--legal-border); border-radius: 8px; background: var(--legal-panel); color: var(--legal-muted); cursor: pointer; font-size: 1.7rem; line-height: 1; }
.legal-close:hover { background: var(--legal-primary); border-color: var(--legal-primary); color: var(--legal-bg); }
.legal-close:focus-visible { outline: 2px solid var(--legal-primary); outline-offset: 2px; }
.legal-main { width: min(960px, calc(100% - 32px)); margin: 0 auto; flex: 1; padding: 18px 0 44px; }
.legal-embedded-main { width: 100%; padding: 0; }
.legal-card { background: linear-gradient(145deg, #1b293d 0%, var(--legal-panel) 100%); border: 1px solid var(--legal-border); border-radius: 10px; padding: clamp(24px, 4vw, 44px); box-shadow: 0 18px 42px rgb(0 0 0 / 0.24), inset 0 1px 0 rgb(255 255 255 / 0.025); }
.legal-embedded-main .legal-card { min-height: 100%; border: 0; border-radius: 0; box-shadow: none; background: #172236; padding: 30px clamp(22px, 4vw, 44px) 34px; }
.legal-card h1 { color: var(--legal-primary); font-size: clamp(1.55rem, 4vw, 2.2rem); line-height: 1.25; letter-spacing: .01em; margin: 0 0 30px; padding-bottom: 18px; border-bottom: 1px solid rgb(148 163 184 / 0.2); }
.legal-card h2 { color: #7dd3fc; font-size: 1.02rem; letter-spacing: .035em; margin: 30px 0 10px; }
.legal-card p { margin: 0 0 17px; color: var(--legal-muted); font-size: .96rem; }
.legal-card ul { color: var(--legal-muted); margin: -4px 0 16px; padding-left: 24px; }
.legal-card a { color: var(--legal-primary); }
.legal-footer { padding: 30px 20px 22px; background: #1c1f2d; border-top: 1px solid var(--legal-border); }
.legal-footer-inner { width: min(1120px, 100%); margin: 0 auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; }
.legal-footer h2 { margin: 0 0 10px; color: var(--legal-primary); font-size: .9rem; letter-spacing: .04em; }
.legal-footer a, .legal-footer p { color: var(--legal-muted); font-size: .9rem; text-decoration: none; }
.legal-footer a:hover { color: #fff; text-decoration: underline; }
.legal-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.legal-footer-contact { margin-top: 18px; }
.legal-footer-bottom { width: min(1120px, 100%); margin: 26px auto 0; padding-top: 16px; border-top: 1px solid var(--legal-border); display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--legal-muted); font-size: .88rem; }
.legal-instagram { display: inline-flex; align-items: center; padding: 7px 12px; border-radius: 8px; background: #e1306c; color: #fff !important; font-weight: 700; white-space: nowrap; }
.legal-modal-open { overflow: hidden; }
.legal-modal-backdrop { position: fixed; inset: 0; z-index: 120000; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgb(2 6 23 / 0.78); backdrop-filter: blur(2px); }
.legal-modal { position: relative; width: min(780px, 100%); max-height: min(86vh, 900px); overflow: hidden; background: #172236; border: 1px solid #40536b; border-radius: 14px; box-shadow: 0 28px 80px rgb(0 0 0 / 0.5), 0 0 0 1px rgb(56 189 248 / 0.04); }
.legal-modal-close { position: absolute; top: 12px; right: 14px; z-index: 1; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #52647a; border-radius: 7px; background: #223149; color: #d7e1ed; cursor: pointer; font-size: 1.45rem; line-height: 1; transition: background .18s ease, border-color .18s ease, color .18s ease; }
.legal-modal-close:hover { background: var(--legal-primary); border-color: var(--legal-primary); color: var(--legal-bg); }
.legal-modal-content { max-height: min(78vh, 820px); overflow: hidden; padding: 0; }
.legal-modal-frame { display: block; width: 100%; height: 320px; max-height: min(78vh, 820px); border: 0; background: var(--legal-bg); }
.legal-modal-content h1 { margin: 0 48px 26px 0; color: var(--legal-primary); font-size: clamp(1.4rem, 4vw, 2rem); line-height: 1.25; }
.legal-modal-content h2 { color: var(--legal-primary); font-size: 1.08rem; margin: 24px 0 8px; }
.legal-modal-content p, .legal-modal-content li { color: var(--legal-muted); }
.legal-modal-content p { margin: 0 0 15px; }
.legal-modal-content ul { margin-top: -4px; padding-left: 24px; }
@media (max-width: 700px) {
  .legal-header { padding-left: 58px; padding-right: 58px; }
  .legal-close { top: 12px; right: 12px; width: 38px; height: 38px; }
  .legal-footer-inner { grid-template-columns: 1fr; gap: 20px; }
  .legal-footer-bottom { align-items: flex-start; flex-direction: column; }
  .legal-modal-backdrop { padding: 10px; }
  .legal-modal, .legal-modal-content { max-height: 92vh; }
  .legal-modal-content { max-height: 86vh; }
}
