:root {
  --bg: #0b0b0c;
  --fg: #f5f5f5;
  --muted: #9a9a9a;
  --accent: #ff5a36;
  --field-bg: #17171a;
  --field-border: #2a2a2e;
  --toggle-bg: #17171a;
  --toggle-border: #2a2a2e;
}

:root[data-theme="light"] {
  --bg: #f4f4f2;
  --fg: #10131a;
  --muted: #6b7078;
  --accent: #ff5a36;
  --field-bg: #ffffff;
  --field-border: #dcdcd8;
  --toggle-bg: #ffffff;
  --toggle-border: #dcdcd8;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  transition: background-color 0.2s, color 0.2s;
}

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.hero-content {
  width: 100%;
  max-width: 480px;
  text-align: center;
}

.logo {
  width: 56px;
  height: auto;
  margin-bottom: 1.75rem;
}

.animated-logo circle,
.animated-logo line {
  opacity: 0;
  transition: fill 0.2s, stroke 0.2s;
}

.animated-logo circle {
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0);
  animation: logo-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.animated-logo line {
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: logo-draw 0.3s ease-out forwards;
}

@keyframes logo-pop {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes logo-draw {
  to {
    opacity: 1;
    stroke-dashoffset: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .animated-logo circle,
  .animated-logo line {
    animation: none;
    opacity: 1;
    transform: none;
    stroke-dashoffset: 0;
  }
}

.hero-content h1 {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 2.5rem;
  letter-spacing: -0.02em;
}

/* On roomy screens keep the headline on a single row: let it overflow its
   (narrower) form-width container and re-center itself on the viewport. */
@media (min-width: 700px) {
  .hero-content h1 {
    position: relative;
    left: 50%;
    width: max-content;
    max-width: 92vw;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: clamp(2rem, 3.4vw, 3.25rem);
  }
}

.contact-form {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
  min-height: 92px;
}

.step-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.step-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--field-border);
  transition: background-color 0.2s, transform 0.2s;
}

.step-dot.is-active {
  background: var(--accent);
  transform: scale(1.3);
}

.step-dot.is-done {
  background: var(--muted);
}

.step-back {
  position: absolute;
  top: -2.6rem;
  left: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.2s, background-color 0.2s;
}

.step-back:hover {
  color: var(--fg);
  background: var(--field-bg);
}

.step-back[hidden] {
  display: none;
}

.step-back svg {
  width: 18px;
  height: 18px;
}

.step {
  display: none;
}

.step.is-active {
  display: block;
  animation: step-in 0.25s ease;
}

@keyframes step-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.field label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.field-row {
  display: flex;
  gap: 0.5rem;
}

.field input[type="email"],
.field input[type="text"] {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--field-bg);
  border: 1px solid var(--field-border);
  border-radius: 8px;
  color: var(--fg);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, background-color 0.2s;
}

.field input[type="email"]:focus,
.field input[type="text"]:focus {
  border-color: var(--accent);
}

.field input.is-invalid {
  border-color: #ff6b6b;
}

.step-next {
  flex-shrink: 0;
  width: 44px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}

.step-next:hover {
  opacity: 0.9;
}

.step-next svg {
  width: 18px;
  height: 18px;
}

.checkbox-field label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
  color: var(--fg);
  cursor: pointer;
}

.checkbox-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

button[type="submit"] {
  margin-top: 0.5rem;
  padding: 0.85rem 1rem;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: default;
}

button[type="submit"]:hover:not(:disabled) {
  opacity: 0.9;
}

.form-message {
  margin-top: 1.25rem;
  color: #56c37f;
  font-size: 0.95rem;
}

.form-error {
  margin-top: 1.25rem;
  color: #ff6b6b;
  font-size: 0.95rem;
}

.theme-toggle {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--toggle-bg);
  border: 1px solid var(--toggle-border);
  color: var(--fg);
  cursor: pointer;
  z-index: 10;
  transition: background-color 0.2s, border-color 0.2s, transform 0.15s;
}

.theme-toggle:hover {
  transform: translateY(-1px);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-toggle .icon {
  width: 19px;
  height: 19px;
  position: absolute;
}

.theme-toggle .icon-sun {
  opacity: 0;
  transform: scale(0.6) rotate(-45deg);
  transition: opacity 0.2s, transform 0.2s;
}

.theme-toggle .icon-moon {
  opacity: 1;
  transform: scale(1) rotate(0deg);
  transition: opacity 0.2s, transform 0.2s;
}

:root[data-theme="light"] .theme-toggle .icon-sun {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

:root[data-theme="light"] .theme-toggle .icon-moon {
  opacity: 0;
  transform: scale(0.6) rotate(45deg);
}

@media (prefers-reduced-motion: reduce) {
  body, .theme-toggle, .theme-toggle .icon {
    transition: none;
  }
}
