@font-face {
  font-family: 'Reddit Sans';
  src: url('/assets/redditsans.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --accent: #94c23d;
  --accent-dark: #7ca933;
  --accent-soft: rgba(148, 194, 61, 0.12);
  --accent-ring: rgba(148, 194, 61, 0.28);
  --accent-disabled: #a9c084;
  --bg: #f4f5f6;
  --card: #ffffff;
  --border: #e4e5e8;
  --text: #1a1a1b;
  --muted: #7c8288;
  --danger: #c42f3f;
  --success-bg: #e8f7ee;
  --success: #16894a;
}

* { box-sizing: border-box; }

html { -webkit-font-smoothing: antialiased; }

body {
  margin: 0;
  padding: 48px 16px;
  font-family: 'Reddit Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(1100px 500px at 15% -10%, rgba(148, 194, 61, 0.07), transparent 60%),
    radial-gradient(900px 420px at 110% 0%, rgba(148, 194, 61, 0.06), transparent 55%),
    var(--bg);
  color: var(--text);
}

.card {
  max-width: 720px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px 44px 44px;
  box-shadow: 0 24px 50px rgba(26, 26, 27, 0.12);
}

.card-header {
  margin-bottom: 30px;
}

.lang-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 18px;
}

.lang-switch {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 118px;
  text-align: left;
}

.lang-switch span {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.lang-switch select {
  width: 100%;
  padding: 7px 10px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.lang-switch select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.header-brand {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}

.header-brand + p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
  text-align: center;
}

@media (max-width: 640px) {
  .card { padding: 28px 20px 32px; }
  .lang-bar { justify-content: stretch; }
  .lang-switch { min-width: 140px; width: 100%; }
}

.field { margin-bottom: 22px; }

fieldset.field {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  padding: 14px 16px 16px;
}

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

@media (max-width: 640px) {
  .row { grid-template-columns: 1fr; }
}

label, legend {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-bottom: 7px;
  color: var(--text);
}

legend { padding: 0; }

input[type="text"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 11px 13px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

textarea { resize: vertical; min-height: 110px; }

.file-picker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px 16px;
  border: 1.5px dashed var(--accent);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-dark);
  user-select: none;
  transition: background 0.15s, border-color 0.15s;
}

.file-picker:hover {
  background: var(--accent-soft);
  border-color: var(--accent-dark);
}

.file-picker-icon {
  font-size: 18px;
  line-height: 1;
}

.file-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.file-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #f7f8f3;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 7px 9px 7px 12px;
  font-size: 14px;
  font-family: inherit;
}

.file-list li .file-name {
  flex: 1;
  word-break: break-all;
}

.file-list li .file-size {
  flex: none;
  color: var(--muted);
  font-size: 12px;
}

.file-list li button {
  width: 26px;
  height: 26px;
  padding: 0;
  flex: none;
  border-radius: 8px;
  background: transparent;
  color: var(--danger);
  font-size: 18px;
  line-height: 1;
}

.file-list li button:hover {
  background: var(--accent-soft);
  box-shadow: none;
}

.hint {
  margin: 7px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

@media (max-width: 640px) {
  .type-grid { grid-template-columns: 1fr; }
}

.type-option {
  display: block;
  position: relative;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 10px;
  cursor: pointer;
  text-align: center;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s, transform 0.1s;
}

.type-option:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.type-option.checked {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent) inset;
}

.type-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.type-option .type-name {
  display: block;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}

.type-option.checked .type-name {
  color: var(--accent-dark);
}

.hp-field {
  position: absolute;
  left: -9999px;
  top: auto;
  height: 0;
  width: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.captcha-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--accent-soft);
  border: 1px solid rgba(148, 194, 61, 0.35);
  border-radius: 10px;
  padding: 14px 16px;
}

.captcha-text {
  font-size: 20px;
  font-weight: 600;
  color: var(--accent-dark);
  line-height: 1.2;
}

.captcha-box input {
  width: 92px;
  text-align: center;
  font-size: 20px;
  font-weight: 600;
  padding: 8px 10px;
}

button {
  width: 100%;
  padding: 13px 16px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}

button:hover {
  background: var(--accent-dark);
  box-shadow: 0 6px 16px rgba(148, 194, 61, 0.3);
}

button:active { transform: translateY(1px); }
button:disabled { background: var(--accent-disabled); cursor: not-allowed; box-shadow: none; }

button.secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

button.secondary:hover {
  background: var(--accent-soft);
  box-shadow: none;
}

.form-error {
  margin: 16px 0 0;
  color: var(--danger);
  font-size: 14px;
  font-weight: 600;
}

#success { text-align: center; padding: 24px 0 8px; }

.success-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--success-bg);
  color: var(--success);
  font-size: 30px;
  line-height: 60px;
}

#success h2 {
  margin: 0 0 10px;
  font-size: 22px;
  letter-spacing: -0.01em;
}

#success p { color: var(--muted); margin: 0 0 18px; word-break: break-word; }

#success-link {
  display: block;
  width: 100%;
  padding: 13px 16px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: 10px;
  text-decoration: none;
  text-align: center;
  box-sizing: border-box;
  margin: 4px 0 12px;
  transition: background 0.15s;
}

#success-link:hover {
  background: var(--accent-soft);
  text-decoration: none;
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 8px;
  vertical-align: -3px;
  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); } }