:root {
  --blue-950: #071a3d;
  --blue-900: #0b2e63;
  --blue-800: #0d3c82;
  --blue-700: #1454a6;
  --blue-600: #1565c0;
  --blue-500: #1e88e5;
  --blue-300: #64b5f6;
  --blue-100: #e3f2fd;
  --blue-50: #f4f9ff;
  --accent: #ffb300;
  --white: #ffffff;
  --ink: #10233f;
  --muted: #5c7290;
  --error: #d32f2f;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(11, 46, 99, 0.25);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--blue-950) 0%, var(--blue-800) 35%, var(--blue-500) 100%);
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.clouds {
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background-image:
    radial-gradient(60px 30px at 10% 20%, #fff 0%, transparent 60%),
    radial-gradient(80px 36px at 80% 10%, #fff 0%, transparent 60%),
    radial-gradient(70px 34px at 60% 35%, #fff 0%, transparent 60%),
    radial-gradient(90px 40px at 25% 55%, #fff 0%, transparent 60%),
    radial-gradient(70px 32px at 90% 65%, #fff 0%, transparent 60%),
    radial-gradient(60px 28px at 40% 85%, #fff 0%, transparent 60%);
  background-repeat: no-repeat;
}

.container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */

.site-header {
  padding: 20px 0 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--white);
}

.brand-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  transform: rotate(0deg);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand-title {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.2px;
}

.brand-sub {
  font-size: 0.85rem;
  color: var(--blue-100);
  opacity: 0.9;
}

/* Main content */

main.container {
  flex: 1;
  padding-top: 8px;
  padding-bottom: 40px;
}

.hero {
  text-align: center;
  color: var(--white);
  padding: 8px 8px 24px;
}

.hero h1 {
  font-size: 1.5rem;
  margin: 4px 0 8px;
}

.hero p {
  margin: 0;
  color: var(--blue-100);
  font-size: 0.95rem;
}

.hero-deadline {
  margin-top: 8px !important;
  display: inline-block;
  background: rgba(255, 179, 0, 0.18);
  border: 1px solid rgba(255, 179, 0, 0.5);
  color: var(--white) !important;
  font-weight: 600;
  font-size: 0.85rem !important;
  padding: 6px 14px;
  border-radius: 20px;
}

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

.section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--blue-800);
  margin: 28px 0 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--blue-100);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title:first-child {
  margin-top: 0;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 560px) {
  .form-row.cols-2 { grid-template-columns: 1fr 1fr; }
  .form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
}

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

.form-row .form-group {
  margin-bottom: 0;
}

label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--blue-900);
  margin-bottom: 6px;
}

.req {
  color: var(--error);
  margin-left: 3px;
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  border: 1.5px solid #cddcee;
  border-radius: 10px;
  background: var(--blue-50);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  appearance: none;
  -webkit-appearance: none;
}

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%231565c0' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px;
  padding-right: 38px;
}

.form-control:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.18);
  background: var(--white);
}

.has-error .form-control {
  border-color: var(--error);
  background: #fdf2f2;
}

.field-error {
  color: var(--error);
  font-size: 0.82rem;
  margin: 6px 0 0;
}

.field-hint {
  color: var(--muted);
  font-size: 0.8rem;
  margin: 6px 0 0;
}

/* Checkboxes */

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkbox-row label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 500;
  font-size: 0.92rem;
  color: var(--ink);
  cursor: pointer;
  margin-bottom: 0;
}

.checkbox-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  accent-color: var(--blue-600);
  margin-top: 1px;
}

.consent-row {
  margin-top: 20px;
  padding: 14px 16px;
  background: var(--blue-100);
  border-radius: 10px;
  border: 1px solid var(--blue-300);
}

.consent-row a {
  color: var(--blue-700);
  font-weight: 600;
}

/* Captcha */

.captcha-box {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.captcha-question {
  background: var(--blue-900);
  color: var(--white);
  font-weight: 700;
  font-size: 1.1rem;
  padding: 10px 18px;
  border-radius: 10px;
  letter-spacing: 1px;
  white-space: nowrap;
}

.captcha-box .form-group {
  flex: 1;
  min-width: 140px;
  margin-bottom: 0;
}

/* Honeypot — скрыто от людей, видно ботам, парсящим только HTML */
.hp-wrap {
  position: absolute;
  left: -9999px;
  top: -9999px;
  height: 0;
  width: 0;
  overflow: hidden;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px 20px;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}

.btn-primary {
  background: linear-gradient(180deg, var(--blue-500), var(--blue-700));
  color: var(--white);
  box-shadow: 0 6px 18px rgba(21, 101, 192, 0.4);
  margin-top: 24px;
}

.btn-primary:hover { transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

/* Flash messages */

.flash-list { margin-bottom: 16px; }

.flash {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.flash-error {
  background: #fdecea;
  color: var(--error);
  border: 1px solid #f5b5b1;
}

.flash-success {
  background: #e8f5e9;
  color: #1b5e20;
  border: 1px solid #a5d6a7;
}

/* Success page */

.success-card {
  text-align: center;
  padding: 40px 20px;
}

.success-icon {
  width: 72px;
  height: 72px;
  color: var(--blue-600);
  margin: 0 auto 16px;
}

.success-card h1 {
  color: var(--blue-900);
  margin-bottom: 10px;
}

.success-card p {
  color: var(--muted);
  margin-bottom: 24px;
}

/* Static text pages (consent) */

.doc-card h1 {
  color: var(--blue-900);
  font-size: 1.3rem;
}

.doc-card h2 {
  color: var(--blue-800);
  font-size: 1.05rem;
  margin-top: 22px;
}

.doc-card p, .doc-card li {
  color: var(--ink);
  line-height: 1.55;
  font-size: 0.95rem;
}

/* Footer */

.site-footer {
  color: var(--blue-100);
  text-align: center;
  padding: 18px 16px 26px;
  font-size: 0.82rem;
}

.site-footer a {
  color: var(--white);
  font-weight: 600;
}

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

/* Admin */

.admin-login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
}

.admin-card {
  max-width: 380px;
  width: 100%;
}

.admin-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
  color: var(--white);
}

.admin-bar h1 {
  font-size: 1.2rem;
  margin: 0;
}

.admin-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-small {
  width: auto;
  padding: 9px 16px;
  font-size: 0.85rem;
  margin-top: 0;
}

.btn-secondary {
  background: var(--white);
  color: var(--blue-800);
}

.btn-ghost {
  background: rgba(255,255,255,0.15);
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.4);
}

.btn-danger {
  background: #d32f2f;
  color: var(--white);
}

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--white);
}

table.entries {
  border-collapse: collapse;
  width: 100%;
  min-width: 1520px;
  font-size: 0.85rem;
}

table.entries th, table.entries td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--blue-100);
  text-align: left;
  white-space: nowrap;
}

table.entries th {
  background: var(--blue-800);
  color: var(--white);
  position: sticky;
  top: 0;
}

table.entries tbody tr:hover {
  background: var(--blue-50);
}

.empty-state {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
}

.admin-wide {
  max-width: 1400px;
}
