/* Worker profile editor typography + color pass.
   Intentionally limited to font sizing, weight and color. */

:root {
  --ms-editor-navy: #0B2545;
  --ms-editor-sky: #0893cd;
  --ms-editor-text: #334155;
  --ms-editor-muted: #94a3b8;
  --ms-editor-label: #64748b;
}

/* Shared dialog titles. */
.worker-editor-dialog h2,
.worker-editor-dialog [data-slot="dialog-title"],
.worker-structured-dialog h2,
.worker-structured-dialog [data-slot="dialog-title"] {
  font-size: 20px !important;
  line-height: 1.25 !important;
  font-weight: 900 !important;
  letter-spacing: -0.02em !important;
  color: var(--ms-editor-navy) !important;
}

/* Shared dialog descriptions/subtitles. */
.worker-editor-dialog [data-slot="dialog-description"],
.worker-structured-dialog [data-slot="dialog-description"],
.worker-editor-dialog > div:first-of-type p:not([class*="font-black"]),
.worker-structured-dialog > div:first-of-type p:not([class*="font-black"]) {
  font-size: 12px !important;
  line-height: 1.45 !important;
  font-weight: 500 !important;
  color: var(--ms-editor-muted) !important;
}

/* Section names and item titles. */
.worker-editor-dialog .font-black,
.worker-structured-dialog .font-black {
  color: var(--ms-editor-navy);
}

.worker-editor-dialog > .space-y-5 > div > p.text-sm.font-black,
.worker-structured-dialog .min-h-0.flex-1 > div:first-child p.text-sm.font-black,
.worker-structured-dialog article > div:first-child p:first-child {
  font-size: 14px !important;
  line-height: 1.3 !important;
  font-weight: 900 !important;
  color: var(--ms-editor-navy) !important;
}

/* Field labels: identical in QuickEdit and Structured Editor. */
.worker-editor-dialog label,
.worker-editor-dialog [class*="text-xs"][class*="font-bold"],
.worker-structured-dialog label,
.worker-structured-dialog [class*="tracking-"][class*="uppercase"] {
  color: var(--ms-editor-label) !important;
}

.worker-editor-dialog label:not(:has(input[type="file"])),
.worker-structured-dialog label:not(:has(input[type="file"])) {
  font-size: 10px !important;
  line-height: 1.25 !important;
  font-weight: 900 !important;
  letter-spacing: 0.08em !important;
}

/* Cosa sto cercando: le label erano l'unica eccezione visivamente troppo piccola. */
.worker-editor-dialog[data-editor-section="goals"] label:not(:has(input[type="file"])) {
  font-size: 12px !important;
  line-height: 1.3 !important;
  font-weight: 800 !important;
  letter-spacing: 0.01em !important;
  color: #475569 !important;
}

/* User-entered values. */
.worker-editor-dialog input,
.worker-editor-dialog textarea,
.worker-editor-dialog select,
.worker-structured-dialog input,
.worker-structured-dialog textarea,
.worker-structured-dialog select {
  font-size: 14px !important;
  line-height: 1.4 !important;
  font-weight: 600 !important;
  color: var(--ms-editor-text) !important;
}

/* iOS/WKWebView zooma automaticamente al focus se un controllo ha font < 16px.
   Portiamo solo i controlli editabili a 16px su iPhone/iPad, lasciando invariati label e layout. */
@supports (-webkit-touch-callout: none) {
  @media (pointer: coarse) {
    .worker-editor-dialog input,
    .worker-editor-dialog textarea,
    .worker-editor-dialog select,
    .worker-structured-dialog input,
    .worker-structured-dialog textarea,
    .worker-structured-dialog select,
    main.mx-auto.max-w-2xl section:has(button[aria-label="Chiudi modifica"]) input,
    main.mx-auto.max-w-2xl section:has(button[aria-label="Chiudi modifica"]) textarea,
    main.mx-auto.max-w-2xl section:has(button[aria-label="Chiudi modifica"]) select {
      font-size: 16px !important;
    }
  }
}

.worker-editor-dialog input::placeholder,
.worker-editor-dialog textarea::placeholder,
.worker-structured-dialog input::placeholder,
.worker-structured-dialog textarea::placeholder {
  color: var(--ms-editor-muted) !important;
  opacity: 1 !important;
  font-weight: 500 !important;
}

/* Helper text and counters. */
.worker-editor-dialog [class*="text-[10px]"]:not(button),
.worker-structured-dialog [class*="text-[10px]"]:not(button),
.worker-editor-dialog [class*="text-slate-400"],
.worker-structured-dialog [class*="text-slate-400"] {
  color: var(--ms-editor-muted) !important;
}

/* Add buttons + active sky actions. */
.worker-editor-dialog button[class*="text-[#0893cd]"],
.worker-structured-dialog button[class*="text-[#0893cd]"],
.worker-editor-dialog label[class*="text-[#0893cd]"],
.worker-structured-dialog label[class*="text-[#0893cd]"] {
  color: var(--ms-editor-sky) !important;
}

/* Chips keep white text only when selected; neutral chips use the common slate. */
.worker-editor-dialog button[class*="bg-[#0893cd]"] {
  color: #fff !important;
  font-size: 11px !important;
  font-weight: 900 !important;
}

.worker-editor-dialog button[class*="text-slate-500"] {
  color: var(--ms-editor-label) !important;
  font-size: 11px !important;
  font-weight: 900 !important;
}

/* Footer typography identical in both editors. */
.worker-editor-dialog > div:last-child button,
.worker-structured-dialog > div:last-child button {
  font-size: 12px !important;
  line-height: 1 !important;
  font-weight: 900 !important;
  letter-spacing: 0.055em !important;
}

/* Active Salva buttons: sky background always uses white text/icon for contrast. */
.worker-editor-dialog > div:last-child button[class*="bg-[#0893cd]"],
.worker-structured-dialog > div:last-child button[class*="bg-[#0893cd]"] {
  color: #ffffff !important;
}

.worker-editor-dialog > div:last-child button[class*="bg-[#0893cd]"] svg,
.worker-structured-dialog > div:last-child button[class*="bg-[#0893cd]"] svg {
  color: #ffffff !important;
  stroke: currentColor !important;
}

/* Inline legacy editors: same typography while they remain inline. */
main.mx-auto.max-w-2xl section:has(button[aria-label="Chiudi modifica"]) input,
main.mx-auto.max-w-2xl section:has(button[aria-label="Chiudi modifica"]) select,
main.mx-auto.max-w-2xl section:has(button[aria-label="Chiudi modifica"]) textarea {
  font-size: 14px !important;
  font-weight: 600 !important;
  color: var(--ms-editor-text) !important;
}

main.mx-auto.max-w-2xl section:has(button[aria-label="Chiudi modifica"]) label {
  font-size: 10px !important;
  font-weight: 900 !important;
  color: var(--ms-editor-label) !important;
}

html.dark .worker-editor-dialog h2,
html.dark .worker-editor-dialog [data-slot="dialog-title"],
html.dark .worker-structured-dialog h2,
html.dark .worker-structured-dialog [data-slot="dialog-title"],
html.dark .worker-editor-dialog .font-black,
html.dark .worker-structured-dialog .font-black {
  color: #f8fafc !important;
}

html.dark .worker-editor-dialog input,
html.dark .worker-editor-dialog textarea,
html.dark .worker-editor-dialog select,
html.dark .worker-structured-dialog input,
html.dark .worker-structured-dialog textarea,
html.dark .worker-structured-dialog select {
  color: #e2e8f0 !important;
}

html.dark .worker-editor-dialog label,
html.dark .worker-structured-dialog label {
  color: #94a3b8 !important;
}

html.dark .worker-editor-dialog[data-editor-section="goals"] label:not(:has(input[type="file"])) {
  color: #cbd5e1 !important;
}
