/* Advoke CV — Editor Form Validation States */

.editor-validation {
  display: flex;
  align-items: flex-start;
  gap: var(--space-1);
  font-size: var(--text-2xs);
  line-height: 1.4;
  font-weight: var(--font-weight-medium);
  color: var(--color-danger);
  margin-top: 2px;
}

.editor-validation::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  margin-top: 1px;
  background-color: currentColor;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z'/></svg>") center/contain no-repeat;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z'/></svg>") center/contain no-repeat;
}

.editor-validation--success {
  color: var(--color-success);
}

.editor-validation--success::before {
  content: "✓";
  background: none;
  -webkit-mask: none;
  mask: none;
  color: var(--color-success);
  font-weight: var(--font-weight-bold);
  width: auto;
  height: auto;
  font-size: var(--text-xs);
  line-height: 1;
}

.editor-validation--warning {
  color: var(--color-warning);
}

.editor-validation--warning::before {
  content: "!";
  background: none;
  -webkit-mask: none;
  mask: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  background-color: var(--color-warning);
  color: var(--white);
  font-size: 9px;
  font-weight: var(--font-weight-bold);
  line-height: 1;
}

.editor-validation--info {
  color: var(--color-info);
  font-weight: var(--font-weight-regular);
}

.editor-validation--info::before {
  content: "ⓘ";
  background: none;
  -webkit-mask: none;
  mask: none;
  color: var(--color-info);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-bold);
  width: auto;
  height: auto;
  line-height: 1;
}

.editor-form__error-summary {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background-color: var(--color-danger-bg);
  border: 1px solid #FCA5A5;
  border-radius: var(--radius-lg);
  color: var(--color-danger);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.editor-form__error-summary-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: var(--font-weight-semibold);
  font-size: var(--text-sm);
  color: var(--color-danger);
  margin: 0;
}

.editor-form__error-summary-title::before {
  content: "!";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  background-color: var(--color-danger);
  color: var(--white);
  font-size: 10px;
  font-weight: var(--font-weight-bold);
  line-height: 1;
  flex-shrink: 0;
}

.editor-form__error-summary-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding-left: var(--space-6);
  margin: 0;
  list-style: disc;
  font-size: var(--text-xs);
}

.editor-form__error-summary-list li::marker {
  color: var(--color-danger);
}

.editor-form__error-summary-list a {
  color: var(--color-danger);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.editor-form__error-summary-list a:hover {
  color: #7F1D1D;
}

.editor-field--error .editor-field__input,
.editor-field--error .editor-field__select,
.editor-field--error .editor-field__textarea {
  border-color: var(--color-danger);
  background-color: rgba(254, 226, 226, 0.15);
}

.editor-field--success .editor-field__input,
.editor-field--success .editor-field__select,
.editor-field--success .editor-field__textarea {
  border-color: var(--color-success);
}

.editor-field--success::after {
  content: "✓";
  position: absolute;
  right: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-success);
  font-weight: var(--font-weight-bold);
  font-size: var(--text-sm);
  pointer-events: none;
}

.editor-field__required-indicator {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--color-danger);
  font-weight: var(--font-weight-semibold);
}

.editor-field__shake {
  animation: editor-shake 400ms var(--ease-in-out);
}

@keyframes editor-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

@media (prefers-reduced-motion: reduce) {
  .editor-field__shake {
    animation: none;
  }
}