/**
 * All of the CSS for the public-facing upload form.
 */

.ffu-wrapper {
  --ffu-primary: #2563eb;
  --ffu-primary-dark: #1d4ed8;
  --ffu-text: #1f2937;
  --ffu-muted: #6b7280;
  --ffu-border: #d1d5db;
  --ffu-bg: #ffffff;
  --ffu-bg-soft: #f9fafb;
  --ffu-danger: #b32d2e;
  --ffu-danger-bg: #fcf0f0;
  --ffu-radius: 8px;

  max-width: 480px;
  padding: 24px;
  box-sizing: border-box;
  background-color: var(--ffu-bg);
  border: 1px solid var(--ffu-border);
  border-radius: var(--ffu-radius);
  color: var(--ffu-text);
  font-size: 14px;
}

.ffu-wrapper * {
  box-sizing: border-box;
}

.ffu-title {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 600;
}

.ffu-input-details {
  margin: 0 0 18px !important;
}

.ffu-input-details label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--ffu-text);
}

.ffu-input-details input[type='text'] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--ffu-border);
  border-radius: 6px;
  font-size: 14px;
}

.ffu-input-details input[type='text']:focus {
  outline: none;
  border-color: var(--ffu-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.ffu-message {
  padding: 10px 14px;
  margin: 0 0 16px;
  border-radius: 6px;
  background-color: #eef4ff;
  border: 1px solid var(--ffu-primary);
  color: var(--ffu-primary-dark);
  font-size: 13px;
}

.ffu-message.ffu-message-error {
  background-color: var(--ffu-danger-bg);
  border-color: var(--ffu-danger);
  color: var(--ffu-danger);
}

.ffu-file-input {
  display: none;
}

.ffu-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 110px;
  padding: 20px;
  text-align: center;
  border: 2px dashed var(--ffu-border);
  border-radius: var(--ffu-radius);
  background-color: var(--ffu-bg-soft);
  color: var(--ffu-text);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.ffu-dropzone:hover,
.ffu-dropzone:focus-visible {
  border-color: var(--ffu-primary);
  background-color: #eef4ff;
  outline: none;
}

.ffu-dropzone.ffu-dropzone-active {
  border-color: var(--ffu-primary-dark);
  background-color: #e3edfd;
}

.ffu-dropzone.ffu-dropzone-disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.ffu-dropzone-text {
  font-weight: 500;
}

.ffu-dropzone-hint {
  font-size: 12px;
  color: var(--ffu-muted);
}

.ffu-preview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.ffu-preview-tile {
  position: relative;
  width: 84px;
  height: 84px;
  border: 1px solid var(--ffu-border);
  border-radius: 6px;
  overflow: hidden;
  background-color: var(--ffu-bg-soft);
}

.ffu-preview-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ffu-preview-tile .ffu-preview-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  height: 100%;
  font-size: 10px;
  color: var(--ffu-muted);
  padding: 4px;
  text-align: center;
  word-break: break-word;
}

.ffu-preview-tile .ffu-preview-icon svg {
  width: 26px;
  height: 26px;
  margin-bottom: 4px;
}

.ffu-preview-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  line-height: 18px;
  text-align: center;
  border-radius: 50%;
  background-color: rgba(17, 24, 39, 0.65);
  color: #ffffff;
  cursor: pointer;
  font-size: 13px;
}

.ffu-preview-remove:hover {
  background-color: var(--ffu-danger);
}

.ffu-progress-wrap {
  display: none;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.ffu-progress-wrap.ffu-progress-active {
  display: flex;
}

.ffu-progress-track {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background-color: #eaeaea;
  overflow: hidden;
}

.ffu-progress-bar {
  height: 100%;
  width: 0%;
  background-color: var(--ffu-primary);
  transition: width 0.1s ease;
}

.ffu-progress-label {
  min-width: 36px;
  font-size: 12px;
  color: var(--ffu-muted);
  text-align: right;
}

.ffu-submit-button {
  display: inline-block;
  padding: 9px 22px;
  background-color: var(--ffu-primary);
  border: none;
  border-radius: 6px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.ffu-submit-button:hover {
  background-color: var(--ffu-primary-dark);
}

.ffu-submit-button:disabled {
  background-color: var(--ffu-border);
  cursor: not-allowed;
}

@media (max-width: 480px) {
  .ffu-wrapper {
    max-width: 100%;
    padding: 16px;
  }

  .ffu-dropzone {
    min-height: 90px;
    padding: 14px;
  }
}
