/* =========================================================================
   MAESTROX — Glass inputs (search + text + select)
   Extends glass.css. Drop in after it; both files use the same tokens.
   ========================================================================= */

/* Base glass input — search, text, email, password, etc.
   Use against canvas, glass surfaces, or dark backdrops. */
.glass-input {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  /* Solid cream by default — most app surfaces are opaque cream
     cards, so backdrop-filter blur was wasted GPU work and the
     primary source of the May-2026 hover-lag Drew flagged. The
     .dark variant below opts back into the blur where the surface
     is actually translucent enough for it to matter. */
  background: rgba(255, 252, 244, 0.95);
  border: 1px solid rgba(200, 169, 94, 0.28);
  border-radius: 6px;
  box-shadow:
    0 6px 20px rgba(40, 28, 12, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  /* Drop background from the transition list — alpha-shift on a
     non-blurred surface is cheap, but stacking it with box-shadow
     transitions used to flash the compositor. */
  transition: border-color 200ms var(--ease), box-shadow 200ms var(--ease);
  position: relative;
}
.glass-input:hover { border-color: rgba(200, 169, 94, 0.45); }
.glass-input:focus-within {
  border-color: var(--gold);
  background: rgba(255, 252, 244, 0.82);
  box-shadow:
    0 6px 24px rgba(200, 169, 94, 0.22),
    0 0 0 4px rgba(200, 169, 94, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.glass-input .icon {
  width: 18px; height: 18px;
  color: rgba(40, 28, 12, 0.55);
  stroke: currentColor; stroke-width: 1.8; fill: none;
  flex-shrink: 0;
  transition: color 200ms var(--ease);
}
.glass-input:focus-within .icon { color: var(--gold); }

.glass-input input,
.glass-input textarea {
  flex: 1;
  background: transparent;
  border: 0;
  outline: none;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--fg-1);
  letter-spacing: 0.005em;
  padding: 0;
  min-width: 0;
}
/* Defensive: base.css (and a couple of feature-specific files) paint a
   gold focus halo / border-color shift on every focused input. Inside
   the .glass-input wrapper that halo reads as a secondary rectangle
   floating inside the glass surface — exactly the artifact Drew
   flagged against the design system mock. The wrapper's own
   :focus-within rule handles the focused affordance; the inner
   <input> shouldn't compete. */
.glass-input input:focus,
.glass-input textarea:focus {
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
}
.glass-input input::placeholder,
.glass-input textarea::placeholder {
  color: rgba(40, 28, 12, 0.45);
  font-weight: 500;
}

/* Right-side affordances: shortcut key chip, clear button, action button */
.glass-input .shortcut {
  font-family: ui-monospace, monospace;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 3px 7px;
  background: rgba(40, 28, 12, 0.08);
  color: rgba(40, 28, 12, 0.6);
  border-radius: 3px;
  border: 1px solid rgba(40, 28, 12, 0.08);
  flex-shrink: 0;
}
.glass-input .clear {
  width: 18px; height: 18px;
  border: 0;
  background: rgba(40, 28, 12, 0.12);
  color: rgba(40, 28, 12, 0.65);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 11px;
  flex-shrink: 0;
}
.glass-input .clear:hover { background: var(--gold); color: var(--fg-on-gold); }
.glass-input .submit-btn {
  background: var(--gold);
  color: var(--fg-on-gold);
  border: 0;
  border-radius: 4px;
  padding: 6px 12px;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  flex-shrink: 0;
}
.glass-input .submit-btn:hover { background: var(--gold-hover); }

/* ---- Variants ---- */

/* Large hero search — used at the top of Reports, Library, Asset hubs */
.glass-input.lg {
  padding: 16px 20px;
  border-radius: 8px;
}
.glass-input.lg .icon { width: 20px; height: 20px; }
.glass-input.lg input { font-size: 16px; letter-spacing: 0.01em; }

/* Small / compact — fits in toolbars, sidebars */
.glass-input.sm {
  padding: 8px 12px;
  border-radius: 4px;
  gap: 8px;
}
.glass-input.sm .icon { width: 15px; height: 15px; }
.glass-input.sm input { font-size: 13px; }

/* Pill — full-rounded, used in chips / nav bars */
.glass-input.pill { border-radius: 999px; padding-left: 18px; padding-right: 18px; }

/* Dark — for sidebar, dark canvas, focus modals */
.glass-input.dark {
  background: rgba(15, 12, 8, 0.55);
  border-color: rgba(200, 169, 94, 0.22);
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.glass-input.dark input,
.glass-input.dark textarea { color: var(--fg-on-dark); }
.glass-input.dark input::placeholder,
.glass-input.dark textarea::placeholder { color: rgba(243, 234, 212, 0.4); }
.glass-input.dark .icon { color: rgba(243, 234, 212, 0.55); }
.glass-input.dark:focus-within {
  background: rgba(15, 12, 8, 0.72);
  border-color: var(--gold);
  box-shadow:
    0 6px 24px rgba(200, 169, 94, 0.2),
    0 0 0 4px rgba(200, 169, 94, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.glass-input.dark .shortcut {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(243, 234, 212, 0.6);
  border-color: rgba(255, 255, 255, 0.06);
}

/* Error / success states */
.glass-input.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(184, 52, 28, 0.14);
}
.glass-input.success {
  border-color: var(--success);
}

/* ---- Field group: label above, helper below ---- */
.glass-field {
  display: flex; flex-direction: column;
  gap: 8px;
}
.glass-field .lbl {
  font-family: var(--font-body);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: rgba(40, 28, 12, 0.65);
}
.glass-field .lbl .req { color: var(--gold); margin-left: 4px; }
.glass-field .help {
  font-size: 11.5px;
  color: rgba(40, 28, 12, 0.55);
  line-height: 1.45;
}
.glass-field .help.error { color: var(--danger); font-weight: 600; }

/* Dark field labels */
.canvas-dark .glass-field .lbl,
.glass.dark .glass-field .lbl { color: rgba(200, 169, 94, 0.85); }
.canvas-dark .glass-field .help,
.glass.dark .glass-field .help { color: rgba(243, 234, 212, 0.55); }

/* Textarea variant */
.glass-input.area {
  align-items: flex-start;
  padding: 14px 16px;
}
.glass-input.area textarea {
  min-height: 88px;
  resize: vertical;
  line-height: 1.55;
}

/* Multi-input row (search + filter dropdown) */
.glass-input-row {
  display: flex; gap: 8px;
  align-items: stretch;
}
.glass-input-row .glass-input { flex: 1; }

@media (prefers-reduced-motion: reduce) {
  .glass-input { transition: none; }
}
