/* ── Design tokens ──────────────────────────────────────────────────────── */
:root {
  --accent:        #E30613;
  --accent-dark:   #CF0000;
  --accent-shadow: rgba(227, 6, 19, 0.35);

  --bg:            #f4f5f7;
  --surface:       #ffffff;
  --border:        #dde1e7;
  --border-focus:  var(--accent);
  --text:          #1a1a1a;
  --text-muted:    #6b7280;
  --text-error:    #cc1111;
  --text-success:  #16a34a;

  --radius-sm:     6px;
  --radius-md:     10px;
  --radius-lg:     14px;

  --shadow-card:   0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-focus:  0 0 0 3px var(--accent-shadow);

  --font:          'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ── Reset / base ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

a { color: var(--accent); }
a:hover { color: var(--accent-dark); }

/* ── Page wrapper ───────────────────────────────────────────────────────── */
.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--accent);
  color: #fff;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.header-inner {
  max-width: 780px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo {
  height: 48px;
  width: auto;
  flex-shrink: 0;
}

.header-title-area h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.header-subtitle {
  font-size: 0.85rem;
  opacity: 0.88;
  margin-top: 2px;
}

/* ── Main / form container ──────────────────────────────────────────────── */
main.form-container {
  flex: 1;
  max-width: 780px;
  width: 100%;
  margin: 32px auto 40px;
  padding: 0 16px;
}

/* ── Info banner ────────────────────────────────────────────────────────── */
.info-banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #fff8f8;
  border: 1px solid #fcd5d5;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 24px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.info-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--accent);
  margin-top: 2px;
}

/* ── Form sections ──────────────────────────────────────────────────────── */
.form-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 28px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.section-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Grid layout ────────────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 20px;
}

.field-group.full-width  { grid-column: 1 / -1; }
.field-group.street      { grid-column: 1 / 2; }
.field-group.house-number{ grid-column: 2 / 3; }

/* ── Labels & inputs ────────────────────────────────────────────────────── */
label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
select {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.9rem;
  font-family: var(--font);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fafafa;
  color: var(--text);
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
  appearance: none;
}

input:focus,
select:focus {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-focus);
  background: #fff;
}

input.invalid,
select.invalid {
  border-color: var(--text-error);
  box-shadow: 0 0 0 3px rgba(204, 17, 17, 0.18);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.field-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.field-error {
  display: none;
  font-size: 0.78rem;
  color: var(--text-error);
  margin-top: 5px;
  font-weight: 500;
}

.required-star { color: var(--accent); font-weight: 700; }

/* ── File upload area ───────────────────────────────────────────────────── */
.upload-area {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}

.upload-area:hover,
.upload-area:focus-within {
  border-color: var(--accent);
  background: #fff5f5;
}

.upload-area.has-file {
  border-style: solid;
  border-color: var(--accent);
  background: #fff8f8;
}

.upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 20px;
  gap: 6px;
  cursor: pointer;
  pointer-events: none;
}

.upload-icon {
  width: 36px;
  height: 36px;
  color: var(--accent);
  margin-bottom: 4px;
}

.upload-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.upload-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.upload-file-name {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
  margin-top: 4px;
}

.upload-privacy-note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 10px;
}

.lock-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--text-muted);
}

/* ── Declaration text ───────────────────────────────────────────────────── */
.declaration-text {
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.declaration-text p + p {
  margin-top: 0.75rem;
}

.declaration-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.85rem 0;
  font-size: 0.85rem;
}

.declaration-table th,
.declaration-table td {
  border: 1px solid var(--border);
  padding: 0.45rem 0.65rem;
  text-align: left;
  vertical-align: top;
}

.declaration-table thead tr {
  background: #eef0f3;
  font-weight: 600;
  color: var(--text);
}

/* ── Checkboxes ─────────────────────────────────────────────────────────── */
.checkbox-group {
  margin-bottom: 14px;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-custom {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  background: #fafafa;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.18s, background 0.18s;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
  background: var(--accent);
  border-color: var(--accent);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
  content: '';
  display: block;
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translate(-1px, -1px);
}

.checkbox-label input[type="checkbox"]:focus + .checkbox-custom {
  box-shadow: var(--shadow-focus);
}

.checkbox-text {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.5;
}

.inline-link {
  color: var(--accent);
  text-decoration: underline;
}

/* ── Validation error banner ────────────────────────────────────────────── */
.form-error-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff0f0;
  border: 1px solid var(--text-error);
  border-radius: var(--radius-md);
  color: var(--text-error);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 12px 16px;
  margin-bottom: 12px;
}

/* ── Submit button ──────────────────────────────────────────────────────── */
.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.btn-submit {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 13px 32px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.18s, box-shadow 0.18s, transform 0.1s;
  box-shadow: 0 3px 10px var(--accent-shadow);
}

.btn-submit:hover:not(:disabled) {
  background: var(--accent-dark);
  box-shadow: 0 4px 14px var(--accent-shadow);
  transform: translateY(-1px);
}

.btn-submit:active:not(:disabled) {
  transform: translateY(0);
}

.btn-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Spinner */
.btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Success card ───────────────────────────────────────────────────────── */
.success-card {
  background: var(--surface);
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-lg);
  padding: 48px 32px;
  text-align: center;
  box-shadow: var(--shadow-card);
}

.success-icon {
  width: 56px;
  height: 56px;
  color: var(--text-success);
  margin-bottom: 16px;
}

.success-card h2 {
  font-size: 1.4rem;
  margin-bottom: 12px;
  color: var(--text-success);
}

.success-card p {
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto;
  font-size: 0.9rem;
}

/* ── Footer ─────────────────────────────────────────────────────────────── */
.site-footer {
  background: #1a1a1a;
  color: #9ca3af;
  text-align: center;
  font-size: 0.78rem;
  padding: 16px;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 580px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  .field-group.street,
  .field-group.house-number {
    grid-column: 1 / -1;
  }
  .form-section {
    padding: 20px 16px;
  }
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .btn-submit {
    width: 100%;
    justify-content: center;
  }
  .form-actions {
    justify-content: stretch;
  }
}
