.com {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: calc(6vh + 32px) 48px 80px;
}

.com__title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: clamp(2.5rem, 6vw, 4rem);
  color: var(--color-accent);
  margin-bottom: 24px;
  animation: com-ignite 1s var(--ease-out) both;
}

@keyframes com-ignite {
  0% {
    opacity: 0;
    filter: blur(16px);
    transform: translateY(10px);
    text-shadow: 0 0 0 rgba(253, 233, 204, 0);
  }
  60% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
  100% {
    text-shadow: 0 0 44px rgba(253, 233, 204, 0.45);
  }
}

.com__intro {
  max-width: 600px;
  font-size: 1.1rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: 48px;
  animation: com-line-reveal 0.8s var(--ease-out) 0.3s both;
}

@keyframes com-line-reveal {
  from {
    opacity: 0;
    filter: blur(10px);
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

.com-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  max-width: 560px;
  padding: 40px;
  border-radius: 24px;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--color-border);
  text-align: left;
  opacity: 0;
  filter: blur(10px);
  animation: com-line-reveal 0.8s var(--ease-out) 0.5s both;
}

/* The `hidden` attribute and `.com-form`'s own `display: flex` have equal
   CSS specificity (one attribute selector vs. one class selector), so
   without this rule the form's own display value would silently win and
   the browser's built-in [hidden] { display: none; } would never apply. */
.com-form[hidden] {
  display: none;
}

.com-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.com-field__label {
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--color-text);
}

.com-field__hint {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: -4px;
}

.com-field input,
.com-field textarea {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--color-text);
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 13px 16px;
  resize: vertical;
  transition: border-color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}

.com-field textarea {
  min-height: 100px;
  line-height: 1.5;
}

.com-field input::placeholder,
.com-field textarea::placeholder {
  color: rgba(255, 255, 255, 0.32);
}

.com-field input:hover,
.com-field textarea:hover {
  border-color: rgba(255, 255, 255, 0.22);
}

.com-field input:focus,
.com-field textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  background-color: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 4px rgba(253, 233, 204, 0.12), 0 0 20px rgba(253, 233, 204, 0.15);
}

.com-form__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
  padding: 15px 20px;
  border: none;
  border-radius: 999px;
  background-color: var(--color-accent);
  color: #201a12;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s ease, opacity 0.2s ease;
}

.com-form__submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px -10px rgba(253, 233, 204, 0.5);
}

.com-form__submit:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.com-form__submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.com-form__submit:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}

.com-form__submit .fa-circle-notch {
  display: none;
}

.com-form__submit[data-loading="true"] .fa-circle-notch {
  display: inline-block;
}

.com-form__submit[data-loading="true"] .com-form__submit-label {
  opacity: 0.85;
}

.com-form__error {
  display: none;
  font-size: 0.85rem;
  color: #f5a3a3;
  text-align: center;
}

.com-form__error[data-visible="true"] {
  display: block;
}

/* The form and success panel occupy the same slot — a plain wrapper
   with no explicit height, so the panel swap doesn't leave an empty gap
   or require measuring anything with JS. */
.com-form-wrap {
  position: relative;
  width: 100%;
  max-width: 560px;
}

.com-success {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 56px 40px;
  border-radius: 24px;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--color-border);
  text-align: center;
}

.com-success[data-visible="true"] {
  display: flex;
  animation: com-success-pop 0.6s var(--ease-spring) both;
}

@keyframes com-success-pop {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.com-success__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: rgba(253, 233, 204, 0.12);
  color: var(--color-accent);
  font-size: 1.6rem;
  box-shadow: 0 0 30px rgba(253, 233, 204, 0.3);
}

.com-success__text {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--color-text);
}

@media (prefers-reduced-motion: reduce) {
  .com__title,
  .com__intro,
  .com-form,
  .com-success[data-visible="true"] {
    animation: none;
    opacity: 1;
    filter: none;
  }

  .com__title {
    text-shadow: 0 0 44px rgba(253, 233, 204, 0.45);
  }
}

@media (max-width: 640px) {
  .com {
    padding: 72px 20px 60px;
  }

  .com-form,
  .com-success {
    padding: 28px 24px;
  }
}
