@import "tailwindcss";

@source "../.././*.php";
@source "../../admin/**/*.php";
@source "../../includes/**/*.php";
@source "../../assets/**/*.js";
@source "../../task-comms/**/*.php";

/* ══════════════════════════════════════════════════════════════
   Asana Form Builder — Design System
   Shared tokens with triage-gpt for seamless flow
   ══════════════════════════════════════════════════════════════ */

/* ── Smooth global transitions (mirrors triage-gpt) ────────── */
button, input, select, textarea {
  transition: all 0.2s ease;
}

/* ════════════════════════════════════════════════════════════
   1. FORM TITLE
   ════════════════════════════════════════════════════════════ */

.asana-title-wrap {
  padding: 0 0.25rem;
}

.asana-title-wrap h1,
.asana-title-wrap .js-project-title {
  font-size: 1.4rem !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  margin: 0 0 0.75rem !important;
  letter-spacing: -0.02em !important;
  line-height: 1.2 !important;
}

/* ════════════════════════════════════════════════════════════
   2. CARD WRAPPER (mirrors triage-glass-card)
   ════════════════════════════════════════════════════════════ */

.asana-form-wrapper {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 1.5rem;
  padding: 2.5rem 2.25rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
  margin-top: 0;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .asana-form-wrapper {
    max-width: 860px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Mobile: edge-to-edge, no card */
@media (max-width: 640px) {
  .asana-form-wrapper {
    background: transparent !important;
    box-shadow: none        !important;
    border: none            !important;
    border-radius: 0        !important;
    margin: 0               !important;
    width: 100%             !important;
    max-width: none         !important;
    padding: 1rem           !important;
  }
}

/* ════════════════════════════════════════════════════════════
   3. FORM CONTAINER
   ════════════════════════════════════════════════════════════ */

.asana-form-container {
  max-width: 1024px;
  margin: 0 auto;
}

/* ════════════════════════════════════════════════════════════
   4. FORM INPUTS (mirrors triage-field-input)
   ════════════════════════════════════════════════════════════ */

.asana-dynamic-form input[type="text"],
.asana-dynamic-form input[type="date"],
.asana-dynamic-form input[type="email"],
.asana-dynamic-form input[type="number"],
.asana-dynamic-form select,
.asana-dynamic-form textarea {
  width: 100%;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  color: #0f172a;
  font-size: 0.875rem;
  outline: none;
  box-sizing: border-box;
  display: block;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.asana-dynamic-form input::placeholder,
.asana-dynamic-form textarea::placeholder,
.asana-dynamic-form select::placeholder {
  color: #9ca3af;
}

.asana-dynamic-form input:focus,
.asana-dynamic-form select:focus,
.asana-dynamic-form textarea:focus {
  background: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
  outline: none;
}

/* Validation error state */
.asana-dynamic-form input.afb-field-error,
.asana-dynamic-form select.afb-field-error,
.asana-dynamic-form textarea.afb-field-error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.15);
}

.asana-dynamic-form textarea {
  resize: none;
  line-height: 1.5;
}

/* ════════════════════════════════════════════════════════════
   5. LABELS
   ════════════════════════════════════════════════════════════ */

.asana-dynamic-form label {
  display: block;
}

label[data-field-id] {
  margin-bottom: 0.5rem;
}

.asana-dynamic-form label > span.text-gray-700,
.asana-dynamic-form label > span:first-child {
  font-size: 0.875rem;
  font-weight: 600;
  color: #0f172a;
  display: block;
  margin-bottom: 0.35rem;
}

.asana-dynamic-form .text-sm.text-gray-500 {
  color: #64748b;
  font-size: 0.8rem;
  line-height: 1.5;
}

.afb-single-ai-helper {
  margin-top: 0.65rem;
  background: #f8fafc;
  border: 1px solid #dbeafe;
  border-radius: 0.75rem;
  padding: 0.6rem 0.75rem;
}

.afb-single-ai-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.afb-single-ai-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.asana-dynamic-form .afb-single-ai-preset {
  width: auto;
  min-width: 9.5rem;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.38rem 0.45rem;
  line-height: 1.15;
  box-shadow: none;
}

.asana-dynamic-form .afb-single-ai-preset:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37,99,235,0.15);
}

.afb-single-ai-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.55rem;
  text-transform: uppercase;
}

.asana-dynamic-form .afb-single-ai-btn {
  width: auto;
  border: 1px solid #005EB8;
  background: #ffffff;
  color: #005EB8;
  border-radius: 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.1;
  padding: 0.42rem 0.7rem;
  box-shadow: none;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.asana-dynamic-form .afb-single-ai-btn:hover:not(:disabled) {
  background: #E6F6FF;
  border-color: #003E96;
  color: #003E96;
}

.asana-dynamic-form .afb-single-ai-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.afb-single-ai-note {
  margin-top: 0.45rem;
}

/* ════════════════════════════════════════════════════════════
   6. SUBMIT BUTTON
   ════════════════════════════════════════════════════════════ */

.asana-dynamic-form button[type="submit"],
.asana-dynamic-form .header-and-submit button {
  width: 100%;
  background: #005EB8;
  color: white;
  border: none;
  border-radius: 0.75rem;
  padding: 0.9rem 1.5rem;
  font-size: 0.93rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(37,99,235,0.38);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.asana-dynamic-form button[type="submit"]::after,
.asana-dynamic-form .header-and-submit button::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
  transition: left 0.55s ease;
}

.asana-dynamic-form button[type="submit"]:hover::after,
.asana-dynamic-form .header-and-submit button:hover::after {
  left: 100%;
}

.asana-dynamic-form button[type="submit"]:hover,
.asana-dynamic-form .header-and-submit button:hover {
  background: #003E96;
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(37,99,235,0.48);
}

.asana-dynamic-form button[type="submit"]:active,
.asana-dynamic-form .header-and-submit button:active {
  transform: translateY(0);
}

/* Disabled/busy state */
.asana-dynamic-form button[type="submit"].opacity-60 {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 4px 18px rgba(37,99,235,0.2);
}

/* ════════════════════════════════════════════════════════════
   6b. STEP NAV BUTTONS (Back / Next)
   ════════════════════════════════════════════════════════════ */

.asana-dynamic-form .afb-step-next {
  background: #005EB8 !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 0.75rem !important;
  padding: 0.9rem 1.5rem !important;
  font-size: 0.93rem !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 18px rgba(0,94,184,0.35) !important;
  transition: transform 0.18s ease, box-shadow 0.18s ease !important;
}

.asana-dynamic-form .afb-step-next:hover {
  background: #003E96 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 10px 28px rgba(0,94,184,0.45) !important;
}

.asana-dynamic-form .afb-step-next:active {
  transform: translateY(0) !important;
}

.asana-dynamic-form .afb-step-back {
  background: #ffffff !important;
  color: #005EB8 !important;
  border: 2px solid #005EB8 !important;
  border-radius: 0.75rem !important;
  padding: 0.9rem 1.5rem !important;
  font-size: 0.93rem !important;
  font-weight: 600 !important;
  box-shadow: none !important;
  transition: background 0.18s ease, color 0.18s ease !important;
}

.asana-dynamic-form .afb-step-back:hover {
  background: #E6F6FF !important;
  box-shadow: 0 2px 10px rgba(0,94,184,0.15) !important;
}

/* ════════════════════════════════════════════════════════════
   7. SELECT (PROJECT PICKER)
   ════════════════════════════════════════════════════════════ */

.asana-dynamic-form .project-picker {
  width: 100%;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  color: #0f172a;
  font-size: 0.875rem;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%2364748b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.asana-dynamic-form .project-picker:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}

/* ════════════════════════════════════════════════════════════
   8. TRIAGE SUMMARY CARD
   ════════════════════════════════════════════════════════════ */

.afb-triage-summary {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #2563eb;
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.afb-triage-summary h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.5rem;
}

.afb-triage-summary .afb-triage-summary-body {
  font-size: 0.85rem;
  color: #475569;
  line-height: 1.6;
}

.afb-triage-summary ul {
  padding-left: 1.25em;
  margin: 0.5rem 0;
}

.afb-triage-summary li {
  margin-bottom: 0.25rem;
}

/* Breathing room between triage summary and upload section */
.afb-triage-summary {
  margin-bottom: 1.5rem;
}

.afb-upload-section {
  margin-top: 1.5rem;
}

/* ════════════════════════════════════════════════════════════
   9. PARAGRAPH BLOCKS
   ════════════════════════════════════════════════════════════ */

.afb-paragraph-block {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.afb-paragraph-block h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.35rem;
}

.afb-paragraph-block p {
  color: #475569;
  font-size: 0.85rem;
  line-height: 1.6;
  margin: 0;
}

.afb-notes-textarea {
  min-height: 9rem;
}

/* ════════════════════════════════════════════════════════════
   9b. STEP WIZARD
   ════════════════════════════════════════════════════════════ */

.afb-stepper {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .afb-stepper {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

.afb-step-pill {
  border: 1px solid #dbe3ee;
  background: #ffffff;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.75rem;
  text-align: left;
}

.afb-step-pill-index {
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 999px;
  background: #e2e8f0;
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
}

.afb-step-pill-title {
  font-size: 0.8rem;
  color: #334155;
  font-weight: 600;
}

.afb-step-pill.is-active {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.afb-step-pill.is-active .afb-step-pill-index {
  background: #2563eb;
  color: #ffffff;
}

.afb-step-pill.is-done .afb-step-pill-index {
  background: #0f766e;
  color: #ffffff;
}

.afb-step-intro {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  margin-bottom: 0.8rem;
}

.afb-step-title {
  margin: 0;
  color: #0f172a;
  font-size: 0.95rem;
  font-weight: 700;
}

.afb-step-desc {
  margin: 0.3rem 0 0;
  color: #475569;
  font-size: 0.82rem;
}

/* ════════════════════════════════════════════════════════════
   10. UPLOAD SECTION
   ════════════════════════════════════════════════════════════ */

.asana-dynamic-form .space-y-2.p-4.border.rounded.bg-gray-50 {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
}

.asana-dynamic-form .file-input {
  width: 100%;
  color: #334155;
  font-size: 0.95rem;
  line-height: 1.35;
}

.asana-dynamic-form .file-input::file-selector-button,
.asana-dynamic-form .file-input::-webkit-file-upload-button {
  margin-right: 0.75rem;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #1e293b;
  border-radius: 0.6rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.asana-dynamic-form .file-input:hover::file-selector-button,
.asana-dynamic-form .file-input:hover::-webkit-file-upload-button {
  background: #f8fafc;
  border-color: #94a3b8;
}

.asana-dynamic-form .file-input:focus-visible::file-selector-button,
.asana-dynamic-form .file-input:focus-visible::-webkit-file-upload-button {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.14);
}

.asana-dynamic-form .add-file-btn {
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%) !important;
  color: white !important;
  border: none;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(37,99,235,0.3);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.asana-dynamic-form .add-file-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(37,99,235,0.4);
}

.asana-dynamic-form .remove-file-btn {
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  font-weight: 500;
  cursor: pointer;
}

.asana-dynamic-form .remove-file-btn:hover {
  color: #ef4444;
  border-color: #fecaca;
  background: #fef2f2;
}

/* ════════════════════════════════════════════════════════════
   11. CHECKBOXES (multi-enum)
   ════════════════════════════════════════════════════════════ */

.asana-dynamic-form input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  border-radius: 0.25rem;
  border: 1px solid #d1d5db;
  accent-color: #2563eb;
  cursor: pointer;
}

/* ════════════════════════════════════════════════════════════
   12. PROGRESS BAR
   ════════════════════════════════════════════════════════════ */

.afb-progress-container {
  overflow: hidden;
  border-radius: 9999px;
}

.afb-progress-bar {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  width: 0%;
  transition: width 0.25s ease;
}

.afb-progress-bar--indeterminate {
  position: relative;
  width: 100%;
}

.afb-progress-bar--indeterminate::before {
  content: "";
  position: absolute;
  left: -40%;
  width: 40%;
  height: 100%;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  opacity: 0.9;
  border-radius: 9999px;
  animation: afb-indet 1.2s infinite linear;
}

@keyframes afb-indet { 0% { left: -40%; } 100% { left: 100%; } }

/* ════════════════════════════════════════════════════════════
   13. SUCCESS / STATUS
   ════════════════════════════════════════════════════════════ */

.asana-form-container .text-center.space-y-4 {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 1.5rem;
  padding: 2.5rem 2.25rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
  max-width: 860px;
  margin: 0 auto;
}

.asana-form-container .text-center.space-y-4 .text-xl.font-semibold {
  font-size: 1.4rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
}

/* Copy / Email action buttons (inside success box) */
#copy-job-number-btn,
#email-copy-inline button[type="submit"] {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 0.5rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
}

#copy-job-number-btn:hover,
#email-copy-inline button[type="submit"]:hover {
  border-color: #2563eb;
  color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.08);
}

/* ════════════════════════════════════════════════════════════
   14. LOADING SPINNER
   ════════════════════════════════════════════════════════════ */

.asana-dynamic-form .animate-spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ════════════════════════════════════════════════════════════
   15. FIELD ENTRANCE ANIMATION (matches triage msgIn)
   ════════════════════════════════════════════════════════════ */

.asana-fields > * {
  animation: afbFieldIn 0.22s cubic-bezier(0.4,0,0.2,1) both;
}

@keyframes afbFieldIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0);   }
}

/* ════════════════════════════════════════════════════════════
   16. COMPACT SUBMIT VIEW
   ════════════════════════════════════════════════════════════ */

.asana-dynamic-form.afb-submitting-compact > * {
  display: none !important;
}

/* Keep the submit button (shows "Working…") and the status/progress block visible */
.asana-dynamic-form.afb-submitting-compact > .header-and-submit,
.asana-dynamic-form.afb-submitting-compact > .afb-submit-status {
  display: block !important;
  margin-top: 0 !important;
}

/* Hide wizard nav controls (Back/Next) once submit starts */
.asana-dynamic-form.afb-submitting-compact .afb-step-nav {
  display: none !important;
}

/* Status text should be clearly visible */
.asana-dynamic-form.afb-submitting-compact .afb-submit-status {
  font-size: 0.9rem;
  padding: 0.5rem 0;
}

