:root {
  --bg: #eef1f6;
  --bg-blob-1: #6366f1;
  --bg-blob-2: #22d3ee;
  --card-bg: rgba(255, 255, 255, 0.72);
  --card-border: rgba(255, 255, 255, 0.6);
  --text: #14161a;
  --subtitle: #6b7280;
  --border: #dde1e8;
  --field-bg: rgba(255, 255, 255, 0.6);
  --primary: #4f46e5;
  --primary-2: #6366f1;
  --primary-hover: #4338ca;
  --ring: rgba(79, 70, 229, 0.16);
  --error: #dc2626;
  --success: #16a34a;
  --radius: 18px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d12;
    --bg-blob-1: #4f46e5;
    --bg-blob-2: #0ea5b7;
    --card-bg: rgba(24, 26, 33, 0.72);
    --card-border: rgba(255, 255, 255, 0.08);
    --text: #f2f4f7;
    --subtitle: #9aa1ab;
    --border: #333844;
    --field-bg: rgba(255, 255, 255, 0.04);
    --primary: #818cf8;
    --primary-2: #a5b4fc;
    --primary-hover: #a5b4fc;
    --ring: rgba(129, 140, 248, 0.22);
    --error: #f87171;
    --success: #4ade80;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overflow-x: hidden;
  position: relative;
}

.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.35;
  animation: drift 22s ease-in-out infinite alternate;
}

.blob-1 {
  width: 380px;
  height: 380px;
  top: -120px;
  left: -100px;
  background: var(--bg-blob-1);
}

.blob-2 {
  width: 320px;
  height: 320px;
  bottom: -120px;
  right: -100px;
  background: var(--bg-blob-2);
  animation-delay: -8s;
}

@keyframes drift {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(40px, 30px) scale(1.08);
  }
}

.card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  background: var(--card-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 36px 32px;
  box-shadow: 0 20px 50px rgba(20, 22, 30, 0.12);
  animation: rise 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 6px 16px var(--ring);
}

h1 {
  margin: 0 0 4px;
  font-size: 1.4rem;
  letter-spacing: -0.01em;
}

.subtitle {
  margin: 0 0 26px;
  color: var(--subtitle);
  font-size: 0.95rem;
}

.field {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--subtitle);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

input,
textarea {
  font: inherit;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--field-bg);
  color: var(--text);
  width: 100%;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

input:hover,
textarea:hover {
  border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--ring);
  background: var(--card-bg);
}

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

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.captcha-row {
  display: flex;
  gap: 8px;
}

.captcha-row input {
  flex: 1;
}

#captcha-refresh {
  flex-shrink: 0;
  width: 44px;
  border: 1px solid var(--border);
  background: var(--field-bg);
  color: var(--text);
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.1rem;
  transition: transform 0.35s ease, border-color 0.18s ease, background 0.18s ease;
}

#captcha-refresh:hover {
  border-color: var(--primary);
  background: var(--card-bg);
}

#captcha-refresh:active {
  transform: rotate(180deg);
}

button[type="submit"] {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  box-shadow: 0 8px 20px var(--ring);
}

button[type="submit"]:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px var(--ring);
}

button[type="submit"]:active:not(:disabled) {
  transform: translateY(0);
}

button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

#form-status {
  min-height: 1.2em;
  margin: 14px 0 0;
  font-size: 0.9rem;
  text-align: center;
  transition: opacity 0.2s ease;
}

#form-status.error {
  color: var(--error);
}

#form-status.success {
  color: var(--success);
}

@media (max-width: 480px) {
  .card {
    padding: 28px 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card {
    animation: none;
  }
  .blob {
    animation: none;
  }
  #captcha-refresh:active {
    transform: none;
  }
}
