:root {
  --brand: #2563eb;
  --brand-contrast: #ffffff;
  --text: #0f172a;
  --text-muted: #475569;
  --border: #e2e8f0;
  --bg: #f8fafc;
  --card: #ffffff;
  --error: #b91c1c;
  --success: #047857;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

body.embedded { background: transparent; }

a { color: var(--brand); }
a:hover { text-decoration: underline; }

.page {
  max-width: 560px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 28px;
}

body.embedded .card {
  box-shadow: none;
  padding: 24px 16px;
}

.legal-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  background: var(--card);
}

.back-link {
  margin: 0 0 20px;
  font-size: 14px;
}
.back-link a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 500;
}
.back-link a:hover { text-decoration: underline; }
.legal-page .back-link:last-child {
  margin: 32px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.legal-page h1 { font-size: 24px; margin: 0 0 4px; }
.legal-page h2 { font-size: 18px; margin: 28px 0 8px; }
.legal-page .meta { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }
.legal-page p { font-size: 16px; margin: 0 0 14px; }

.scope-notice {
  border-left: 4px solid var(--brand);
  background: color-mix(in srgb, var(--brand) 6%, white);
  padding: 14px 18px;
  border-radius: 6px;
  font-size: 15px;
  line-height: 1.55;
  margin: 0 0 28px;
  color: var(--text);
}
.scope-notice strong { color: var(--text); }
.scope-notice a { color: var(--brand); word-break: break-word; }

.brand-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  margin-bottom: 24px;
}

.brand-head img {
  max-height: 64px;
  max-width: 220px;
  object-fit: contain;
}

.brand-head h1 {
  font-size: 22px;
  margin: 0;
  letter-spacing: -0.01em;
}

.intro {
  color: var(--text-muted);
  font-size: 15px;
  text-align: center;
  margin: 0 0 20px;
}

form .field { margin-bottom: 16px; }

form label {
  display: block;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}

form .hint {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 2px;
}

input[type="text"],
input[type="tel"],
input[type="email"] {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent);
}

.consent {
  display: flex;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
  font-size: 15px;
  margin-top: 8px;
}

.consent input[type="checkbox"] {
  margin-top: 4px;
  width: 20px;
  height: 20px;
  accent-color: var(--brand);
  flex-shrink: 0;
}

.consent label {
  font-weight: 400;
  font-size: 15px;
  margin: 0;
  color: var(--text);
  line-height: 1.5;
}

button[type="submit"] {
  width: 100%;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 600;
  color: var(--brand-contrast);
  background: var(--brand);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 20px;
  transition: opacity 0.15s;
}

button[type="submit"]:hover:not(:disabled) { opacity: 0.92; }

button[type="submit"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.footer-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 20px;
  line-height: 1.4;
}

.status {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  display: none;
}

.status.error { background: #fee2e2; color: var(--error); display: block; }
.status.info { background: #ecfdf5; color: var(--success); display: block; }

.success-state {
  text-align: center;
  padding: 24px 12px;
}

.success-state .check {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #ecfdf5;
  color: var(--success);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 12px;
}

.success-state h2 { margin: 0 0 8px; font-size: 20px; }
.success-state p { color: var(--text-muted); margin: 0; }

.skeleton {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.skeleton .bar {
  background: #eef2f7;
  border-radius: 6px;
  height: 14px;
  animation: pulse 1.2s ease-in-out infinite;
}

.skeleton .bar.big { height: 28px; }

@keyframes pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 0.35; }
}

.error-state {
  text-align: center;
  padding: 32px 12px;
  color: var(--text-muted);
}

.error-state h2 { color: var(--text); margin: 0 0 8px; font-size: 20px; }

.hidden { display: none !important; }
