/* THE create-form chrome: the battlefield's create view and the clan-war declaration are the
   same component. A create screen is a FORM, not a browse surface — one choice per row, with
   whatever that choice REVEALS sitting beside it, and the commit pair at the foot. */

.create-card {
  display: flex; flex-direction: column; gap: 22px;
  padding: 24px 26px;
  background: transparent;
  border-radius: var(--radius-l);
  /* No border: the shadow alone carries the card edge, so it is the deeper of the two. */
  box-shadow: var(--shadow-2);
}

.create-fields { display: flex; flex-direction: column; gap: 18px; }
.create-row { display: flex; flex-wrap: wrap; gap: 18px 22px; }
/* Fixed basis, no grow: a row holding one field must not stretch its control across the card. */
.create-row > .create-field { flex: 0 1 260px; min-width: 0; }

.create-field { display: flex; flex-direction: column; gap: 8px; }
.create-field > label,
.bf-switch-field > label:first-child {
  font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-3); font-weight: 600;
}

/* Left edge, like every commit bar in the app — the form's fields start there and the eye
   returns to the same column to finish. */
.create-actions {
  display: flex; justify-content: flex-start; gap: 10px;
  padding-top: 20px; border-top: 1px solid var(--divider);
}
/* The commit button is part of the contract: wide enough that a busy/loading label does not
   resize it. Named, not positional — a third control in the bar must not inherit the width by
   sitting last, and the skin is a per-screen choice. Two classes plus the parent, or it loses
   to buttons.css's shared 116px form-action floor at (0,2,0) and shrinks back. */
.create-actions > .btn.create-commit { min-width: 168px; justify-content: center; }

/* THE control skin for a create form's selects, dates and text inputs — one caret for the set.
   A screen that wants a different padding overrides it; it does not restate the arrow. */
.create-input {
  appearance: none; -webkit-appearance: none;
  width: 100%; box-sizing: border-box;
  padding: 10px; font: inherit; font-size: 0.9rem;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-m);
  color: var(--ink);
}
select.create-input {
  padding-right: 28px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 15px) 55%, calc(100% - 10px) 55%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}

/* THE field-info marker (DataCard.fieldInfo), shared by every create form. The popover is
   absolute against the LABEL — off the icon it starts mid-caption and hangs over the next
   column — so a form joining this must position its own label element. */
.field-info { display: inline-flex; margin-left: 5px; line-height: 1; color: var(--bronze-2); cursor: pointer; }
.field-info:focus-visible { outline: 2px solid var(--bronze-2); outline-offset: 2px; border-radius: var(--radius-s); }
.field-info-pop {
  display: none; position: absolute; left: 0; top: calc(100% + 7px); z-index: 5;
  width: 250px; max-width: min(250px, 80vw); padding: 9px 12px;
  border-left: 3px solid var(--bronze-2);
  /* Opaque: it floats over the control under it. */
  background: var(--bg-1); box-shadow: var(--shadow-2);
  border-radius: 0 var(--radius-m) var(--radius-m) 0;
  /* The label is uppercase and tracked; prose inherits that and has to opt out. */
  text-transform: none; letter-spacing: 0; font-weight: 400;
  font-size: 0.78rem; line-height: 1.5; color: var(--ink);
}
.field-info:hover .field-info-pop,
.field-info:focus-visible .field-info-pop,
.field-info.is-open .field-info-pop { display: block; }

@media (max-width: 640px) {
  .create-card { gap: 18px; padding: 18px; }
  .create-row > .create-field { flex: 1 1 100%; }
}

/* THE inline field-validation marks (views/ui/form-field.js). Unscoped so every form gets the
   same red edge and the same message placement. */
.is-invalid {
  border-color: var(--porphyry-2) !important;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--porphyry) 40%, transparent);
}
.field-error {
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--porphyry-2);
}
/* One shake per failed submit, re-triggered by form-field.js. */
.field-shake { animation: field-shake 0.32s cubic-bezier(0.36, 0.07, 0.19, 0.97) both; }
@keyframes field-shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX( 2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX( 4px); }
}
@media (prefers-reduced-motion: reduce) { .field-shake { animation: none; } }
