* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", "Inter", Arial, sans-serif;
  color: #1f2937;
  background:
    radial-gradient(1200px 600px at 20% -20%, #dbeafe 0%, transparent 60%),
    radial-gradient(1000px 500px at 120% 0%, #f5d0fe 0%, transparent 55%),
    #f8fafc;
}

.container { max-width: 760px; margin: 0 auto; padding: 18px; }
.container.wide { max-width: 1240px; }

.card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(2px);
  padding: 18px;
}

h1, h2 {
  margin-top: 0;
  margin-bottom: 10px;
  color: #0f172a;
}

h1 { font-size: clamp(28px, 6vw, 40px); letter-spacing: -0.6px; }
h2 { font-size: 18px; }

.lead { color: #475569; font-size: 15px; margin-bottom: 14px; }

.form-grid { display: grid; gap: 12px; }

fieldset {
  border: 1px solid #dbe4f2;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border-radius: 14px;
  padding: 12px;
  margin: 0;
}

legend {
  padding: 0 6px;
  color: #334155;
  font-weight: 700;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 600;
  font-size: 14px;
  color: #334155;
}

.field-hint {
  min-height: 16px;
  font-size: 12px;
  font-weight: 700;
  margin-top: -4px;
  padding-left: 2px;
}
.field-hint.ok { color: #15803d; }
.field-hint.error { color: #b91c1c; }

input, select, button, .button-link {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  padding: 11px 12px;
  font-size: 16px;
}

input, select {
  background: #fff;
  color: #0f172a;
  transition: border-color .2s, box-shadow .2s;
}

input:focus, select:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .18);
}

input.is-valid { border-color: #16a34a; }
input.is-invalid { border-color: #dc2626; }

button, .button-link {
  border: 0;
  color: #fff;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  box-shadow: 0 8px 14px rgba(37, 99, 235, .24);
  transition: transform .15s ease, box-shadow .15s ease;
}

button:hover, .button-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(37, 99, 235, .28);
}

.button-link { display: inline-block; }

.small-link {
  margin-top: 6px;
  padding: 7px 10px;
  font-size: 13px;
  border-radius: 10px;
}

.checkbox {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-weight: 500;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px;
}

.checkbox input { width: auto; margin-top: 3px; }

.consent-box {
  border: 1px solid #dbe4f2;
  border-radius: 12px;
  padding: 10px;
  background: linear-gradient(180deg, #f8fbff 0%, #f1f5f9 100%);
}

.consent-box pre {
  white-space: pre-wrap;
  font-size: 12px;
  line-height: 1.4;
  max-height: 90px;
  overflow: auto;
  margin: 0;
}

.ok, .error {
  border-radius: 12px;
  padding: 10px;
  border: 1px solid transparent;
}

.ok { color: #166534; background: #dcfce7; border-color: #86efac; }
.error { color: #991b1b; background: #fee2e2; border-color: #fca5a5; }

.note { font-size: 14px; color: #475569; }
.result-list { padding-left: 18px; }
.result-list.nested { margin-top: 6px; margin-bottom: 0; }

.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.inline-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.table-wrapper {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

table { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; }
th {
  background: #eff6ff;
  color: #1e3a8a;
  font-weight: 700;
}
th, td {
  border-bottom: 1px solid #e2e8f0;
  padding: 9px;
  text-align: left;
  vertical-align: top;
}

.inline-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inline-form select, .inline-form button { width: auto; }

.hidden { display: none; }

.minor-row { display: grid; gap: 10px; margin-bottom: 10px; }

.secondary-button {
  background: #eef2ff;
  color: #3730a3;
  border: 1px solid #818cf8;
  box-shadow: none;
}

.secondary-button:hover {
  box-shadow: none;
  transform: translateY(-1px);
}

.danger-button {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  box-shadow: 0 8px 14px rgba(185, 28, 28, .22);
}

.danger-button:hover {
  box-shadow: 0 10px 18px rgba(185, 28, 28, .28);
}

@media (min-width: 768px) {
  .card { padding: 26px; }
  .minor-row { grid-template-columns: 1fr 180px; align-items: end; }
}
