:root {
  --bg: #f5faff;
  --surface: #ffffff;
  --line: #d6e5f5;
  --text: #14324f;
  --muted: #4d6580;
  --brand: #1f75ff;
  --brand-dark: #0d2d58;
  --success: #0f8c5c;
  --danger: #b53b3b;
  --radius: 14px;
  --shadow: 0 16px 38px rgba(20, 50, 79, 0.1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 3%, rgba(86, 165, 235, 0.30) 0, transparent 36%),
    radial-gradient(circle at 94% 15%, rgba(87, 132, 106, 0.24) 0, transparent 33%),
    radial-gradient(circle at 72% 84%, rgba(149, 33, 206, 0.22) 0, transparent 28%),
    url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22180%22 height=%22180%22 viewBox=%220 0 180 180%22%3E%3Cg fill=%22none%22 stroke=%22%23bfd4e8%22 stroke-width=%221%22 opacity=%220.40%22%3E%3Cpath d=%22M0 30h180M0 90h180M0 150h180M30 0v180M90 0v180M150 0v180%22/%3E%3C/g%3E%3C/svg%3E"),
    var(--bg);
  background-attachment: scroll, scroll, scroll, fixed, scroll;
}

.container { width: min(1140px, 92vw); margin: 0 auto; }
.portal-header {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(8px);
  background: rgba(245, 250, 255, 0.94);
  border-bottom: 1px solid var(--line);
}
.header-wrap { display: flex; justify-content: space-between; align-items: center; min-height: 78px; gap: 12px; }
.brand-block {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.brand {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-decoration: none;
}

.brand img { width: clamp(170px, 23vw, 300px); height: auto; }

.brand-tagline {
  font-size: clamp(10px, 1vw, 13px);
  color: var(--brand-dark);
  line-height: 1.2;
  font-weight: 700;
  margin: 0;
  text-decoration: none;
}
.header-links { display: flex; gap: 8px; }

h1, h2, h3 { margin: 0 0 8px; line-height: 1.2; }
p { margin: 0 0 12px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(14px, 2.5vw, 22px);
}
.intro { margin: 16px 0; }

.eyebrow {
  display: inline-block;
  margin: 0 0 9px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e6f1ff;
  color: #0e4f93;
  font-size: 13px;
  font-weight: 700;
}

.grid { display: grid; gap: 12px; }
.grid.two { grid-template-columns: 1fr 1fr; }
.stack { display: grid; gap: 10px; }

label { display: grid; gap: 5px; font-weight: 700; color: var(--brand-dark); }
input, select, textarea, button { font: inherit; }
input, select, textarea {
  border: 1px solid #bfd7ee;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: linear-gradient(135deg, var(--brand), #3b8dff);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}
.btn.ghost {
  background: #fff;
  color: var(--brand-dark);
  border: 1px solid var(--line);
}

.auth-layout article.active { border-color: #8bb8ff; }

.error { color: var(--danger); font-weight: 700; }
.status-ok { color: var(--success); font-weight: 700; }
.note { color: var(--muted); }

.profile-grid { grid-template-columns: 1fr 1fr; }
.profile-grid .full { grid-column: 1 / -1; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.forms-list { margin: 14px 0 24px; }
.form-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.form-meta { color: var(--muted); font-size: 14px; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.badge {
  display: inline-block;
  font-size: 12px;
  border-radius: 999px;
  padding: 3px 9px;
  font-weight: 700;
}
.badge.pending { background: #fff3d7; color: #875500; }
.badge.signed { background: #daf7e9; color: #0f6d4a; }

.preview-table { width: 100%; border-collapse: collapse; margin: 10px 0 14px; }
.preview-table td { border: 1px solid #d6e5f5; padding: 8px; vertical-align: top; }
.preview-table td:first-child { width: 35%; font-weight: 700; color: #0e3f72; }
.declaration {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbff;
  padding: 12px;
  margin-bottom: 12px;
}
.sign-box { max-width: 720px; }
.inline { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.inline input { width: auto; }

.check-group {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
}

.check-group legend {
  font-weight: 700;
  color: var(--brand-dark);
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

.data-table th,
.data-table td {
  border: 1px solid #d6e5f5;
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

.data-table th {
  background: #f3f8ff;
}

@media (max-width: 980px) {
  .grid.two, .profile-grid { grid-template-columns: 1fr; }
  .form-item { flex-direction: column; align-items: flex-start; }
}
