:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background: #f3f5fb;
  color: #17203b;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 15% 10%, rgba(79, 70, 229, .10), transparent 31rem),
    #f3f5fb;
}

.acceptance-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
}

.acceptance-card {
  width: min(680px, 100%);
  padding: 34px;
  border: 1px solid #d9deed;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(30, 41, 79, .13);
}

.brand-row,
.document-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  color: #3730a3;
  font-size: 20px;
  font-weight: 800;
  text-decoration: none;
}

.logout-button,
.document-link {
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid #9aa7c3;
  border-radius: 10px;
  background: #fff;
  color: #243153;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.eyebrow {
  margin: 34px 0 7px;
  color: #4f46e5;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .14em;
}

h1 {
  margin: 0;
  color: #111827;
  font-size: clamp(28px, 6vw, 38px);
  line-height: 1.15;
}

.intro,
.choice-note,
.notice-box p {
  color: #4b5875;
  font-size: 16px;
  line-height: 1.65;
}

.document-row {
  margin: 26px 0 18px;
  padding: 18px;
  border: 1px solid #cbd5e1;
  border-radius: 13px;
  background: #f8fafc;
}

.document-row strong,
.document-row span { display: block; }
.document-row strong { font-size: 17px; }
.document-row span { margin-top: 5px; color: #64748b; font-size: 14px; }

.notice-box {
  padding: 17px 18px;
  border-left: 4px solid #0f8a78;
  border-radius: 10px;
  background: #effcf8;
}

.notice-box strong { color: #075e54; font-size: 16px; }
.notice-box p { margin: 7px 0 0; }
.notice-box a,
.acceptance-check a { color: #3730a3; font-weight: 750; }

.acceptance-check {
  margin-top: 24px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.5;
  cursor: pointer;
}

.acceptance-check input {
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  accent-color: #4f46e5;
}

.choice-note { margin: 15px 0 20px; font-size: 14px; }

.accept-button {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 11px;
  background: #4f46e5;
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

.accept-button:disabled { opacity: .48; cursor: not-allowed; }

.feedback {
  margin-bottom: 15px;
  padding: 12px 14px;
  border-radius: 9px;
  background: #fff2f2;
  color: #b42318;
  font-size: 15px;
  line-height: 1.45;
}

.feedback.success { background: #ecfdf3; color: #067647; }

.policy-dialog {
  width: min(900px, calc(100% - 32px));
  height: min(82vh, 780px);
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 18px;
  background: #fff;
  color: #17203b;
  box-shadow: 0 34px 100px rgba(15, 23, 42, .32);
}

.policy-dialog:not([open]) { display: none; }
.policy-dialog[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.policy-dialog::backdrop { background: rgba(15, 23, 42, .66); backdrop-filter: blur(3px); }

.policy-dialog-header {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 17px 22px;
  border-bottom: 1px solid #dce3ec;
  background: #fff;
}

.policy-dialog-kicker {
  display: block;
  margin-bottom: 2px;
  color: #4f46e5;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .14em;
}

.policy-dialog-header h2 {
  margin: 0;
  color: #111827;
  font-size: 21px;
  line-height: 1.25;
}

.policy-dialog-close {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid #cbd5e1;
  border-radius: 11px;
  background: #f8fafc;
  color: #334155;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.policy-dialog-body {
  overflow-y: auto;
  padding: 28px 30px 38px;
  background: #f8fafc;
  overscroll-behavior: contain;
}

.policy-dialog-body > h1 {
  margin: 0;
  color: #111827;
  font-size: clamp(25px, 4vw, 34px);
}

.policy-dialog-body h2 {
  margin: 30px 0 10px;
  color: #16213d;
  font-size: 18px;
  line-height: 1.35;
}

.policy-dialog-body p,
.policy-dialog-body li,
.policy-dialog-body td,
.policy-dialog-body th {
  color: #42516d;
  font-size: 15px;
  line-height: 1.7;
}

.policy-dialog-body p { margin: 9px 0; }
.policy-dialog-body ul { margin: 10px 0; padding-left: 24px; }
.policy-dialog-body .legal-meta { color: #64748b; font-size: 13px; }
.policy-dialog-body .legal-warning { padding: 13px 15px; border-left: 4px solid #f59e0b; border-radius: 8px; background: #fff8e7; color: #714a06; }
.policy-dialog-body .legal-note { padding: 13px 15px; border-left: 4px solid #0f8a78; border-radius: 8px; background: #eafbf6; color: #075e54; }
.policy-dialog-body table { width: 100%; margin: 14px 0; border-collapse: collapse; background: #fff; }
.policy-dialog-body th,
.policy-dialog-body td { padding: 11px 12px; border: 1px solid #d8e1e9; text-align: left; vertical-align: top; }
.policy-dialog-body th { background: #eef2f7; color: #243153; font-weight: 800; }

.policy-dialog-loading,
.policy-dialog-error {
  min-height: 260px;
  display: grid;
  place-items: center;
  color: #64748b;
  font-size: 15px;
  text-align: center;
}

.policy-dialog-error { align-content: center; gap: 5px; color: #b42318; }
.policy-dialog-error p { margin: 0; color: #64748b; }

.policy-dialog-footer {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 22px;
  border-top: 1px solid #dce3ec;
  background: #fff;
}

.policy-dialog-footer span { color: #64748b; font-size: 13px; }

.policy-dialog-done {
  min-width: 110px;
  min-height: 43px;
  border: 0;
  border-radius: 10px;
  background: #4f46e5;
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible { outline: 3px solid rgba(79, 70, 229, .27); outline-offset: 3px; }

@media (max-width: 560px) {
  .acceptance-card { padding: 24px 19px; border-radius: 15px; }
  .document-row { align-items: flex-start; flex-direction: column; }
  .document-link { width: 100%; text-align: center; }
  .policy-dialog { width: 100%; height: 100%; border: 0; border-radius: 0; }
  .policy-dialog-header { min-height: 68px; padding: 13px 15px; }
  .policy-dialog-header h2 { font-size: 18px; }
  .policy-dialog-body { padding: 22px 18px 32px; }
  .policy-dialog-body p,
  .policy-dialog-body li,
  .policy-dialog-body td,
  .policy-dialog-body th { font-size: 14px; }
  .policy-dialog-body table { display: block; overflow-x: auto; }
  .policy-dialog-footer { padding: 11px 15px; }
  .policy-dialog-footer span { display: none; }
  .policy-dialog-done { width: 100%; }
}
