:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --ink: #222222;
  --muted: #6b7280;
  --line: #d1d5db;
  --brand: #1b6bb5;
  --brand-dark: #155a99;
  --brand-tint: #e4eff9;
  --error: #b91c1c;
  --ok: #047857;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  line-height: 1.5;
}

/* Light brand-tinted top bar carrying the official LegalNet logo. */
.topbar {
  background: var(--brand-tint);
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  border-bottom: 3px solid var(--brand);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo {
  height: 34px;
  width: auto;
  display: block;
}

.brand-divider {
  width: 1px;
  height: 26px;
  background: var(--line);
  margin: 0 14px;
}

.brand-page {
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 600;
}

/* On narrow screens, drop the divider + descriptor and keep just the logo. */
@media (max-width: 460px) {
  .brand-divider,
  .brand-page { display: none; }
}

.card {
  background: var(--card);
  width: 100%;
  max-width: 640px;
  margin: 32px auto;
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 8px 24px rgba(0, 0, 0, 0.06);
  padding: 32px;
}

.card h1 {
  margin: 0 0 8px;
  font-size: 1.5rem;
  color: var(--brand);
}

.subtitle {
  margin: 0 0 24px;
  color: var(--muted);
}

.row {
  display: flex;
  gap: 16px;
}

.row .field { flex: 1; }

.field {
  margin-bottom: 18px;
  border: none;
  padding: 0;
  min-width: 0;
}

fieldset.field { margin-bottom: 18px; }

legend {
  padding: 0;
  font-weight: 600;
}

label,
legend {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

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

input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

.hint {
  display: block;
  color: var(--muted);
  margin: 6px 0;
  font-size: 0.85rem;
}

.error {
  display: block;
  color: var(--error);
  font-size: 0.85rem;
  min-height: 1em;
  margin-top: 4px;
}

.repeat-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.repeat-row input { flex: 1; }

.remove {
  flex: 0 0 auto;
  width: 40px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

.remove:hover {
  border-color: var(--error);
  color: var(--error);
}

button.ghost {
  background: none;
  border: 1px dashed var(--line);
  color: var(--brand);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  margin-top: 4px;
}

button.ghost:hover { border-color: var(--brand); }

button.primary {
  width: 100%;
  margin-top: 8px;
  padding: 12px 16px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

button.primary:hover { background: var(--brand-dark); }

button.primary:disabled {
  opacity: 0.6;
  cursor: default;
}

.status {
  margin: 16px 0 0;
  font-size: 0.95rem;
  min-height: 1.2em;
}

.status.ok-status { color: var(--ok); }
.status.error-status { color: var(--error); }

/* Required-field marker + legend */
.req {
  color: var(--error);
  font-weight: 700;
}

.req-legend {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.85rem;
}

/* Success confirmation (shown after submit; form is hidden) */
.success-view {
  text-align: center;
  padding: 24px 8px;
}

.success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--ok);
  color: #fff;
  font-size: 1.9rem;
  line-height: 56px;
}

.success-view h2 {
  margin: 0 0 8px;
  color: var(--brand);
}

.success-view p {
  margin: 0 auto;
  max-width: 420px;
  color: var(--ink);
}

/* Footer */
.site-footer {
  max-width: 640px;
  margin: 0 auto 32px;
  padding: 0 8px;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
}

.site-footer p { margin: 4px 0; }

.footer-fine {
  font-size: 0.75rem;
  opacity: 0.85;
}

@media (max-width: 520px) {
  .row { flex-direction: column; gap: 0; }
  .card { padding: 24px; }
}
