/*
 * Unlayered CSS — Tailwind v4 puts generated classes inside @layer utilities
 * which causes them to lose to unlayered user-agent defaults (form elements, etc.)
 * and also makes certain responsive utilities not override correctly.
 * These rules stay outside the Tailwind build pipeline so they remain unlayered.
 */

/* === Responsive Layout Utilities === */
@media (min-width: 64rem) {
  .lg\:flex { display: flex; }
  .lg\:flex-col { flex-direction: column; }
  .lg\:flex-1 { flex: 1; }
  .lg\:min-w-0 { min-width: 0; }
  .lg\:w-56 { width: 14rem; }
  .lg\:w-80 { width: 20rem; }
  .lg\:ml-56 { margin-left: 14rem; }
  .lg\:gap-8 { gap: 2rem; }
  .lg\:static { position: static; }
  .lg\:translate-x-0 { translate: 0; }
  .lg\:hidden { display: none; }
}

/* === Dark Mode — override base Tailwind utility classes so `dark:` variants aren't needed === */

.dark .text-text-muted { color: var(--color-text-muted-dark); }
.dark .text-text { color: var(--color-text-dark); }
.dark .bg-surface { background-color: var(--color-surface-dark); }
.dark .bg-surface-hover { background-color: var(--color-surface-hover-dark); }
.dark .border-border { border-color: var(--color-border-dark); }

/* === Form Elements === */

.pf\:input, .pf\:textarea, .pf\:select {
  width: 100%;
  border-radius: 0.75rem;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.875rem;
  outline: none;
  padding: 0.75rem 1rem;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.pf\:input::placeholder, .pf\:textarea::placeholder {
  color: color-mix(in srgb, var(--color-text-muted) 40%, transparent);
}

.pf\:input:focus, .pf\:textarea:focus, .pf\:select:focus {
  border-color: color-mix(in srgb, var(--color-primary) 60%, transparent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-primary) 25%, transparent);
}

.dark .pf\:input, .dark .pf\:textarea, .dark .pf\:select {
  border-color: var(--color-border-dark);
  background: var(--color-surface-dark);
  color: var(--color-text-dark);
}

.dark .pf\:input::placeholder, .dark .pf\:textarea::placeholder {
  color: color-mix(in srgb, var(--color-text-muted-dark) 40%, transparent);
}

.pf\:textarea {
  min-height: 6rem;
  resize: vertical;
}

.pf\:select {
  appearance: none;
  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='%239ca3af' 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 0.75rem center;
  background-size: 1rem;
  padding-right: 2.5rem;
}

.dark .pf\:select {
  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='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

.pf\:select option {
  background: var(--color-surface);
  color: var(--color-text);
}

.dark .pf\:select option {
  background: var(--color-surface-dark);
  color: var(--color-text-dark);
}

.pf\:label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  color: var(--color-text);
}

.dark .pf\:label {
  color: var(--color-text-dark);
}

.pf\:checkbox, .pf\:radio {
  accent-color: var(--color-primary);
}

.pf\:checkbox {
  border-radius: 0.25rem;
}

.pf\:file {
  width: 100%;
  font-size: 0.875rem;
  color: var(--color-text);
  cursor: pointer;
}

.pf\:file::file-selector-button {
  margin-right: 0.75rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  border: none;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s;
}

.pf\:file::file-selector-button:hover {
  background: var(--color-primary-hover);
}

.dark .pf\:file {
  color: var(--color-text-dark);
}

.pf\:hint {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}

.dark .pf\:hint {
  color: var(--color-text-muted-dark);
}

.pf\:btn {
  width: 100%;
  padding: 0.875rem 1.5rem;
  border-radius: 0.75rem;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: 0 1px 3px 0 rgba(0,0,0,0.1);
  cursor: pointer;
  transition: all .15s;
  border: none;
}

.pf\:btn:hover {
  background: var(--color-primary-hover);
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
  scale: 1.02;
}

.pf\:btn:active {
  scale: 0.98;
}

.pf\:btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  scale: 1;
  box-shadow: none;
}

/* Error state for fields inside field_with_errors wrapper */
.field_with_errors .pf\:input,
.field_with_errors .pf\:textarea,
.field_with_errors .pf\:select {
  border-color: #ef4444;
}

.field_with_errors .pf\:input:focus,
.field_with_errors .pf\:textarea:focus,
.field_with_errors .pf\:select:focus {
  border-color: #ef4444;
  box-shadow: 0 0 0 2px color-mix(in srgb, #ef4444 25%, transparent);
}

/* Disabled state */
.pf\:input:disabled, .pf\:textarea:disabled, .pf\:select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
