* { box-sizing: border-box; }

body.legal-accept-page,
body.legal-document-page {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Arial, sans-serif;
  color: #0f172a;
  background: #f3f6fb;
}

body.legal-accept-page {
  display: grid;
  place-items: center;
  padding: 28px 18px;
  background: linear-gradient(135deg, #1f4fa8 0%, #2f65d0 52%, #eef4ff 52%, #f8fafc 100%);
}

.legal-accept-card {
  width: min(880px, 100%);
  background: #fff;
  border: 1px solid #dbe5f3;
  border-radius: 24px;
  padding: 30px;
  box-shadow: 0 24px 55px rgba(15, 23, 42, .16);
}

.legal-accept-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  padding-bottom: 18px;
  margin-bottom: 24px;
  border-bottom: 1px solid #e2e8f0;
}

.legal-accept-brand img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.legal-accept-brand strong,
.legal-accept-brand span { display: block; }
.legal-accept-brand strong { color: #153f91; font-size: 16px; }
.legal-accept-brand span { margin-top: 4px; color: #64748b; font-size: 13px; }

.legal-eyebrow {
  margin: 0 0 6px;
  color: #2563eb;
  font-weight: 900;
  font-size: 12px;
  letter-spacing: .12em;
}

.legal-accept-heading h1,
.legal-setup-error h1 { margin: 0 0 8px; font-size: 28px; }
.legal-accept-heading > p:last-child,
.legal-setup-error p { margin: 0; color: #64748b; line-height: 1.6; }

.legal-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 22px 0;
}

.legal-summary-grid section {
  padding: 18px;
  border: 1px solid #dbe5f3;
  border-radius: 16px;
  background: #f8fbff;
}

.legal-summary-grid h2 { margin: 0 0 8px; font-size: 17px; color: #163f9f; }
.legal-summary-grid p { margin: 0 0 12px; color: #475569; line-height: 1.55; font-size: 14px; }
.legal-summary-grid a,
.legal-check-row a { color: #1d4ed8; font-weight: 800; text-decoration: none; }
.legal-summary-grid a:hover,
.legal-check-row a:hover { text-decoration: underline; }

.legal-accept-form {
  padding: 18px;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  background: #fff;
}

.legal-check-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  color: #334155;
  font-size: 14px;
  line-height: 1.5;
  cursor: pointer;
}

.legal-check-row input {
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin: 2px 0 0;
  accent-color: #1d4ed8;
}

.legal-primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  margin-top: 16px;
  padding: 10px 18px;
  border: 0;
  border-radius: 11px;
  background: #2458b8;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
}
.legal-primary-btn:hover { background: #1c4695; }

.legal-error,
.legal-setup-error {
  margin-top: 18px;
  padding: 16px;
  border-radius: 14px;
}
.legal-error { background: #fee2e2; color: #991b1b; font-weight: 700; }
.legal-setup-error { background: #fff; border: 1px solid #fecaca; }

.legal-decline-note { margin: 14px 0 4px; color: #64748b; font-size: 12px; line-height: 1.5; }
.legal-logout-link { color: #b91c1c; font-size: 13px; font-weight: 800; text-decoration: none; }

.legal-document-shell {
  width: min(920px, calc(100% - 28px));
  margin: 32px auto;
  background: #fff;
  border: 1px solid #dbe5f3;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(15, 23, 42, .08);
}

.legal-document-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 28px 32px;
  background: linear-gradient(135deg, #173b83, #2f65d0);
  color: #fff;
}
.legal-document-header img { width: 72px; height: 72px; object-fit: contain; background: #fff; border-radius: 16px; padding: 6px; }
.legal-document-header p { margin: 0 0 4px; font-weight: 700; color: #dbeafe; }
.legal-document-header h1 { margin: 0 0 6px; font-size: 29px; }
.legal-document-header span { color: #dbeafe; font-size: 13px; }

.legal-document-content { padding: 28px 32px 36px; }
.legal-document-content section { padding: 17px 0; border-bottom: 1px solid #e8eef6; }
.legal-document-content section:last-child { border-bottom: 0; }
.legal-document-content h2 { margin: 0 0 8px; color: #163f9f; font-size: 18px; }
.legal-document-content p { margin: 0; color: #475569; line-height: 1.7; font-size: 14px; }

.auth-legal-links {
  margin-top: 14px;
  text-align: center;
  color: #94a3b8;
  font-size: 12px;
}
.auth-legal-links a { color: #64748b; font-weight: 700; text-decoration: none; }
.auth-legal-links a:hover { color: #1e4fa8; text-decoration: underline; }
.auth-legal-links span { margin: 0 7px; }

.sidebar-legal-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px 8px;
  margin-top: auto;
  padding: 13px 4px 10px;
  color: rgba(255,255,255,.72);
  font-size: 11px;
}
.sidebar-legal-links a { color: rgba(255,255,255,.82); text-decoration: none; }
.sidebar-legal-links a:hover { color: #fff; text-decoration: underline; }

@media (max-width: 700px) {
  body.legal-accept-page { padding: 12px; background: #eef4ff; }
  .legal-accept-card { padding: 20px 16px; border-radius: 18px; }
  .legal-summary-grid { grid-template-columns: 1fr; }
  .legal-accept-heading h1, .legal-setup-error h1 { font-size: 23px; }
  .legal-document-shell { margin: 14px auto; }
  .legal-document-header { padding: 22px 18px; align-items: flex-start; }
  .legal-document-header img { width: 58px; height: 58px; }
  .legal-document-header h1 { font-size: 23px; }
  .legal-document-content { padding: 18px; }
}


/* Login Terms & Privacy agreement */
.login-legal-agreement {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 3px 0 14px;
  padding: 12px 13px;
  border: 1px solid #d7e1ef;
  border-radius: 12px;
  background: #f8fbff;
}

.wmc-auth-form .login-legal-agreement input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin: 1px 0 0;
  padding: 0;
  border-radius: 4px;
  accent-color: #2458b8;
  box-shadow: none;
}

.login-legal-copy {
  flex: 1;
  color: #475569;
  font-size: 13px;
  line-height: 1.45;
}

.wmc-auth-form .login-legal-copy label {
  display: inline;
  margin: 0;
  color: #475569;
  font-size: 13px;
  font-weight: 500;
}

.wmc-auth-form .legal-open-link {
  display: inline;
  width: auto;
  height: auto;
  margin: 0 0 0 3px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #1e4fa8;
  font: inherit;
  font-weight: 800;
  line-height: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.wmc-auth-form .legal-open-link:hover {
  background: transparent;
  color: #163f91;
}

body.legal-modal-open {
  overflow: hidden;
}

.legal-modal[hidden] {
  display: none !important;
}

.legal-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 20px;
}

.legal-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .58);
  backdrop-filter: blur(2px);
}

.legal-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  max-height: min(82vh, 780px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #d9e2ef;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(15, 23, 42, .28);
}

.legal-modal-header {
  flex: 0 0 auto;
  padding: 20px 22px 17px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}

.legal-modal-school {
  margin: 0 0 4px;
  color: #2458b8;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.legal-modal-header h2 {
  margin: 0;
  color: #0f172a;
  font-size: 22px;
  line-height: 1.25;
}

.legal-modal-updated {
  margin: 5px 0 0;
  color: #64748b;
  font-size: 12px;
}

.legal-modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 20px 22px;
  scroll-behavior: smooth;
}

.legal-modal-section-title {
  margin: 0 0 8px;
  color: #1e4fa8;
  font-size: 18px;
  font-weight: 900;
}

.legal-modal-section-gap {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 2px solid #e5edf8;
}

.legal-modal-body section {
  padding: 11px 0;
  border-bottom: 1px solid #edf2f7;
}

.legal-modal-body section:last-child {
  border-bottom: 0;
}

.legal-modal-body h3 {
  margin: 0 0 6px;
  color: #1e3a6d;
  font-size: 14px;
}

.legal-modal-body p {
  margin: 0;
  color: #475569;
  font-size: 13px;
  line-height: 1.65;
}

.legal-modal-footer {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  padding: 14px 22px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

.legal-done-btn {
  min-width: 110px;
  min-height: 42px;
  padding: 9px 18px;
  border: 0;
  border-radius: 10px;
  background: #2f5fbe;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.legal-done-btn:hover {
  background: #244fa5;
}

@media (max-width: 600px) {
  .legal-modal { padding: 10px; }
  .legal-modal-dialog { max-height: 90vh; border-radius: 15px; }
  .legal-modal-header { padding: 17px 16px 14px; }
  .legal-modal-header h2 { font-size: 19px; }
  .legal-modal-body { padding: 16px; }
  .legal-modal-footer { padding: 12px 16px; }
  .legal-done-btn { width: 100%; }
}
