/* =========================================================================
   FE 3.0 — Native Start-a-Ticket workflow pages
   -------------------------------------------------------------------------
   WHY: Provide a shared visual system for all five native workflow pages so
        advisors get a consistent, predictable experience across workflows.
   PROMPT: "FE 3.0 Native Start-a-Ticket Implementation Plan"
   DATE: 2026-05-10
   WHAT: Card-based layout, summary metrics, lightweight forms, and state
         blocks (loading/error/empty) using FE 3.0 design tokens.
   ASSUMPTIONS: tokens-base.css, 3.0-shell.css, and fe30-components.css are
                loaded before this stylesheet.
   ========================================================================= */

.fe30-wizard-page {
  padding: var(--space-6, 24px);
  display: grid;
  gap: var(--space-5, 20px);
}

.fe30-wizard-hero {
  background: var(--bg-white, #fff);
  border: 1px solid var(--gray-300, #d1d5db);
  border-radius: var(--radius-xl, 20px);
  box-shadow: var(--shadow-md, 0 4px 6px rgba(0, 0, 0, 0.05));
  padding: var(--space-6, 24px);
}

.fe30-wizard-eyebrow {
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gray-500, #6b7280);
  font-weight: 600;
}

.fe30-wizard-title {
  margin: var(--space-2, 8px) 0 var(--space-2, 8px);
  color: var(--dark-navy, #202f3d);
  font-size: 28px;
  line-height: 1.2;
}

.fe30-wizard-subtitle {
  color: var(--gray-600, #525252);
  margin: 0;
  max-width: 80ch;
}

.fe30-wizard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5, 20px);
}

@media (min-width: 1080px) {
  .fe30-wizard-grid {
    grid-template-columns: 1.35fr 1fr;
  }
}

.fe30-wizard-card {
  background: var(--bg-white, #fff);
  border: 1px solid var(--gray-300, #d1d5db);
  border-radius: var(--radius-lg, 16px);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.04));
  padding: var(--space-5, 20px);
}

.fe30-wizard-card h2 {
  margin: 0 0 var(--space-4, 16px);
  font-size: 18px;
  color: var(--dark-navy, #202f3d);
}

.fe30-wizard-form {
  display: grid;
  gap: var(--space-4, 16px);
}

.fe30-wizard-field {
  display: grid;
  gap: var(--space-2, 8px);
}

.fe30-wizard-fieldset {
  display: grid;
  gap: var(--space-3, 12px);
  padding: var(--space-3, 12px);
  border-radius: var(--radius-md, 12px);
  border: 1px solid var(--gray-300, #d1d5db);
  background: var(--bg-gray-50, #f9fafb);
}

.fe30-wizard-fieldset[hidden] {
  display: none;
}

.fe30-owner-grid {
  display: grid;
  gap: var(--space-2, 8px);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.fe30-owner-list {
  display: grid;
  gap: var(--space-2, 8px);
}

.fe30-owner-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3, 12px);
  padding: var(--space-2, 8px) var(--space-3, 12px);
  border-radius: var(--radius-md, 12px);
  border: 1px solid var(--gray-300, #d1d5db);
  background: var(--bg-white, #fff);
}

.fe30-wizard-range {
  width: 100%;
}

.fe30-fee-meta {
  display: flex;
  gap: var(--space-3, 12px);
  font-size: 13px;
  color: var(--gray-600, #525252);
}

.fe30-wizard-field label {
  font-weight: 600;
  color: var(--ink-primary, #0a0a0a);
}

.fe30-wizard-input,
.fe30-wizard-textarea,
.fe30-wizard-select {
  box-sizing: border-box;
  max-width: 100%;
  width: 100%;
  border: 1px solid var(--gray-300, #d1d5db);
  border-radius: var(--radius-md, 12px);
  padding: 12px 14px;
  font: inherit;
  font-size: var(--text-base, 14px);
  color: var(--ink-primary, #0a0a0a);
  background: var(--bg-white, #fff);
}

.fe30-wizard-textarea {
  min-height: 120px;
  resize: vertical;
}

.fe30-wizard-input:focus,
.fe30-wizard-textarea:focus,
.fe30-wizard-select:focus {
  outline: none;
  border-color: var(--brand-orange, #fb6a18);
  box-shadow: var(--shadow-focus-orange, 0 0 0 3px rgba(251, 106, 24, 0.25));
}

.fe30-wizard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3, 12px);
}

.fe30-wizard-status {
  padding: 4px 0;
  font-size: 13px;
  font-weight: 450;
  letter-spacing: -0.01em;
  color: var(--gray-500, #6b7280);
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
}

.fe30-wizard-status:not(:empty) {
  opacity: 1;
  pointer-events: auto;
}

.fe30-wizard-status[data-state="loading"] {
  color: var(--gray-500, #6b7280);
}

.fe30-wizard-status[data-state="loading"]::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border: 1.5px solid rgba(0, 0, 0, 0.08);
  border-top-color: var(--gray-400, #9ca3af);
  border-radius: 50%;
  animation: fe30-spin 0.8s linear infinite;
}

@keyframes fe30-spin {
  to { transform: rotate(360deg); }
}

.fe30-wizard-status[data-state="error"] {
  color: #dc2626;
}

.fe30-wizard-status[data-state="success"] {
  color: #059669;
}

.fe30-wizard-metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3, 12px);
}

@media (min-width: 760px) {
  .fe30-wizard-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.fe30-wizard-metric {
  border: 1px solid var(--gray-300, #d1d5db);
  border-radius: var(--radius-md, 12px);
  padding: var(--space-3, 12px);
  background: var(--bg-gray-50, #f9fafb);
}

.fe30-wizard-metric-label {
  color: var(--gray-500, #6b7280);
  font-size: 12px;
  margin: 0 0 4px;
}

.fe30-wizard-metric-value {
  margin: 0;
  color: var(--dark-navy, #202f3d);
  font-weight: 700;
  font-size: 20px;
}

.fe30-wizard-context {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2, 8px);
}

.fe30-nb-step-host .fe30-wizard-field > span {
  color: var(--gray-600, #525252);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.fe30-nb-step-host .fe30-wizard-input[type="number"] {
  font-variant-numeric: tabular-nums;
}

.fe30-wizard-chip {
  border-radius: var(--radius-pill, 999px);
  border: 1px solid var(--gray-300, #d1d5db);
  background: var(--bg-white, #fff);
  color: var(--gray-700, #404040);
  padding: 6px 10px;
  font-size: 12px;
}

/* Quick ticket (operations request) — scoped layout + account combobox + file list */
.fe30-qtk .fe30-qtk-single {
  grid-template-columns: 1fr;
  max-width: 720px;
}

.fe30-qtk .fe30-qtk-status {
  margin-top: var(--space-2, 8px);
}

/* Apple-style single-card layout: one focused surface, generous max width, no
   extra grid wrapper. Centers the card so the page feels composed, not docked. */
.fe30-qtk-page {
  max-width: 720px;
  margin-inline: auto;
}

.fe30-qtk-card {
  padding: var(--space-6, 24px);
}

/* Inline status: invisible until JS writes a real message, so the form stays
   calm pre-submit and only speaks up when there is news to share. */
.fe30-qtk-inline-status:empty {
  display: none;
}

/* "Optional" pill on field labels — a soft hint that does not compete with the
   real label or the required fields. Required fields simply have no pill. */
.fe30-qtk-optional {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--gray-500, #6b7280);
  background: var(--bg-gray-100, #f3f4f6);
  border-radius: var(--radius-pill, 999px);
  vertical-align: middle;
  letter-spacing: 0;
  text-transform: none;
}

/* Subtle text-link button used for secondary actions ("View open tickets",
   "Clear" account). Uses the brand orange so it reads as actionable without
   the visual weight of a full button. */
.fe30-qtk-link {
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--brand-orange, #fb6a18);
  cursor: pointer;
  text-decoration: none;
}

.fe30-qtk-link:hover {
  text-decoration: underline;
}

.fe30-qtk-link:focus-visible {
  outline: 2px solid var(--brand-orange, #fb6a18);
  outline-offset: 2px;
  border-radius: var(--radius-xs, 6px);
}

/* Push the secondary link to the right of the primary CTA so the eye lands on
   "Send request" first and the link sits as a quiet escape hatch. */
.fe30-qtk .fe30-wizard-actions {
  align-items: center;
  justify-content: flex-start;
}

.fe30-qtk .fe30-wizard-actions .fe30-qtk-link {
  margin-left: auto;
}

.fe30-qtk-hint {
  margin: 0;
  font-size: 13px;
  color: var(--gray-600, #525252);
  line-height: 1.45;
}

.fe30-qtk-account-wrap {
  position: relative;
}

.fe30-qtk-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 20;
  margin: 0;
  padding: var(--space-2, 8px) 0;
  list-style: none;
  max-height: 240px;
  overflow: auto;
  background: var(--bg-white, #fff);
  border: 1px solid var(--gray-300, #d1d5db);
  border-radius: var(--radius-md, 12px);
  box-shadow: var(--shadow-md, 0 4px 6px rgba(0, 0, 0, 0.08));
}

.fe30-qtk-suggestions li {
  padding: 10px 12px;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink-primary, #0a0a0a);
}

.fe30-qtk-suggestions li:hover,
.fe30-qtk-suggestions li:focus {
  background: var(--bg-gray-50, #f9fafb);
}

.fe30-qtk-clear-account {
  margin-top: var(--space-2, 8px);
}

.fe30-qtk-file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.fe30-qtk-dropzone {
  position: relative;
  border: 1px dashed var(--gray-300, #d1d5db);
  border-radius: var(--radius-md, 12px);
  background: var(--bg-gray-50, #f9fafb);
  min-height: 72px;
  padding: var(--space-4, 16px);
  display: flex;
  align-items: center;
  transition:
    border-color var(--duration-base, 200ms) var(--ease-standard, ease),
    background-color var(--duration-base, 200ms) var(--ease-standard, ease);
}

.fe30-qtk-dropzone-hint {
  margin: 0;
  color: var(--gray-600, #525252);
  font-size: 14px;
}

.fe30-qtk-dropzone:hover,
.fe30-qtk-dropzone-active {
  border-color: var(--brand-orange, #fb6a18);
  background: rgba(251, 106, 24, 0.06);
}

.fe30-qtk-dropzone:focus-visible {
  outline: 2px solid var(--brand-orange, #fb6a18);
  outline-offset: 2px;
}

.fe30-qtk-file-list {
  margin: var(--space-2, 8px) 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--space-2, 8px);
}

.fe30-qtk-file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3, 12px);
  padding: var(--space-2, 8px) var(--space-3, 12px);
  border: 1px solid var(--gray-300, #d1d5db);
  border-radius: var(--radius-md, 12px);
  background: var(--bg-gray-50, #f9fafb);
}

.fe30-qtk-file-name {
  font-size: 14px;
  color: var(--gray-700, #404040);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fe30-qtk-file-remove {
  flex-shrink: 0;
  padding: 6px 10px;
  font-size: 13px;
}

/* ── Billing Exclusion Wizard ──────────────────────────────── */

.fe30-bx-inline-spinner {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border: 2px solid var(--gray-300, #d1d5db);
  border-top-color: var(--brand-orange, #fb6a18);
  border-radius: 50%;
  animation: fe30-spin 0.6s linear infinite;
}

.fe30-bx-positions-list {
  display: grid;
  gap: 0;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: var(--radius-md, 12px);
  overflow: hidden;
}

.fe30-bx-pos-row {
  display: flex;
  align-items: center;
  gap: var(--space-3, 12px);
  padding: var(--space-3, 12px) var(--space-4, 16px);
  border-bottom: 1px solid var(--gray-100, #f3f4f6);
  cursor: pointer;
  transition: background 0.15s;
}

.fe30-bx-pos-row:last-child {
  border-bottom: none;
}

.fe30-bx-pos-row:hover {
  background: var(--bg-gray-50, #f9fafb);
}

.fe30-bx-pos-row--disabled {
  opacity: 0.55;
  cursor: default;
}

.fe30-bx-pos-cb {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  accent-color: var(--brand-orange, #fb6a18);
}

.fe30-bx-pos-identity {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fe30-bx-pos-ticker {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-primary, #0a0a0a);
  line-height: 1.3;
}

.fe30-bx-pos-desc {
  font-size: 13px;
  color: var(--gray-600, #525252);
  line-height: 1.35;
  word-break: break-word;
}

.fe30-bx-pos-value {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700, #404040);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.fe30-bx-pos-hint {
  font-size: 12px;
  color: var(--gray-400, #9ca3af);
  font-style: italic;
}

.fe30-bx-review-heading {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 var(--space-3, 12px);
}

.fe30-bx-review-list {
  margin: 0 0 var(--space-4, 16px);
  padding-left: var(--space-5, 20px);
  line-height: 1.6;
}

.fe30-bx-submit-status {
  margin-top: var(--space-4, 16px);
  padding: var(--space-3, 12px) var(--space-4, 16px);
  border-radius: var(--radius-md, 12px);
  font-size: 14px;
  line-height: 1.45;
}

.fe30-bx-submit-status[data-state="error"] {
  background: var(--error-bg, #fef2f2);
  color: var(--error, #dc2626);
}

.fe30-bx-submit-status[hidden] {
  display: none;
}

.fe30-bx-result-msg {
  font-weight: 600;
  color: var(--ink-primary, #0a0a0a);
  margin: var(--space-4, 16px) 0 0;
}

.fe30-bx-result-skip {
  font-size: 13px;
  color: var(--gray-500, #6b7280);
  margin: var(--space-2, 8px) 0 0;
}

.fe30-bx-ticket-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2, 8px);
  margin-top: var(--space-3, 12px);
  padding: var(--space-2, 8px) var(--space-4, 16px);
  border-radius: var(--radius-pill, 999px);
  font-size: 14px;
  font-weight: 600;
  background: var(--success-bg, #f0fdf4);
  color: var(--success, #16a34a);
  border: 1px solid color-mix(in srgb, var(--success, #16a34a) 25%, transparent);
}

.fe30-bx-result-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3, 12px);
  margin-top: var(--space-4, 16px);
}

.fe30-bx-grid {
  grid-template-columns: 1fr;
}

/* ------------------------------------------------------------------------
   Billing exclusion wizard — action bar (Back + Continue on one row)
   Page uses fe30-bx-page, not fe30-allocate-page, so allocate overrides
   do not apply. Mirror fee-change / allocate single-row contract.
   ------------------------------------------------------------------------ */

.fe30-bx-page .fe30-nb-actionbar {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  justify-content: space-between;
  gap: var(--space-3, 12px);
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin-top: var(--space-5, 20px);
  padding: var(--space-3, 12px) var(--space-5, 20px);
  background: var(--bg-white, #fff);
  border-top: 1px solid var(--gray-300, #d1d5db);
  border-radius: var(--radius-xl, 20px) var(--radius-xl, 20px) 0 0;
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.05);
}

.fe30-bx-page .fe30-nb-actionbar #fe30-bx-back {
  order: 0;
  min-width: 96px;
}

.fe30-bx-page .fe30-nb-actionbar #fe30-bx-next {
  order: 2;
  min-width: 160px;
  padding: 12px 22px;
  font-weight: 600;
  margin-left: auto;
  transition:
    transform var(--duration-fast, 150ms) var(--ease-standard, ease),
    box-shadow var(--duration-base, 200ms) var(--ease-standard, ease),
    opacity var(--duration-base, 200ms) var(--ease-standard, ease),
    filter var(--duration-base, 200ms) var(--ease-standard, ease);
}

.fe30-bx-page .fe30-nb-actionbar #fe30-bx-next[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(0.3);
  transform: none;
  box-shadow: none;
}

.fe30-bx-page .fe30-nb-actionbar #fe30-bx-back[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.fe30-bx-page .fe30-nb-actionbar .fe30-nb-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.fe30-bx-page .fe30-nb-actionbar #fe30-bx-next[aria-busy="true"] {
  pointer-events: none;
  opacity: 0.85;
}

.fe30-bx-page .fe30-nb-actionbar #fe30-bx-next[aria-busy="true"]::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 6px;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: fe30-spin 0.7s linear infinite;
  vertical-align: middle;
}

.fe30-bx-page .fe30-nb-actionbar #fe30-bx-next.fe30-btn--submit-loading[aria-busy="true"]::before {
  display: none;
}

.fe30-bx-page .fe30-nb-actionbar .fe30-wizard-status[data-state="loading"]::before {
  display: none;
}

@media (max-width: 720px) {
  .fe30-bx-page .fe30-nb-actionbar #fe30-bx-next {
    min-width: 0;
    flex: 1 1 auto;
  }
}
