/* SYNEXA-wide adaptation of the supplied Form UX Principles reference. */
:root {
  --sans: "Plus Jakarta Sans", var(--ui), system-ui, sans-serif;
  --form-page: #f6f5ff;
  --form-accent: #5d4fe8;
  --form-accent-hover: #7b6ff0;
  --form-accent-soft: #efeeff;
  --form-accent-border: #c9c4fa;
  --form-success: #10a979;
  --form-success-soft: #e8faf4;
  --form-error: #d93845;
  --form-error-soft: #fff0f0;
  --form-warning: #bd7900;
  --form-border: #d9d7e9;
  --form-shadow: 0 2px 10px rgba(80, 64, 220, .08), 0 1px 3px rgba(80, 64, 220, .05);
  --form-shadow-hover: 0 7px 20px rgba(80, 64, 220, .16), 0 2px 6px rgba(80, 64, 220, .08);
}

/* Unified field surface while preserving control-specific sizing/layout. */
html body input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="hidden"]),
html body select:not([multiple]),
html body textarea {
  box-sizing: border-box;
  height: 40px;
  padding: 9px 12px;
  border: 1.5px solid var(--form-border);
  border-radius: 6px;
  background-color: #fff;
  color: #14141f;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.35;
  box-shadow: none;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

html body textarea { height: auto; min-height: 76px; resize: vertical; }
html body input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="hidden"]):hover,
html body select:not([multiple]):hover,
html body textarea:hover { border-color: #bcb7e7; }

html body input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="hidden"]):focus,
html body select:not([multiple]):focus,
html body textarea:focus {
  border-color: var(--form-accent) !important;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(93, 79, 232, .12);
}

html body input::placeholder, html body textarea::placeholder {
  color: #c6c4d9;
  opacity: 1;
  font-weight: 400;
}

html body form label {
  color: #4b4b6a;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
}

/* Preserve the large address field that anchors the Verify screen. */
html body #email-input { height: 54px; border-radius: 8px; font-size: 16px; }

html body input[aria-invalid="true"], html body select[aria-invalid="true"], html body textarea[aria-invalid="true"] {
  border-color: var(--form-error) !important;
}
html body input[aria-invalid="true"]:focus, html body select[aria-invalid="true"]:focus, html body textarea[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 3px rgba(217, 56, 69, .12);
}
html body input[data-ux-valid="true"], html body select[data-ux-valid="true"], html body textarea[data-ux-valid="true"] {
  border-color: var(--form-success) !important;
}
.form-ux-message {
  display: block;
  flex: 0 0 100%;
  width: 100%;
  min-height: 1em;
  margin-top: 5px;
  color: #77758e;
  font-size: 11.5px;
  line-height: 1.45;
}
.form-ux-message.is-error { color: var(--form-error); }
.form-ux-message.is-success { color: var(--form-success); }
.form-ux-hint {
  flex: 0 0 100%;
  margin: 8px 0 0;
  color: #77758e;
  font-size: 11.5px;
  line-height: 1.5;
}
form.synexa-database-actions[data-form-ux-gate] { flex-wrap: wrap; }
.form-ux-hint.is-success { color: var(--form-success); }

.form-ux-rules { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.form-ux-rule {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid var(--form-border);
  border-radius: 6px;
  background: #fff;
  color: #77758e;
  font-size: 11px;
  transition: color .16s ease, background-color .16s ease, border-color .16s ease;
}
.form-ux-rule span {
  display: inline-grid;
  width: 14px;
  height: 14px;
  place-items: center;
  border: 1px solid #c7c5d8;
  border-radius: 50%;
  color: transparent;
  font-size: 9px;
}
.form-ux-rule.passed { border-color: #b9e7d6; background: var(--form-success-soft); color: #087b56; }
.form-ux-rule.passed span { border-color: var(--form-success); background: var(--form-success); color: #fff; }

.form-ux-counter { display: flex; align-items: center; gap: 10px; margin-top: 7px; }
.form-ux-counter-track { display: block; flex: 1; height: 4px; overflow: hidden; border-radius: 99px; background: #e8e6f8; }
.form-ux-counter-fill { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--form-accent); transition: width .12s ease, background-color .16s ease; }
.form-ux-counter-fill.warn { background: var(--form-warning); }
.form-ux-counter-fill.over { background: var(--form-error); }
.form-ux-counter-label { color: #77758e; font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.form-ux-counter-label.warn { color: var(--form-warning); }
.form-ux-counter-label.over { color: var(--form-error); font-weight: 700; }

/* Match the reference's compact, confident CTA treatment across app actions. */
html body button.primary-button,
html body button.secondary-button,
html body button.synexa-cta,
html body button.synexa-outline-button,
html body button.memo-browse,
html body .search-actions button,
html body .synexa-import-form button {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  transition: color .16s ease, background-color .16s ease, border-color .16s ease,
    box-shadow .16s ease, transform .16s ease;
}

html body .primary-button:not(:disabled),
html body .synexa-cta:not(:disabled) {
  background: var(--form-accent);
  border-color: var(--form-accent);
  box-shadow: 0 3px 10px rgba(93, 79, 232, .24);
}
html body .primary-button, html body .synexa-cta {
  min-height: 40px;
  padding: 9px 20px;
  border-radius: 8px;
}
html body .primary-button:hover:not(:disabled),
html body .synexa-cta:hover:not(:disabled) {
  background: var(--form-accent-hover);
  border-color: var(--form-accent-hover);
  box-shadow: 0 6px 16px rgba(93, 79, 232, .28);
  transform: translateY(-1px);
}

html body .secondary-button,
html body .synexa-outline-button,
html body .memo-browse {
  border: 1px solid var(--form-accent-border);
  border-radius: 8px;
  background: #fff;
  color: #4b429f;
  box-shadow: var(--form-shadow);
}
html body .secondary-button:hover:not(:disabled),
html body .synexa-outline-button:hover:not(:disabled),
html body .memo-browse:hover:not(:disabled) {
  border-color: var(--form-accent);
  background: var(--form-accent-soft);
  color: var(--form-accent);
  box-shadow: var(--form-shadow-hover);
  transform: translateY(-1px);
}

button:disabled, input:disabled, select:disabled, textarea:disabled {
  cursor: not-allowed;
}
.secondary-button:disabled, .synexa-outline-button:disabled {
  background: #efeeff;
  border-color: #d9d7e9;
  color: #89879e;
  box-shadow: none;
  transform: none;
}
html body .primary-button:disabled, html body .synexa-cta:disabled {
  background: #efeeff;
  border-color: #e8e6f8;
  color: #9898b8;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 1;
  transform: none;
}
button:focus-visible, a:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--form-accent);
  outline-offset: 2px;
}

input[type="checkbox"], input[type="radio"] { accent-color: var(--form-accent); }
input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 8px 12px;
  border: 1px solid var(--form-accent-border);
  border-radius: 7px;
  background: var(--form-accent-soft);
  color: #4b429f;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
input[type="file"]::file-selector-button:hover { border-color: var(--form-accent); }

@media (prefers-reduced-motion: reduce) {
  button, input, select, textarea { transition: none !important; }
}
