/* =============================================================================
 * MCI shadcn-style form kit — plain CSS, no framework/build.
 * Mirrors shadcn/ui form primitives (Field/Label/Input/Select/Textarea/Button)
 * using the existing MCI tokens (tokens.css). Used by new forms (Request a Car)
 * now; existing forms retrofitted in a later pass.
 *
 * Also ships a dependency-free date+time picker (.scn-dt) — see forms-dt.js.
 * ========================================================================== */

.scn-form { display: block; }

/* Field = label + control + (hint/error) stack */
.scn-field { margin-bottom: 16px; }
.scn-field:last-child { margin-bottom: 0; }

.scn-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--blue-darker, #001324);
  margin-bottom: 6px;
  letter-spacing: -0.005em;
}
.scn-label .scn-req { color: var(--color-error, #D92D20); margin-left: 2px; }
.scn-optional { color: var(--gray-500, #717680); font-weight: 400; font-size: 12px; margin-left: 6px; }

/* Inputs / selects / textareas — shadcn look: 40px, 1px border, soft radius,
   ring on focus. */
.scn-input,
.scn-select,
.scn-textarea {
  display: block;
  width: 100%;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 14px;
  color: var(--blue-darker, #001324);
  background: var(--white, #fff);
  border: 1px solid var(--blue-b30, #d7dee6);
  border-radius: var(--radius-md, 10px);
  transition: border-color .12s ease, box-shadow .12s ease;
  -webkit-appearance: none;
  appearance: none;
}
.scn-input,
.scn-select { height: 40px; padding: 0 12px; }
.scn-textarea { min-height: 84px; padding: 10px 12px; line-height: 1.5; resize: vertical; }

.scn-input::placeholder,
.scn-textarea::placeholder { color: var(--gray-500, #98a2b3); }

.scn-input:focus,
.scn-select:focus,
.scn-textarea:focus {
  outline: none;
  border-color: var(--blue-normal, #003566);
  box-shadow: 0 0 0 3px rgba(0, 53, 102, 0.12); /* the shadcn "ring" */
}

.scn-input:disabled,
.scn-select:disabled,
.scn-textarea:disabled { background: var(--gray-50, #f4f6f9); color: var(--gray-500); cursor: not-allowed; }

/* Searchable dependent dropdown (Make -> Model), vehicle-picker.js (E4) */
.scn-combo { position: relative; }
/* Show the same caret as a native select so it reads as a dropdown, not a text box. */
.scn-combo .scn-input {
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}
.scn-combo-list {
  position: absolute;
  z-index: 40;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 248px;
  overflow-y: auto;
  padding: 4px;
  background: var(--white, #fff);
  border: 1px solid var(--blue-b30, #d7dee6);
  border-radius: var(--radius-md, 10px);
  box-shadow: 0 8px 24px rgba(0, 19, 36, 0.12);
}
.scn-combo-list[hidden] { display: none; }
.scn-combo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 8px;
  background: none;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 14px;
  color: var(--blue-darker, #001324);
  text-align: left;
  cursor: pointer;
}
.scn-combo-item:hover,
.scn-combo-item:focus { background: var(--blue-b10, #eef3f8); outline: none; }
.scn-combo-sub { font-size: 12px; color: var(--gray-500, #98a2b3); flex-shrink: 0; }
.scn-combo-empty { padding: 10px 12px; font-size: 14px; color: var(--gray-500, #98a2b3); }

/* Native select caret */
.scn-select {
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

/* Invalid state */
.scn-field.is-invalid .scn-input,
.scn-field.is-invalid .scn-select,
.scn-field.is-invalid .scn-textarea,
.scn-field.is-invalid .scn-dt-trigger {
  border-color: var(--color-error, #D92D20);
}
.scn-field.is-invalid .scn-input:focus,
.scn-field.is-invalid .scn-select:focus,
.scn-field.is-invalid .scn-textarea:focus {
  box-shadow: 0 0 0 3px rgba(217, 45, 32, 0.12);
}

.scn-hint  { font-size: 12px; color: var(--gray-500, #717680); margin-top: 5px; line-height: 1.4; }
.scn-error { font-size: 12px; color: var(--color-error, #D92D20); margin-top: 5px; line-height: 1.4; display: none; }
.scn-field.is-invalid .scn-error { display: block; }
.scn-field.is-invalid .scn-hint  { display: none; }

/* Rows: responsive 2-up / 3-up */
.scn-row { display: grid; gap: 12px; }
.scn-row.cols-2 { grid-template-columns: 1fr 1fr; }
.scn-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 560px) { .scn-row.cols-2, .scn-row.cols-3 { grid-template-columns: 1fr; } }

/* Buttons */
.scn-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-md, 10px);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, opacity .12s ease;
  text-decoration: none;
}
.scn-btn:disabled { opacity: .6; cursor: not-allowed; }
.scn-btn-primary { background: var(--blue-darker, #001324); color: #fff; }
.scn-btn-primary:hover:not(:disabled) { background: var(--blue-normal, #003566); }
.scn-btn-outline { background: transparent; color: var(--blue-darker, #001324); border-color: var(--blue-b30, #d7dee6); }
.scn-btn-outline:hover:not(:disabled) { background: var(--gray-50, #f4f6f9); }
.scn-btn-block { width: 100%; }

/* Choice cards (the hub chooser) */
.scn-choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 620px) { .scn-choice-grid { grid-template-columns: 1fr; } }
.scn-choice {
  text-align: left;
  background: var(--white, #fff);
  border: 1px solid var(--blue-b30, #d7dee6);
  border-radius: var(--radius-lg, 14px);
  padding: 22px 20px;
  cursor: pointer;
  transition: border-color .12s ease, box-shadow .12s ease, transform .05s ease;
  font-family: inherit;
}
.scn-choice:hover { border-color: var(--blue-normal, #003566); box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,.08)); }
.scn-choice:active { transform: translateY(1px); }
.scn-choice-ico { width: 40px; height: 40px; border-radius: 10px; background: var(--blue-b10, #eef3f8); display: flex; align-items: center; justify-content: center; color: var(--blue-normal, #003566); margin-bottom: 14px; }
.scn-choice h3 { margin: 0 0 6px; font-size: 16px; font-weight: 700; color: var(--blue-darker, #001324); }
.scn-choice p  { margin: 0; font-size: 13px; color: var(--gray-500, #667085); line-height: 1.5; }

/* =============================================================================
 * Date + time picker (.scn-dt) — dependency-free.
 * Markup: <div class="scn-dt" data-name="auctionAt"></div>  (forms-dt.js fills it)
 * ========================================================================== */
.scn-dt { position: relative; }
.scn-dt-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 40px;
  padding: 0 12px;
  background: var(--white, #fff);
  border: 1px solid var(--blue-b30, #d7dee6);
  border-radius: var(--radius-md, 10px);
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 14px;
  color: var(--blue-darker, #001324);
  cursor: pointer;
  text-align: left;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.scn-dt-trigger:focus { outline: none; border-color: var(--blue-normal, #003566); box-shadow: 0 0 0 3px rgba(0, 53, 102, 0.12); }
.scn-dt-trigger .scn-dt-ico { color: var(--gray-500, #667085); flex: 0 0 auto; }
.scn-dt-trigger .scn-dt-value { flex: 1 1 auto; }
.scn-dt-trigger.is-placeholder .scn-dt-value { color: var(--gray-500, #98a2b3); }
.scn-dt-trigger .scn-dt-clear { color: var(--gray-500); font-size: 18px; line-height: 1; padding: 0 2px; border-radius: 4px; }
.scn-dt-trigger .scn-dt-clear:hover { background: var(--gray-100, #eef0f3); color: var(--blue-darker); }

.scn-dt-pop {
  /* fixed so the popover escapes any overflow:hidden ancestor (e.g. .card);
     top/left are set in JS from the trigger's position. */
  position: fixed;
  z-index: 1200;
  top: 0;
  left: 0;
  width: 300px;
  max-width: calc(100vw - 32px);
  background: var(--white, #fff);
  border: 1px solid var(--blue-b30, #d7dee6);
  border-radius: var(--radius-lg, 14px);
  box-shadow: var(--shadow-lg, 0 12px 32px rgba(0,0,0,.18));
  padding: 14px;
  display: none;
}
.scn-dt.open .scn-dt-pop { display: block; }

.scn-dt-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.scn-dt-cal-title { font-size: 14px; font-weight: 600; color: var(--blue-darker, #001324); }
.scn-dt-nav { background: none; border: 1px solid var(--blue-b30, #d7dee6); border-radius: 8px; width: 30px; height: 30px; cursor: pointer; color: var(--blue-darker); display: flex; align-items: center; justify-content: center; }
.scn-dt-nav:hover { background: var(--gray-50, #f4f6f9); }

.scn-dt-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.scn-dt-dow { font-size: 11px; font-weight: 600; color: var(--gray-500, #98a2b3); text-align: center; padding: 4px 0; }
.scn-dt-day { aspect-ratio: 1 / 1; border: none; background: none; border-radius: 8px; font-size: 13px; color: var(--blue-darker, #001324); cursor: pointer; font-family: inherit; }
.scn-dt-day:hover:not(:disabled) { background: var(--blue-b10, #eef3f8); }
.scn-dt-day.is-other { color: var(--gray-300, #c4ccd6); }
.scn-dt-day.is-today { font-weight: 700; box-shadow: inset 0 0 0 1px var(--blue-b30, #d7dee6); }
.scn-dt-day.is-selected,
.scn-dt-day.is-selected:hover { background: var(--blue-darker, #001324); color: #fff; }
.scn-dt-day:disabled { color: var(--gray-300, #d7dee6); cursor: not-allowed; }

.scn-dt-time { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--blue-b20, #e8edf2); }
.scn-dt-time label { font-size: 12px; font-weight: 600; color: var(--gray-500); }
/* .scn-dt-pop prefix raises specificity above page-level `select` rules
   (e.g. bids.html's `.bid-field select`) so the picker's own sizing wins. */
.scn-dt-pop .scn-dt-time select {
  flex: 1 1 0; min-width: 58px; height: 34px;
  border: 1px solid var(--blue-b30, #d7dee6); border-radius: 8px;
  font-family: inherit; font-size: 13px; color: var(--blue-darker, #001324);
  /* Custom caret (like .scn-select) so the value never renders under a native
     chevron — reserves its own space, so "AM"/"PM" can't clip. */
  -webkit-appearance: none; appearance: none;
  padding: 0 26px 0 8px;
  background-color: var(--white);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 7px center;
}
.scn-dt-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
